Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect MACD values in strategy based on Heiken Ashi Candle

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

    Incorrect MACD values in strategy based on Heiken Ashi Candle

    I am developing a strategy based on Heiken Ashi candles. I put in the the bar type as Heiken Ashi in the backtester settings and print the value of MACD and MACD.Diff, i get incorrect results. I run the strategy on bar closes, so i expect the MACD(12,26,9).Diff[0] to have the value from the last closed bar that i see on the chart.

    An important thing to note is that, i want the indicators to compute the values based on the Heiken Ashi bars and so i run the strategy for the bar type of heiken ashi in the backtester settings. I don't pass any data series to the MACD function.

    Am i missing something here?

    #2
    Hello aviksamanta,

    Thanks for your post and welcome to the forums!

    What are you comparing the printed MACD values to (the chart in the strategy analyzer)?

    Can you provide a screenshot that illustrates the observations that the MACD values are incorrect?

    Thank-you.

    Comment


      #3
      Thanks for the quick response.

      I am comparing the print messages in the strategy analyzer with that in the charts.

      I want to verify, that if i want the indicator methods to be computed based on heiken ashi candles (rather than the normal bar periods), do i need to supply any data series in the indicator methods, or just specifying the bar type as Heiken ashi in the strategy analyzer/live strategy with the period set will direct the indicator methods use the Heiken ashi candles to compute?

      I will get you some screenshots based on your response.

      Comment


        #4
        Hello aviksamanta,

        Thanks for your reply.

        If you are using chart bars of the Heiken-Ashi type, these would be the input to the indicator.

        If you would prefer as it may be easier, feel free to send in your screenshots in an e-mail to PlatformSupport[at]NinjaTrader[dot]Com. Mark the e-mail Atten:Paul and please include a link to this thread.

        Comment


          #5
          Thanks for your reply. After carefully checking my code lines, i found that i added a data series to my code which probably causing the issue. Once i removed it, it works just fine.

          I have 2 more questions, probably not related.
          1) Is it possible to backtest a strategy against a list of instruments or run it live against a list of instruments?

          2) Is it possible to have a 2 strategies running on 2 different connection?

          Comment


            #6
            Hello aviksamanta,

            Thanks for your reply, glad you were able to resolve.

            Yes, you can backtest the strategy on a list of your choosing.

            Yes, you can run the strategy live on a different instruments however, to be clear, you would have to assign/connect the strategy to the instrument when you add it to the strategy tab.

            Yes, the strategy is run connected/assigned to an account. you would have different accounts for the different connections.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            85 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            47 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            29 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            67 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X