Success = NTCommand("PLACE","Sim101","BUY",1,"LIMIT",AVG.IN, 0,"GTC","","6E_ordID","ECRatchet","");
I added this to my EL code......it still does not work properly......
///....Send orders to Ninja Trader.............................
//IOG MUST BE ENABLED IN ORDER TO USE NTDIRECT.DLL
[IntrabarOrderGeneration = TRUE]
//THIS BEGINS THE SECTION THAT ENABLES NT PLATFOR TO GET MARKET DATA FROM TS
DefineDLLFunc: "NtDirect.dll", int, "Ask", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "Bid", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "Last", lpstr, double, int;
DefineDLLFunc: "NtDirect.dll", int, "Set", lpstr, int;
vars: intrabarpersist lastCurrentBar(-1),
intrabarpersist lastVolume(0),
vol(0);
if LastBarOnChart then begin
if lastCurrentBar <> CurrentBar then begin
vol = Volume;
lastVolume = 0;
end else begin
vol = Volume - lastVolume;
end;
lastCurrentBar = CurrentBar;
lastVolume = lastVolume + vol;
Ask(GetSymbolName, CurrentAsk, AskSize);
Bid(GetSymbolName, CurrentBid, BidSize);
Last(GetSymbolName, Close, vol);
end;
Vars: success(0);
{ place an order, if there is no position yet }
{ Copyright (c) 2005, NinjaTrader LLC [email protected] }
Comment