PDA

View Full Version : Using DLL Interface in TS Easy Language Strategy


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;

NinjaTrader_Ray
06-03-2007, 11:22 AM
Hi robninja,

You are using the function incorrectly. The link below will take you to a sample EL reference strategy. Please take this code and build upon it to get to what your after.

http://www.ninjatrader-support.com/HelpGuideV6/SanpleStrategy.html