Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Entering Trade on Signal Bar
Collapse
X
-
Entering Trade on Signal Bar
Hi, I'm trying to backtest a strategy that enters longs when the low of the current bar crosses a moving average calculated from the lows of the series. However whenever the long gets triggered the strategy enters on the open of the next bar. Is there any way to have the strategy enter the longs at the price where it is crossing the moving average durring backtesting? Also, if running the strategy live in its current form would it behave the same way, only entering on the next bar?Tags: None
-
Hello,
This is because the criteria has to be met before the execution can be made. There is no way around this in backtesting.
If you are trading live or forward testing the execution will happen when the criteria is met (interbar if you have CalculateOnBarClose = false).DenNinjaTrader Customer Service
-
Ok, I'm testing out the strategy in live sim mode with updateonclose = false and the strat enters the trade when the price pierces the moving average. However I'm encounter a different problem now with the stops. In backtesting I have a breakeven stop that goes in effect when the Low[0] goes higher then breakeven on a long. But now in live sim mode what appears to be happening is that if the new bar opens above the breakeven then the stop goes into effect immediately, triggering if the low of that bar hits the stop.
I'm guessing that since i'm not using updateonclose I need to set the stop when Low[1] goes above breakeven?
Comment
-
Ok, that appears to be working now I'm having a new problem. When I enter the trade the system is looking back at the previous bar but if the low from that bar is above my breakeven then the stop triggers immediately on the signal bar resulting in multiple entries and stop outs. Is there someway I can determine how many bars the trade has been in to filter out this effect?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
5 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment