Is this allowed? Is it valid? Since Ninjatrader is using say a 5 minute bar, it knows the OHLC. How would it know which price (entry or exit) was hit first?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Enter & Exit on the same bar
Collapse
X
-
Enter & Exit on the same bar
I wrote a strategy that sometimes enters and exits on the same bar. I set a stop loss and profit target and sometimes one of these are hit on the same bar.
Is this allowed? Is it valid? Since Ninjatrader is using say a 5 minute bar, it knows the OHLC. How would it know which price (entry or exit) was hit first?Tags: None
-
Hi cunparis,
You are right that NinjaTrader does not know which one is hit first so what NinjaTrader does in these situations is take the most conservative approach that will not overestimate your results. It will fill the stop loss.
Not sure what you mean by which comes first though for entry and exit. You will not be able to exit unless you've entered already.Josh P.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Josh View PostHi cunparis,
You are right that NinjaTrader does not know which one is hit first so what NinjaTrader does in these situations is take the most conservative approach that will not overestimate your results. It will fill the stop loss.
Not sure what you mean by which comes first though for entry and exit. You will not be able to exit unless you've entered already.
Now let's say price goes from 910 to 900 in the next bar.
Will Ninjatrader:
- give me a fill at 900 and keep position open?
- give me a fill at 900 and stop loss at 910?
I'm not sure which it's doing.
Thanks
Comment
-
Originally posted by NinjaTrader_Josh View PostNot sure I am following your scenario, but what I recommend is for you to use TraceOrders = true. Follow the trace outputs for your orders and then you will know exactly what is happening and in what order.
If I put a limit order 900, stop loss 895 and profit target 905.
is it possible for Ninjatrader to give me the fill at 900 and profit target at 905 in the backtest when in reality price went from 900 to 895 before reaching 905?
I got some good results but I'm thinking there is aproblem and it's not possible.
Comment
-
Originally posted by NinjaTrader_Josh View PostIf the bar in question touched 895 as well as 905 you will be filled at the stop for 895 to prevent overestimation.
Comment
-
Hi,
Just to build on from this, is it technically possible to adapt the fill code (for the purpose of backtesting) to basically say:
if entry order short has been filled in this bar then do not fill target order in the same bar if bar is green
or something along those lines?
would just make backtesting a bit more realistic
Comment
-
You can create your own custom fill types, but the only information we can provide on that endeavor can be found here: http://www.ninjatrader-support.com/H...FillTypes.htmlJosh P.NinjaTrader Customer Service
Comment
-
Thanks ctrlbrk!
skat100, please review this link here - http://www.ninjatrader-support.com/H...aceOrders.htmlBertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, 04-17-2024, 06:40 PM
|
3 responses
26 views
0 likes
|
Last Post Today, 07:41 AM | ||
Started by bmartz, 03-12-2024, 06:12 AM
|
3 responses
27 views
0 likes
|
Last Post Today, 07:38 AM | ||
Started by Aviram Y, Today, 05:29 AM
|
2 responses
8 views
0 likes
|
Last Post
by Aviram Y
Today, 07:38 AM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:30 AM | ||
Started by cls71, Today, 04:45 AM
|
1 response
7 views
0 likes
|
Last Post Today, 07:25 AM |
Comment