EntryOrder = EnterShortLimit(0, true, NbrContracts, EntryPrice, "Short");
(BTW: I'm backtesting this)
to see what is going on, I'm printing to the 'output' the time and price at the end of each bar, also in the
OnOrderUpdate() I print out the status of the 'EntryOrder' so I see something like...
1 83000 -> 923.25
++ Order='NT-00000/Back101' Name='C-O Short' State=PendingSubmit Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
++ Order='NT-00000/Back101' Name='C-O Short' State=Accepted Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
++ Order='NT-00000/Back101' Name='C-O Short' State=Working Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
++ Order='NT-00000/Back101' Name='C-O Short' State=Filled Instrument='ES 09-09' Action=SellShort Limit price=919 Stop price=0 Quantity=1 Strategy='ASTest1' Type=Limit Tif=Gtc Oco='' Filled=1 Fill price=919 Token='78654ea31d9b4cc18a1b9a755988de84' Gtd='12/1/2099 12:00:00 AM'
2 83300 -> 921.5
3 83600 -> 922.25
4 83900 -> 921
5 84200 -> 921.75
6 84500 -> 922.25
7 84800 -> 923
8 85100 -> 922
9 85400 -> 923.5
10 85700 -> 921.5
11 90000 -> 921.25
All of the state changes AND the fill occurs immediately instead of waiting for the price to occur.
What am I doing wrong? where can I find examples ??
Any response is greately appreciated.
Cheers - David
Comment