Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time reference for indicator

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

    Time reference for indicator

    I am trying to figure out the right code to find the highest and lowest values during a specific time period each day. Below is what I am trying to do. Any Ideas?

    Thanks

    MyHigh = 'Highest High between 9:30 and 10:30 am
    MyLow = 'Lowest Low between 9:30 and 10:30 am

    #2
    Here is one way that comes to me.

    - Calculate how many bars have elapsed (bars ago) since 9:30 was seen and 10:30 was seen using GetBar() - http://www.ninjatrader-support.com/H...V6/GetBar.html
    - Then for high you would write

    double myHigh = MAX(High, bars ago for 10:30 - bars ago for 9:30)[bars ago for 10:30];

    for low use MIN() instead of MAX()
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      could I set my indicator in the parameter section to have a Starttime and Endingtime for the Highest high and lowest low?

      or reference the script between that time only.

      The bar method won't work if I change my periodicity of the chart.

      thanks for comenting.

      Comment


        #4
        Either you have to equate the range in bars or you have to store high/low seen by checking for valid Time[0] with your range.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        256 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        166 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        170 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        253 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        203 views
        0 likes
        Last Post CarlTrading  
        Working...
        X