robninja
06-03-2007, 08:12 AM
I have installed the els/eld files from NT bin folder and have tried implementing the NTBuyMarket command etc in a script but I get the following error: trying to reference at data to future. Bar reference value: -1. My code works with standard easylanguage buy/sell commands and I can backtest it but for some reason with the NT codes I get the error. Here's a copy of the code command lines:
if currentbar=1 and NTConnected(1) then begin
if NTMarketPosition("") = 0 then begin
if MA crosses over MA2 then NTBuyMarket("",1) next bar;
end;
end else begin
if MA crosses under MA2 then NTSellMarket("",1) next bar;
end;
if currentbar=1 and NTConnected(1) then begin
if NTMarketPosition("") = 0 then begin
if MA crosses over MA2 then NTBuyMarket("",1) next bar;
end;
end else begin
if MA crosses under MA2 then NTSellMarket("",1) next bar;
end;