Page 1 of 1

MACD & ADX - 'Active := false', has no effect.

Posted: Thu Jun 19, 2008 7:48 pm
by 10548832
Hi guys; thanks for your previous help. I have a problem with hiding and showing the MACD & ADX Function Series.

The following work fine:

Stochasticseries.Active := false;
RSIseries.Active := false;

All the financial functions behave appropriately. They dissappear off the chart when ACTIVE := false, and return with setting ACTIVE := true;

BUT NOT so with the MACD & ADS function series. I guess this has to do with these functions each being comprised of more than one series.

How do I get the MACD & ADX functions to completley dissappear and reappear when I want? Setting ACTIVE has no effect on them. I don't want to free them and replot them.

Thanks.

Posted: Fri Jun 20, 2008 8:26 am
by yeray
Hi Phineas,

As you can see in MACD demo in All features/Functions/Financial, when you add the function, a Line series and a function are created. And inside the function there are two series. So you'll have to deactivate all this series. And the same happens to ADX function. An example will be more descriptive:

Code: Select all

type
  TForm1 = class(TForm)
    Chart1: TChart;

    Series1: TCandleSeries;  //our source

    Series2: TLineSeries;    //our ADX function
    TeeFunction1: TADXFunction;

    Series3: TLineSeries;    //our MACD function
    TeeFunction2: TMACDFunction;

    CheckBox1: TCheckBox;
    procedure CheckBox1Click(Sender: TObject);

//...

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  Series2.Active := CheckBox1.Checked;
  TeeFunction1.DMDown.Active := Series2.Active;
  TeeFunction1.DMUp.Active := Series2.Active;

  Series3.Active := CheckBox1.Checked;
  TeeFunction2.MACDExp.Active := Series3.Active;
  TeeFunction2.Histogram.Active := Series3.Active;
end;