IE: "TTS1"
DefineDLLFunc: "NtDirect.dll", int, "Command", lpstr, lpstr, lpstr, lpstr, int, lpstr, double, double, lpstr, lpstr, lpstr, lpstr, lpstr;
inputs: Quantity(1),MonthContract("ER2 12-07"), account("?????????");
Vars: intrabarpersist mp(0), NTID(0);
if LastBarOnChart and mp <> I_MarketPosition and NTConnected(1) then begin
If mp = 0 and I_MarketPosition = -1 then
NTID = Command("place" , account, MonthContract, "sell", Quantity, "MARKET",0,0, "DAY","","", "TTS1","");
If mp = 0 and I_MarketPosition = 1 then
NTID = Command("place" , account, MonthContract, "BUY", Quantity, "MARKET",0,0, "DAY","","", "TTL1","");
If mp = 1 and I_MarketPosition = -1 then
NTID = Command("REVERSEPOSITION" , account, MonthContract, "sell", Quantity, "MARKET",0,0, "DAY","","", "TTS1","");
If mp = -1 and I_MarketPosition = 1 then
NTID = Command("REVERSEPOSITION" , account, MonthContract, "BUY", Quantity, "MARKET",0,0, "DAY","","", "TTL1","");
If t > 1400 and mp <> 0 and I_MarketPosition = 0 then
NTID = Command("CLOSEPOSITION" , account, MonthContract,"",0,"",0,0,"","","","","");
end;
mp = I_MarketPosition;
Plot1(mp);
Comment