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 vantojo, Today, 09:32 AM
        0 responses
        4 views
        0 likes
        Last Post vantojo
        by vantojo
         
        Started by FelipeRXP, Today, 08:40 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by petedian, Today, 08:44 AM
        0 responses
        12 views
        0 likes
        Last Post petedian  
        Started by J0shTrader, Yesterday, 12:29 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by bc24fl, Today, 08:07 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X