Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
EnterLongLimit, EnterLongStopMarket ignored in OnOrderUpdate?
Collapse
X
-
Leave a comment:
-
EnterLongLimit, EnterLongStopMarket ignored in OnOrderUpdate?
Hello,
In latest NT8 (RC2) I have a problem placing the correct exit orders for my strategy.
The problem is that once an order is filled, I want to place the corresponding Exit Orders for a Target and a Stop using ExitLongLimit, ExitLongStopMarket. It seems like that NT8 is completly ignoring those orders on live/simulation strategies - however it is honoring the exits on backtesting...
In order to reproduce I created a simply modification to the SampleMAStrategy. Just take the code below and do a simulation. You will see that NT8 completly ignores the Exit Orders once filled.
Code:protected override void OnBarUpdate() { if (CurrentBar < BarsRequiredToTrade) return; if (CrossAbove(smaFast, smaSlow, 1)) EnterLong(); } protected override void OnOrderUpdate(Cbi.Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, Cbi.OrderState orderState, DateTime time, Cbi.ErrorCode error, string comment) { if(orderState==OrderState.Filled) { ExitLongLimit(0,true,1,limitPrice+10*TickSize,"Exit TP2","long2"); ExitLongStopMarket(0,true,1,limitPrice-10*TickSize,"Exit SL2","long2"); } }
Kind regards,
OliverTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Max238, Today, 01:28 AM
|
1 response
21 views
0 likes
|
Last Post
by CactusMan
Today, 06:18 AM
|
||
Started by giulyko00, Yesterday, 12:03 PM
|
2 responses
10 views
0 likes
|
Last Post
by giulyko00
Today, 06:11 AM
|
||
Started by r68cervera, Today, 05:29 AM
|
0 responses
4 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
6 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
37 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
Leave a comment: