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

RE: omega question



PureBytes Links

Trading Reference Links

At 2:58 PM -0700 6/25/98, Troutman, Defender of Sticks wrote:

>On Behalf Of Bob Fulks

>>Vars: SaveBar(0);

>>{Save bar number of the bar you want}
>>If <condition> then SaveBar = CurrentBar;


>Saaayyyy... does that mean EasyLanguage retains the contents of variables
>from bar to bar??? So, if <condition> is met on Day 1, SaveBar will still
>have the value it was originally assigned on Day 2 (assuming no
>reassignment)? I had assumed (probably naively) that variables were reset
>on each bar's execution, since it sort of looks like the variables are
>redefined at each bar. Not that I should expect Omega's language to behave
>like a normal structured programming language, but I guess I got careless
>here.

Variables are initialized to the value specified in the "Vars:" statement
prior to the execution of the code at CurrentBar = 1. From that point on,
they retain that value until redefined by an assignment statement on some
bar. They then retain that new value until again specified by an assignment
statement on that or some other bar.

Thus, in the above, "SaveBar" will contain the same number until
<condition> is again true on some future bar.

Bob Fulks