How do I test this before implementing, using historical data?
I get no errors when I run this strategy as presented below when NT is on the same machine - I also get nor orders.
When I try to connect to a networked computer, which is what I ultimately need to do, it does not find the DLL. Note the commented code. The computer name the NT will run on is "graphics", on an XP network.
[IntraBarOrderGeneration = TRUE] {DefineDLLFunc: "NTDirect.dll", int, "Setup", lpstr, int;} inputs: numContracts(2); variables: nHigh(0), nLow(0); variables: lFullDay(false), success(0); if Date <> Date[1] then begin lFullDay = true; nHigh = High; nLow = Low; { SetUp("graphics", 36973);} end; if lFullDay and NTConnected(1) then PRINT("c:\GG.TXT", "IN"); begin {go long if price > high of 1st bar } if High > nHigh and ntMarketPosition("") = 0 then begin success = NTBuyMarket("FirstBar",numContracts); print("Position Size: " + NumToStr(NTMarketPosition(""),0)); print("Avg Fill Price: " + NumToStr(NTAvgFillPrice("FIrstBar"),2)); end; if Low < nLow and ntMarketPosition("") = 0 then begin success = NTSellMarket("FirstBar",numContracts); print("Position Size: " + NumToStr(NTMarketPosition(""),0)); print("Avg Fill Price: " + NumToStr(NTAvgFillPrice("FIrstBar"),2)); end; end;
Comment