Error - Bars reference value: -1 for strategy NT
Posted: May 30 2007
I am trying to run a strategy that I create in Multicharts and send it to NT using the eld/els scripts designed for TS. It was successful just using regular easylanguage code to buy at market, sell, short, buytocover but when I substitute these commands with NT commands NTBuyMarket, NTSellMarket and NTClosePosition I get the following error when loading the charts: "Trying access to data at future. Bars reference value: -1". Here is a paste of the command I wrote for a long entry (basic ma cross):
ifNTConnected(1)andLastBarOnChartthenbegin
ifclose crosses above mathenNTBuyMarket("",1)nextbar;
end;
ifNTConnected(1)andLastBarOnChartthenbegin
ifclose crosses above mathenNTBuyMarket("",1)nextbar;
end;