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
Backtesting
Collapse
X
-
Hello vonyoldel,
Thank you for your post.
For NinjaTrader 8. Please download historical data for the instrument and dates you want to backtest.
To download historical data first make sure NinjaTrader is connected and historical data is available from your data provider.
1. In the Control Center, go to Tools > Import > Historical Data > Expand the Download menu
2. Select an instrument for data to be downloaded. (Tip: You may also select an instrument list)
3. Select the desired Start and End date range
4. Select the desired Intervals and Data Types
5. Press the "Download" button to begin the download
A message in the bottom right of the Historical Data Window will appear and display the status of the download.
To cancel a historical data request close the Historical Data Window window.
To run a Backtest of a strategy:
1. Open a Strategy Analyzer window under New > Strategy Analyzer. Select the Backtest type of "Standard" 2. Select the strategy you would like to backtest 3. Select the instrument and Data Series you would like to backtest 4. Set the strategy and backtest parameters (See the "Understanding backtest properties" section below for property definitions) 5. Select the "Run" button to start the backtest
Here is a video tutorial that covers how to backtest a strategy using the Strategy Analyzer: NinjaTrader 8 - Backtesting Strategies
Here is the Backtest a Strategy Help Guide to assist you further.
Backtest a Strategy
Here is the Discrepancies: Real-Time vs Backtest Help Guide article, which will detail the differences in fills when using Market Replay, Live, Simulated feeds and Backtests to assist you further.
Please do not hesitate to contact us for any other NinjaTrader inquiries you may have.
Shawn B.NinjaTrader Customer Service
-
Hello,
I followed the steps here for downloading historical data since Jan 1, 2019. The connection for My Ninjatrader Continuum was active. When clicking download, it lit up for one or two seconds and said loading data in the bottom right of the window. There was no indication after that. After waiting some minutes, I attempted to run backtesting with the data, also following the steps above and there were no results. I tried then to download only data for this month and backtest. I also got no results. What am I missing?
Comment
-
Originally posted by NinjaTrader_ShawnB View PostHello vonyoldel,
Thank you for your post.
For NinjaTrader 8. Please download historical data for the instrument and dates you want to backtest.
To download historical data first make sure NinjaTrader is connected and historical data is available from your data provider.
1. In the Control Center, go to Tools > Import > Historical Data > Expand the Download menu
2. Select an instrument for data to be downloaded. (Tip: You may also select an instrument list)
3. Select the desired Start and End date range
4. Select the desired Intervals and Data Types
5. Press the "Download" button to begin the download
A message in the bottom right of the Historical Data Window will appear and display the status of the download.
To cancel a historical data request close the Historical Data Window window.
To run a Backtest of a strategy:
1. Open a Strategy Analyzer window under New > Strategy Analyzer. Select the Backtest type of "Standard" 2. Select the strategy you would like to backtest 3. Select the instrument and Data Series you would like to backtest 4. Set the strategy and backtest parameters (See the "Understanding backtest properties" section below for property definitions) 5. Select the "Run" button to start the backtest
Here is a video tutorial that covers how to backtest a strategy using the Strategy Analyzer: NinjaTrader 8 - Backtesting Strategies
Here is the Backtest a Strategy Help Guide to assist you further.
Backtest a Strategy
Here is the Discrepancies: Real-Time vs Backtest Help Guide article, which will detail the differences in fills when using Market Replay, Live, Simulated feeds and Backtests to assist you further.
Please do not hesitate to contact us for any other NinjaTrader inquiries you may have.
I am trying to build a simple EMA crossover strategy. Long at the Close of EOD Bar after Fast EMA crosses above the Slow EMA. However backtest results show that the entry is not being taken at the close. I have tried all the workarounds I know of to get the backtest to go Long/Short at the close of the bar.
I also do not see the option "STANDARD" as mentioned in your quoted reply for backtest option.
I have a simulation license, could this be any concern.
Thanks
Shrenik
Comment
-
Hello ronaldgreene828,
Thanks for your post.
Originally posted by ronaldgreene828 View PostHello,
I followed the steps here for downloading historical data since Jan 1, 2019. The connection for My Ninjatrader Continuum was active. When clicking download, it lit up for one or two seconds and said loading data in the bottom right of the window. There was no indication after that. After waiting some minutes, I attempted to run backtesting with the data, also following the steps above and there were no results. I tried then to download only data for this month and backtest. I also got no results. What am I missing?
Paul H.NinjaTrader Customer Service
Comment
-
Hello ShrenikGolchha,
Thanks for your reply.
Originally posted by ShrenikGolchha View Post
Hi,
I am trying to build a simple EMA crossover strategy. Long at the Close of EOD Bar after Fast EMA crosses above the Slow EMA. However backtest results show that the entry is not being taken at the close. I have tried all the workarounds I know of to get the backtest to go Long/Short at the close of the bar.
I also do not see the option "STANDARD" as mentioned in your quoted reply for backtest option.
I have a simulation license, could this be any concern.
Thanks
Shrenik
Are you using daily bars for your Strategy?
Paul H.NinjaTrader Customer Service
Comment
-
Hi Paul,
The first selection at the top of the strategy analyzer "settings", That is exactly where I do not see the "Standard" option.
Yes I am using Daily bars for my strategy.1 Photo
Comment
-
Hello ShrenikGolchha,
Thanks for your reply.
The screenshot that shows "standard' is from our help guide and the picture provided needs to be updated, so my apologies for that confusion and we will get it updated, but that is the line where you would select the backtest type, so if you show "Backtest" then you are in the right place for a standard backtest (standard as compared to optimization).
With historical data, a strategy can only calculate at the end of the bar (end of the day). If the strategy logic is to place an order, the order would not be filled until the next day. Is this what you are seeing?
Paul H.NinjaTrader Customer Service
Comment
-
Hi Paul,
Thanks for the clarification about backtest. It helps clear the confusion.
Regarding back testing, what you mentioned is right. I am able to see entry on the next bar but at the close price of previous bar. Can we not get the entry on the same bar at close?
Also I am trying this ( Simple EMA Crossover Strategy) since a long time now and just not able to reach anywhere. The longs/shorts and their respective exits are just haywire.
I have attached screenshots for your reference.
Thanks5 Photos
Comment
-
Hello ShrenikGolchha,
Thanks for your post.
If your code is running once, at the end of the daily bar, then you would never be filled at the end of the same bar. To accomplish your entry goal, you would need to have the strategy run before the end of the session. A suggestion, if you can only use the strategy builder, is to use a smaller time frame (intraday bars) and then use a time filter to perform the analysis and entry action prior to the end of the day. You can find an example of a time filter in the strategy builder help guide in the section, "How to create time filters" here: https://ninjatrader.com/support/help...on_builder.htm
In your screenshots I see that you have both and entry and exit condition occurring at the same time. Entry methods will automatically close any existing position in the opposite direction (it will show as "Close position" on the chart. You may also be in violation of the "Internal Order Handling Rules that Reduce Unwanted Positions" which could cause orders to be ignored. I would advise to review the "Log" tab of the control center when you run the strategy as it may provide such a warning. Please see the help guide here for further details: https://ninjatrader.com/support/helpGuides/nt8/en-us/?managed_approach.htm
Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
147 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
5 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
4 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
Comment