[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EL question - static variables?



PureBytes Links

Trading Reference Links

In easy language, if I want a variable that I can set it a bar and 
remains the same until I change it, how would I do that?

If I have a variable MyNum and use this statement

Variables MyNum(0);
If BarNumber = 10 then MyNum = Close;

that will set  MyNum to be the close of the 10th bar

Then later I want to use the value, how do I get MyNum?

If I'm anywhere but the 10th bar, MyNum will equal 0.

Is there a way that I can define a variable to be static or not need to 
use a bar number?

Thx,

Cash


throughout a strategy

"Buy Low, Sell High"
(If this statment is used for financial gain, I am entitled to 10% of all profits. ;) )