Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer and Commission settings for NinjaTrader 8 for Forex Trading

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by NinjaTrader_PatrickG View Post
    Due to the fundamental nature of how Heiken Ashi bars are formed, it's not possible to accurately backtest them. Other bar types which aren't created in the same manner as Heiken Ashi bars would work for your backtesting and closely match real-time results as long as you consider the other expected differences between real-time and historical results.
    Hi Patrick. So you're saying Heiken Ashi bars will not ever backtest correctly? Are there other bar types that do this? Thanks

    Comment


      #17
      Hello trader14,

      Thanks for your post and welcome to the NinjaTrader forums!

      To backtest a bar type you have to understand how it is constructed. A regular candlestick bar has a real Open, High, Low and Close value that truly represent where price moved from/to. The Heiken-Ashi candlestick is more like an indicator to show a trend and the Heiken-Ashi bar is constructed differently than real price movement. Please see this link for a better overview of how these bars are constructed: https://www.investopedia.com/trading...r-candlestick/ When you review the math behind the Heiken-Ashi candlestick construction, in the article, you can see that it is presenting false data but in the interest of representing a trend.

      Renko bars are another bar type that does not present a correct picture of price movement and again the purpose of that bar type is to show a trend. Here is a link that reviews Renko bars: https://www.investopedia.com/terms/r/renkochart.asp

      When backtesting in the strategy analyzer, the data is provided with only the Open, High, Low and Close of the finished bar and you do not see the actual price movement that led to the finished bar. For most bar types, backtesting is not an issue because the finished bar represents the true price movement. Heiken-Ashi and Renko bars both do not represent the actual movement of price.

      Strategies can be created for those bar types and we recommend using Playback with market replay data to reasonably test them as playback provides all of the ticks that make up each bar. Because playback includes all of the data, it is a much slower means of backtesting than using the strategy analyzer.

      For your understanding, you may want to create a chart that has both regular 1-minute bars and also 1-minute Heiken-Ashi bar and connect to real-time data and measure the differences between the bars. You can also create a chart with Renko bars and for this pay attention to where the bar starts and finishes in real time.


      Paul H.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_PaulH View Post
        Hello trader14,

        Thanks for your post and welcome to the NinjaTrader forums!

        To backtest a bar type you have to understand how it is constructed. A regular candlestick bar has a real Open, High, Low and Close value that truly represent where price moved from/to. The Heiken-Ashi candlestick is more like an indicator to show a trend and the Heiken-Ashi bar is constructed differently than real price movement. Please see this link for a better overview of how these bars are constructed: https://www.investopedia.com/trading...r-candlestick/ When you review the math behind the Heiken-Ashi candlestick construction, in the article, you can see that it is presenting false data but in the interest of representing a trend.

        Renko bars are another bar type that does not present a correct picture of price movement and again the purpose of that bar type is to show a trend. Here is a link that reviews Renko bars: https://www.investopedia.com/terms/r/renkochart.asp

        When backtesting in the strategy analyzer, the data is provided with only the Open, High, Low and Close of the finished bar and you do not see the actual price movement that led to the finished bar. For most bar types, backtesting is not an issue because the finished bar represents the true price movement. Heiken-Ashi and Renko bars both do not represent the actual movement of price.

        Strategies can be created for those bar types and we recommend using Playback with market replay data to reasonably test them as playback provides all of the ticks that make up each bar. Because playback includes all of the data, it is a much slower means of backtesting than using the strategy analyzer.

        For your understanding, you may want to create a chart that has both regular 1-minute bars and also 1-minute Heiken-Ashi bar and connect to real-time data and measure the differences between the bars. You can also create a chart with Renko bars and for this pay attention to where the bar starts and finishes in real time.

        Ty for responding. So, just to reiterate. What you're saying is that time bars and range bars are the ONLY bars that will give accurate results when backtesting? In other words, don't back test using heiken ashi or renko bars? It seems strange that if heiken ashi and renko bars aren't accurate, why do they even show up under the backtest bar type as an option?

        Comment


          #19
          Hello trader14,

          Thanks for your reply.

          To clarify, time and range bars show actual price movement and most any strategy type would work with them. With these bars you know the high is high and low is low, close is close and open is open.

          It is possible to backtest "exotic" bars, however, it takes consideration of the way the bars are built, the historical values supplied, and also depends upon the way the strategy is constructed to work with the data. For example, in the case of Heiken-Ashi bar, if you place a limit order at a certain value it may get filled in the strategy analyzer (because the bar high goes through the price) but in real time it would not because the price never really went there. Contrast that with a strategy that enters a market order when the Heiken-Ashi changes from an up bar to a down bar. That is a bit of an oversimplification but the bottom line here is you need to have a good understanding of the "exotic" bar types and a strategy type that will work with them.

          To restate, some exotic bars do not display actual price movement and if you write your strategy based on what you see of these exotic bars and do not consider or understand the underlying data (the actual price movement), your strategy will generate false/misleading results.



          Paul H.NinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_PaulH View Post
            Hello trader14,

            Thanks for your reply.

            To clarify, time and range bars show actual price movement and most any strategy type would work with them. With these bars you know the high is high and low is low, close is close and open is open.

            It is possible to backtest "exotic" bars, however, it takes consideration of the way the bars are built, the historical values supplied, and also depends upon the way the strategy is constructed to work with the data. For example, in the case of Heiken-Ashi bar, if you place a limit order at a certain value it may get filled in the strategy analyzer (because the bar high goes through the price) but in real time it would not because the price never really went there. Contrast that with a strategy that enters a market order when the Heiken-Ashi changes from an up bar to a down bar. That is a bit of an oversimplification but the bottom line here is you need to have a good understanding of the "exotic" bar types and a strategy type that will work with them.

            To restate, some exotic bars do not display actual price movement and if you write your strategy based on what you see of these exotic bars and do not consider or understand the underlying data (the actual price movement), your strategy will generate false/misleading results.


            Thanks Paul. Sticking with tick, range, and time bars for now.

            On a different note, I'm attempting to create an input of an EMA so I can quickly change EMAs while backtesting. This is not working though, and I'm having to recreate a new strategy every time I want to test a different EMA. What's the solution?

            Comment


              #21
              Hello trader14,

              Thanks for your reply.

              As you question is off topic, any future questions, please start new thread as everyone on this thread is getting notified of each new message.

              To answer your question, you will want to create a public input for the EMA period. If you are using the strategy builder, you would create this in the inputs section (not variables section as those would be internal to strategy only). If you are writing your strategy in Ninjascript, I recommend using the strategy wizard and there create the input(s) needed and the structures are likewise created for you.
              Paul H.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_PatrickG View Post
                Due to the fundamental nature of how Heiken Ashi bars are formed, it's not possible to accurately backtest them. Other bar types which aren't created in the same manner as Heiken Ashi bars would work for your backtesting and closely match real-time results as long as you consider the other expected differences between real-time and historical results.
                So, a question related to this:

                Can Playback mode generate Heikin Ashi Bars? I understand that there may be differences in real-time and Playback but I would imagine that HA bars would be rendered. In my experience, I have rarely seen HA bars form with wicks, even in Playback mode. At least using NT8 8,9,18.0 (64 bit).

                Can you confirm?

                Comment


                  #23
                  Hello wildwex,

                  Thanks for your post.

                  Yes, playback will generate Heiken-Ashi Bars.

                  Heiken-Ashi bars will display wicks when using the default chart style of Candlesticks. I've attached a recent example from ES 06-19:

                  Click image for larger version

Name:	wildwex-1.PNG
Views:	764
Size:	41.2 KB
ID:	1061733
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #24
                    Paul, is that to say that we can trust Heiken Ashi results in Playback Market Replay as much as the other bars?

                    When I'm in market replay and I click the Strategy Performance, can I trust the "historical" or only the "real time" tabs it offers me from the chart?

                    Thanks!

                    Comment


                      #25
                      Hello TomTownsend,

                      Thanks for your post.

                      Great questions.

                      Playback with market replay data will present relatively the same performance as you would see with real-time data. While the Heiken-Ashi still presents false information, the order fills will be on the actual price data which is what you would want.

                      When using the strategy performance, after you have run market replay data, then only select "Real-time" as these would be the trades made by the strategy while running on replay data and would be filled on real data. Looking at Historical (or Historical and Real-time) would present misleading results because the historical would be trades filled on the false data (because the bar is not being built tick by tick as it is while playback is running (and this is considered "real time).

                      Paul H.NinjaTrader Customer Service

                      Comment


                        #26
                        Thank you for that detailed answer. That helps a lot!

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by PaulMohn, Today, 12:36 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post PaulMohn  
                        Started by love2code2trade, 04-17-2024, 01:45 PM
                        4 responses
                        38 views
                        0 likes
                        Last Post love2code2trade  
                        Started by alifarahani, Today, 09:40 AM
                        2 responses
                        14 views
                        0 likes
                        Last Post alifarahani  
                        Started by junkone, Today, 11:37 AM
                        3 responses
                        20 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by frankthearm, Yesterday, 09:08 AM
                        12 responses
                        44 views
                        0 likes
                        Last Post NinjaTrader_Clayton  
                        Working...
                        X