Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Order Quantity and GAPs
Collapse
X
-
Order Quantity and GAPs
I want to backtest an EOD strategy and asking myself how to handle GAPs when calculating the order quantity. When OnBarUpdate() is executed, the Open-Price of the next bar is not yet available. A quantity calculation based on Close[0] may be wrong in case of GAPs. Is there a way to pass the amount of money instead of the quantity to the order functions. A limit is not a solution, because the trade shall be executed even if the limit is not reached again.Tags: None
-
I ' m using e.g. EnterLong and want to buy Stocks for a fixed amount, e.g. 10000$.
When I calculate quantity=10000/Close[0] and there is a GAP of 3%, the quantity shall be reduced by 3%.
Im looking e.g. for a funktion, that has a currency as pasameter EnterLong(10000$);
Comment
-
tbmuc,
Unfortunately there is no way to currently do this. You would need to perform the calculation for the quantity using some other method.
You could try using a COBC = false strategy and then separate logic by tick and by closing of the bar, then submit an order on the 1st tick of a new bar, checking for Close[0] then.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
-
tbmuc,
Unfortunately you would need intraday data for this.
You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
161 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
311 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
350 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
Comment