Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MACD in MultiTime Strategy

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

    MACD in MultiTime Strategy

    Hi, I'm using NT 6.5.
    I'm having problems with the MACD indicator in a multi-time strategy.
    Code:
     protected override void Initialize()
            {
                ClearOutputWindow();
                Add(PeriodType.Week,1);
                Add(PeriodType.Day,1);
                CalculateOnBarClose = true;
            }
    The problem is when i use the values of the MACD in the strategy, the calculated values are different from the ones that i can see on a simple charts. For example, I use:
    MACD(BarsArray[1],MACDCorto, MACDLargo, MACDSmooth).Diff[0]

    In the strategy, i get a value of 1,5454, but in a common chart, the value of the weekly MACD.Diff for the same instrument is 3,8.

    Please, any ideas of what is wrong will be very apprecieted.
    Regards,
    Federico

    #2
    Welcome to our forums - how do you start the strategy up, from the chart as well? If you would start it from the strategies tab for example the used historical data (Chart defaults Tools > Options > Data) might be different than what you load directly as you create the chart, thus the values could be different.

    Please also ensure to compare the same CalculateOnBarClose settings to eachother (strategy vs chart).

    Comment


      #3
      Thanks for the quick answer.
      I'm comparing the results of executing a Backtest from Strategy Analyzer against a chart created with End of Day Data from Yahoo.
      I try to check how is the CalculateOnBarClose property configured for the chart, but i couldn't find it. But, i understand that it is not a diference using historical data in both case.
      Do you have any other idea in order to detect the difference?

      Regards,
      Federico

      Comment


        #4
        Hello fscheu,

        When using NinjaTrader 6.5, the secondary series must be smaller than the primary. Since 1 week is your secondary series, you must then use a larger time frame series, such as 2 week for the primary series.

        Version 7 does not have this limitation. In my initial tests I was able to get these values to align as long as the same number of days were loaded for each.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Really? What kind of problem you mean?
          I have used multi time frame strategy with secondary series larger than primary series. I have not seen any problem in my live trading. I am using NT6.5.

          Comment


            #6
            Originally posted by millridge View Post
            Really? What kind of problem you mean?
            I have used multi time frame strategy with secondary series larger than primary series. I have not seen any problem in my live trading. I am using NT6.5.
            In realtime / market replay you should be fine using this layering.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X