Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with Multi time frames

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

    Problems with Multi time frames

    The basic problem is that I cannot get an indicator to plot the same on 'Strategy Analyzer' as it does on basic Ninja charts.
    The indicator in question is a simple one...EMA(20)..... that plots "barsinprogress" and draws a 5 min EMA on a 1 min chart...
    (see attached 1min chart grab NinjaChart ....)

    It works very well on Ninja charts and plots a line on the 1 min that is almost exactly tick for tick the same as the EMA(20) plotted on a 5min chart.

    However...when I add this same indicator to a Strategy, it plots "weird".
    (see attached 1min Strategy chart grab Ninja Strat)
    The short 'pink lines' on the Strategy chart were drawn by me to show where the same indicator plotted values on a standard 1 min Ninja chart.....but the plotted values on the Strategy Analyzer 1 min chart are way off.

    - Both use the same instrument and the same Default 24/7 session
    - Both use 1 min....
    - Both use the same Instrument and day range.
    - Price action matches EXACTLY between both charts.

    I can't figure out what is going wrong....it almost looks like the Strategy Analyzer shuts off calculations from 14:00 until 7:20in the morning... (see chart grab zNinjaStrat2)
    but the Strategy is using Default 24/7....

    Strategy Code is basic.... {
    #region Variables
    private int myInput0 = 1; // Default setting for MyInput0
    #endregion

    //**********************************************
    protected override void Initialize()
    {
    Add(xcEMA15(20));
    CalculateOnBarClose = true;
    }


    //*****************************************
    protected override void OnBarUpdate()
    {
    // do nothing....
    myInput0 = 2;
    }

    #region Properties
    [Description("")]
    [GridCategory("Parameters")]
    public int MyInput0
    {
    get { return myInput0; }
    set { myInput0 = Math.Max(1, value); }
    }
    #endregion
    }
    Attached Files

    #2
    Hi photog53,

    It's working OK here. Attached is the indicator and strategy I'm using for this. If you can post the indicator script you're using I'm happy to take a look.
    Attached Files
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply!!

      Let me take a look at the code you sent......

      Comment


        #4
        Ok.... we are making progress.

        Your indicator code works the same as mine...so the indicator code is not the issue.

        The problem occurs when I try to use "Default 24/7" instead of "Instrument Settings".
        When I switch "Session Template" to Default 24/7....both indicators have long "flat spots" between 14:00
        and 07:30. Price action keeps creating bars, but both indicators 'freeze' at the value they had at 14:00 hours.

        Thanks!!!

        P.S. I get the same "flat spots" when I use the MultiSeriesAdding strategy...imported exactly as you sent it. My problem is something other than indicator code.
        Attached Files
        Last edited by photog53; 03-09-2011, 05:02 PM.

        Comment


          #5
          It sounds like there may be difference in session template used.

          These lines can help you track down the session template used for all series. Add the BIP0 and BIP1 lines to the indicator, and the BIP0 line to your strategy.

          Print (this + "BIP0 " + BarsArray[0].Session.TemplateName);
          Print (this + "BIP1 " + BarsArray[1].Session.TemplateName);
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Got it....(thanks)

            Comment


              #7
              You nailed it....
              EMA5Min(6E 03-11 (1 Min),20)BIP0 ind Default 24/7
              EMA5Min(6E 03-11 (1 Min),20)BIP1 ind CME FX Futures RTH

              So how do I get the strategy to use just one (the desired one) Session for everything?

              (I say 'strategy' only because the indicator works perfectly on regular charts...
              but perhaps there is extra code needed in the indicator itself)

              Thanks!!!
              Last edited by photog53; 03-09-2011, 09:52 PM.

              Comment


                #8
                How should I go about 'syncing' the session templates?
                The answer might be simple, but I'm not finding it...

                (also...if you have spare time, could you explain why the regular chart doesn't have
                this issue but the Strategy Analyzer does....just so I'll know for future reference)

                Thanks again for the help....

                Comment


                  #9
                  It's getting the session template from the Instrument Manager. You can change for 6E to use Default 24 / 7. The difference between the strategy analyzer and applying it directly to a chart is that the strategy does not add the series directly. The strategy is hosting the multiseries indicator. These are the following scenarios:
                  • Primary series in a hosted multi-series indicator takes session template from host (chart).
                  • Secondary series in a hosted multi-series indicator takes session template from instrument settings.
                  • Primary series of a non-hosted multi-series indicator takes session template from chart
                  • Secondary series of a non-hosted multi-series indicator takes session template from chart
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Thanks!!

                    (let me go in and see how this works....)

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    637 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    366 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    107 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    569 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    571 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X