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
Exiting on market with historical tick data
Collapse
X
-
Hi Wayne, in backtesting the script would have per default access to the OHLCV info of the primary series and conditions / trades are processed with CalculateOnBarClose = true. That means when you bar has closed > it would process the exit then on the next tick / open of next bar. You could submit to another / finer series though in backtesting to simulate intrabar fills here.
-
Exiting on market with historical tick data
I have 3 years of ES tick data. I am backtesting a strategy that Enters with a massive stop loss and a small profit target.
I have a section of code that once in a position checks a condition from an indicator in a different time frame.
It says
if(blah blah)
ExitLong("longtrade");
The problem is, this exits the position at the next traded tick. This is unrealistic. I need it to exit at the close of the last bar +1. So if (blah blah) is a 1 min bar, and it closes, giving the indicator the data it needs to check the condition, then I want to exit at that price plus one tick against me, in order to simulate always taking the market price.
I've read for hours on this forum and been able to answer all my questions, except for this one. So I just want to know how can I do this?
Thanks in advance,
WayneTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by eduardodipp7, Today, 10:29 AM
|
1 response
4 views
0 likes
|
Last Post Today, 12:35 PM | ||
Started by spottysallrite, Today, 11:31 AM
|
3 responses
9 views
0 likes
|
Last Post Today, 12:32 PM | ||
Started by adeelshahzad, Today, 11:49 AM
|
3 responses
5 views
0 likes
|
Last Post Today, 12:22 PM | ||
Started by johnMoss, 03-04-2024, 01:53 PM
|
2 responses
35 views
0 likes
|
Last Post
by Overnhou
Today, 11:21 AM
|
||
Started by Padan, Today, 02:02 AM
|
5 responses
17 views
0 likes
|
Last Post Today, 11:14 AM |
Leave a comment: