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

Re: maxbarsback ?



PureBytes Links

Trading Reference Links

It sets it to the maximum of the number of bars back you could reference either in a look-back loop or plotting back in time even if your code would never do that.

For example, 

if LastBarOnChart then begin
   Plot[100](Close, "C");
end;

will require a MaxBarsBack setting of 100 even though might have 1000 bars of data on the chart. 

Very painful! I wish they would dynamically determine the MaxBarsBack  requirement and simply give a run-time error message if you violate it...

Bob Fulks


At 03:38 PM 1/7/2006, you wrote:

>I am having an issue with maxbarsback. It is requiring far more bars back
>than logically it should per the code. Further the indicator in question
>uses monthly charts, where data sufficiency is an issue, and so I can't just
>add more bars to solve it.
>
>The biggest issue seems to be arising out of a loop that plots past values
>in arrears after a period of time has passed. The code never does this on
>currentbar=1, but maxbarsback appears to be allowing for a  maximum
>"plotting in arrears"  at cb=1 that never happens nonetheless. It does not
>matter whether it is set to auto or manual. Removing this section of code
>helps some, however even with this out it is taking several years of monthly
>bars more than it should.
>
>Does anyone have a list of what maxbackbars checks? Any ideas? I am clearly
>missing something.