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

Re: understanding easylanguage code



PureBytes Links

Trading Reference Links

I don't have TS in front of me but, as I recall, currentbar is an
internal reserved word, always active, and barnumber is an easylanguage
function. In effect, you're making TS calculate the same thing twice if
you call the barnumber function. 

As I recall, sometime in ancient history, there was a bug with
currentbar initializing correctly at currentbar = 1 on the next bar
after the first (maxbarsback) bars had passed on the chart. So they
created the barnumber EL function that couldn't start counting until
maxbarsback had passed. The bug has been fixed so they both return the
same number now. 

In practice, the only difference is the syntax if you need to refer to
previous values. Barnumber[3] works but currentbar[3] doesn't. Instead
you need to use currentbar - 3.

SVE wrote:
> 
> why not use
> 
> barnumber = 1
> 
> what is the difference?

-- 
  Dennis