Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Condition to calculate the indicator

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

    Condition to calculate the indicator

    Is it possible to start to calculate the indicator from the first bar of the trading session ? For example : The trading hours being at 9:30 am. If I calculate the indicator based on 30 minutes chart, the indicator should be started to calculate after the first 30 minutes bar, in this case (9:30am to 10:00 am).
    Thanks for your help and time.

    #2
    Hi Winnie, thanks for your post! Yes, you could for example use Bars.BarsSinceSession for this, it will give you the bars since the session has started, so you can contol then on which bar to start your custom calculations - http://www.ninjatrader-support.com/H...ceSession.html

    Comment


      #3
      Thanks for your help. I try write the following code to paint the first bar of the session in 30 minutes bar :
      if ( Bars.BarsSinceSession == 5 )
      BarColor = Color.Blue;
      Does the above code correct ?

      Comment


        #4
        Sorry , I have solved the problem now. Thanks

        Comment


          #5
          Great, thanks for reporting back.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          69 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          312 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          306 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          146 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          105 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X