SetStopLoss("long_signal", CalculationMode.Price, current_SL, false); SetProfitTarget("long_signal", CalculationMode.Price, current_TP, true); __entry_long_order = EnterLongMIT( 0, true, __quantity, long_price, "long_signal");
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
MIT Orders filled immediately
Collapse
X
-
MIT Orders filled immediately
Hello, I was wondering why are my MIT orders filled immediately rather than when the price reaches the StopPrice I am setting?
Code:
Tags: None
-
Hello Keith,
Thank you for your post.
If your strategy is ever resulting in unexpected behavior, I recommend adding prints to debug and further understand what is occurring. For more information about using print statements to debug your code:
https://ninjatrader.com/support/foru...ing#post791121
For example, you could add a print similar to the following both outside of the condition as well as inside of the condition that triggers your long entry:
Code:Print(string.Format("{0} Quantity: {1} Long Price: {2} Long Signal: {3} Current Price: {4}", Time[0], __quantity, long_price, long_signal, Close[0]));
Please let us know if we may be of further assistance.Emily C.NinjaTrader Customer Service
Comment
-
Hi Emily thanks for your response. Yes, I am using not just simple Print loging but I am aso loging to a file, and I also attach the process to the Ninjatrader EXE binary and debug it as it happens. Still: I am unable to figure out why on earth is the MIT order filled immediately after being sent and clearly very far away from the Stop Price?
I forgot to mention: I am using a Playback connection, I have downloaded the playback data with the Kinetic End of Day connection, then replayed it with the playback data connection. Is that somehow related to this issue?
Thanks again.
Comment
-
Hello belzegor,
Thank you for your reply.
I do not suspect that this is related to using the Playback connection. Please review your strategy and make sure that orders are being submitted to the correct side of the market; for example, Buy MIT orders and Buy Limit orders should go below the current market price, and Sell MIT/Sell Limit orders should go above the current market price. If you submit an MIT order to the other side of the market, it is possible that this would result in a seemingly immediate fill.
Please let us know if we may be of further assistance.Emily C.NinjaTrader Customer Service
Comment
-
Hello belzegor,
Thank you for your reply.
The different order types are explained here:
https://ninjatrader.com/support/help...rder_types.htm
If you are looking to place a buy order that is filled if the price touches the value, and have that buy order above the current market price, it sounds like you would need to use a Buy Stop order using EnterLongStopMarket:
https://ninjatrader.com/support/help...stopmarket.htm
Please let us know if we may be of further assistance.Emily C.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by orestejr, Today, 11:58 AM
|
0 responses
6 views
0 likes
|
Last Post
![]()
by orestejr
Today, 11:58 AM
|
||
Started by nickslad, Today, 09:58 AM
|
1 response
14 views
0 likes
|
Last Post
|
||
Started by tradgrad, Today, 11:36 AM
|
1 response
5 views
0 likes
|
Last Post
|
||
Started by patdmoney, Today, 10:55 AM
|
3 responses
18 views
0 likes
|
Last Post
|
||
Started by SteveReiza, Today, 10:59 AM
|
2 responses
21 views
0 likes
|
Last Post
![]()
by SteveReiza
Today, 11:34 AM
|
Comment