How to initialize member variables?

 

Hello,


I define an include where my member variables defined and where I use for my Buy/Sell Signals.

So after a Stopp/Loss I create a method which initialize the member variable to 0. This method will be called, but the member variable includes the values before the Stopp/Loss.

How can I effectively reinitialize my member variable?


Thanks for a hint or code example,


Kind regards,
Hoschie

 
Don't reinitialize anything. Initialize them when you open the trade. Once the trade closes their values are irrelevant.
 
WHRoeder:
Don't reinitialize anything. Initialize them when you open the trade. Once the trade closes their values are irrelevant.

Hi WHRoeder,


the reason why I ask for this is, that my programm buy and sell using Lows and high which are saved in member variables. Then I use time segments where trades start and should be finished.

For example the first trade starts from 00 pm to 8 am and then at 8 am the existing order should be closed and the programm should be start from the scratch to find new highs and lows saving them in member variables.

In the second step the program should run from 8 am to 12 am and closing the existing order and vice versa.

How can I implement this with initialized variables?

Kind regards,

Hoschie

 
Hoschie:
the programm should be start from the scratch to find new highs and lows saving them in member variables.
no saving required int newHigh = High[Highest(NULL,0, MODE_HIGH, limit, 1)];