Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

5minute count down

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

    5minute count down

    Hey guys, I'm curious if I want to make an indicator that draws an arrow every 5 min, using Times[1][0] and Add (Period.Minute, 5); How would I write that? I just don't get it. Is there a way to write a Timer Code that can just do Something every "x" minutes"?

    #2
    Hello ginx10k,

    Thank you for your inquiry.

    If you would like to have your script draw an arrow at the bar close of a five minute secondary DataSeries, assuming CalculateOnBarClose is set to true, you can do this:

    Code:
    protected override void OnBarUpdate()
    {
         if (BarsInProgress == 1) // draw an arrow if the secondary DataSeries called OnBarUpdate (this is assuming that the five minute bar is at BarsArray[1])
              DrawArrowUp(....);
    }
    I would suggest taking a look at this section of the NinjaTrader help guide for further information about working with multiple time frames: http://ninjatrader.com/support/helpG...nstruments.htm

    If you would like to draw an arrow based on a timer instead, I would suggest taking a look at the included BarTimer indicator as this indicator does utilize a timer.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      well, are u tryin to do something every 5 minutes based on your custom startinpoint? or are fine with doin something everytime the 5 min candle closes? bc those are two diffrent things?

      Comment


        #4
        We'll in trying to do something every 5 min of every hour. Not from a starting point. So hopefully using the bar close will do what I need. Thank you both. I'll post back if it doesn't work.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by benmarkal, Yesterday, 12:52 PM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by helpwanted, Today, 03:06 AM
        1 response
        19 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        11 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        244 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        388 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X