Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Time Series

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

    Using Time Series

    I have a strategy where I can check that I am within certain times of the day using the OPEN CurrentDayOHCL indicator for direction.

    Is there an easy way to do something similar for the Weekly Open or Close. I have tried using the Strat builder to draw a line at the weekly close but it produces nothing, I assume I have to add to the Strategy via code?

    Thanks

    Alan

    #2
    Hello saintalan,

    Thank you for your post.

    You would need to add a second data series which is using the Weekly time frame. Once you have the weekly time frame added to your script. you will be able to reference the Open or Close of a particular bar.

    Unfortunately, multi-series strategies cannot be created through the Strategy Wizard. You would need to work within the code in order to accomplish this.

    Please review our Help Guide article on Multi-Time Frame & Instruments with NinjaScript:



    Please let me know if there is anything else I can do for you.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Matthew, I have used MTF in a strategy no problem but I was rather hoping there was the weekly equivalent of the CurrentDayOHL, as I have yet to master the drawing tools to create it myself ;-))

      Cheers

      Alan

      Comment


        #4
        Alan,

        I see - well the CurrentDayOHL will not work in a weekly context, but you could always just call the opening value of the current weekly bar, or the closing value of the bar 1 ago on the weekly time frame.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Thanks again, yes I am able to access it for comparison but I wuold like a visual line for the week;-))

          Comment


            #6
            Alan,

            Assuming you have already added the Weekly data series to your chart:

            Code:
            protected override void Initialize()
                    {
                        Add(PeriodType.Week, 1);
                    }
            You can then easily add a horizontal line here using a simple DrawHorizontalLine signature in OnBarUpdate()

            Code:
            DrawHorizontalLine("test", [B]Closes[1][1][/B], Color.Blue);
            Closes is going to indicate that you are references the multi-series. The first index value [1] will call refernece the first data series you added to via the Add() method in Initialize, and the second index value [1] will look for the close value 1 bar ago.
            Last edited by NinjaTrader_Matthew; 07-27-2011, 01:54 PM.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Thanks Matthew will check it out tomorrow.

              Cheers

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              639 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
              572 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X