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

EOF?



PureBytes Links

Trading Reference Links

Another newbie question:

I use ProSuite v5 and essentially I'm trying to determine if there's an
end-of-file reserved word I can use to stop a "While" loop.

For example, I'd like to write a function that returns the maximum
differential between two moving averages over a period of time.  For
example, if I subtract the 20-day MA from the 10-Day MA I get a
differential.  But if I know the maximum differential over the number of
days I'm studying, I can put the differential on a percentage basis -
similar to the way RSI does it.  The pseudo code might look something like
this:

While CurrentBar <> LastBar
Begin
  mDiff = MA10 - MA20;
  If mDiffMax < mDiff Then mDiffMax = mDiff;
End;

If there's a reserved word that tells me the total number of bars the file
has open, I could also do a While loop with a counter.  Seems like
EasyLanguage should have something like CurrentBar, LastBar, or
TotalNumberOfBars, but I've looked and can't find them.  Can someone point
me in the right direction here?

And as I've indicated, I'm new to TS so there might be an easier way to do
what I'm trying to do.  If that's the case, I would appreciate someone
telling me how to do this.

Thanks in advance.

John Wood