Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator from diferent time frame

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

    Indicator from diferent time frame

    Hi,

    How can I visualize an indicator calculated from a 4 h chart in the 1 minute chart.

    For example, see in the 1 minute chart an SMA(Close,20) calculated form 1 hour bars.

    Thanks in advance

    #2
    Hello CJS,

    You can base indicators from another series without custom coding. Apply both data series to your chart. When you add an indicator you can select which series it uses for its calculations as well as its panel.


    See below for custom coding solution:

    Please see the sample for this by clicking Tools > Edit NinjaScript > Strategy > SampleMultiTimeFrame.

    Documentation is available here:


    You will add a secondary series in Initialize. It's then accessed with Closes[1], that you can plug into SMA.

    Code:
     
    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    Add(PeriodType.Minute, 60);
    }
    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    Plot0.Set(SMA(Closes[1], 14)[0]);
    }
    Last edited by NinjaTrader_RyanM1; 09-01-2010, 09:30 AM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I thought that in this Version 7, it was posible to add an indicator (for example (Bollinger bands) from one time frame in another time frame, just by setting the parameters in the dialog window when adding an indicator to a chart.

      This from What's new Section

      Charting Enhancements
      New Multi-Series Charting


      Accurately mix multiple data series on the same chart

      Data series can be any mix of instruments or interval types

      New "Format Data Series" dialog window to support multiple series

      Each data series can be parameterized independently allowing for full visual customization

      Comment


        #4
        Sorry,

        I did not read your first post completely.

        It all clear now,

        Thanks again!

        Comment


          #5
          Thanks, CJS. I had edited my first response - realizing you weren't looking to do this through code. Glad it's all clear now.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Hi,

            Just one last very quik question,

            Can I apply both Data Series but visualize just one time frame. I mean, having an 4H SMA right in the 1 hour chart (without custom coding).

            Otherwise, I have to have both charts together.

            Thanks again!!

            Comment


              #7
              Yes, this is possible. To add an indicator to a secondary series, this series must be applied to a chart.

              However, you can change the visual appearance so you don't see the second chart. Setting as line on close, with color transparent should hide it. You should also apply it to the same panel as the first.
              Last edited by NinjaTrader_RyanM1; 09-01-2010, 10:45 AM.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                All Right!!

                Thanks a lot

                Comment


                  #9
                  Mtf q

                  Will this work with range bar MTF chart?...With 4 range and 8 range Es...? I tried and it disturbed the pbosition of the primary chart candles...

                  Comment


                    #10
                    pgabriel, this would be expected on a MultiSeries chart as the axis would then not be using equidistant spacing and the bars would be plotted at whatever their timestamp is - if you run a single series chart they would be all evenly spaced which is not feasible in a MultiSeries environment.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by MSerag, Yesterday, 11:52 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post MSerag
                    by MSerag
                     
                    Started by DynamicTest, Yesterday, 11:18 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post DynamicTest  
                    Started by dcriador, Yesterday, 01:43 AM
                    3 responses
                    20 views
                    0 likes
                    Last Post dcriador  
                    Started by smartromain, Yesterday, 10:50 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post smartromain  
                    Started by popecapllc, 08-09-2023, 07:42 PM
                    10 responses
                    1,366 views
                    0 likes
                    Last Post BartMan
                    by BartMan
                     
                    Working...
                    X