I get the following error message:
Error in study "xxxxx": :Tried to reference back more bars (26) than allowed by the current MaxBarsBack setting. Please increase the MaxBarsBack setting.
I increased to 50, 100... doesn't change a thing.
I get it because I added a new condition in a working code, as per below:
Code: Select all
// ======================================================
if (open_long = 1) and (first_entry_long >=1) and (barssinceentry = 4) and (Close >= entry_long) then begin
Buy ("LEx2") 100 shares next bar at market;
open_long = 2;
end;
// ======================================================
if the backtest has already traded once (first_entry_long >=1)
if a position is already opened (open_long = 1)
if the open position is still on after 4 bars (barssinceentry = 4)
if the position has a positive carry (Close >= entry_long) then begin
then
Buy ("LEx2") x shares next bar at market;
And update trigger (open_long = 2);
Can anyone help me on that?
Thank you very much,
N.