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

Re: EL question - static variables?



PureBytes Links

Trading Reference Links


Try:

Var: MyClose(close);

if barnumber = 10 then MyClose = close;

Friday, August 10, 2001, 14:14:53, you wrote:

> 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. ;) )