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 jonfan45, Today, 06:06 PM
        0 responses
        6 views
        0 likes
        Last Post jonfan45  
        Started by rustyspring, Today, 05:15 PM
        0 responses
        8 views
        0 likes
        Last Post rustyspring  
        Started by xulu13, Today, 05:01 PM
        0 responses
        12 views
        0 likes
        Last Post xulu13
        by xulu13
         
        Started by Pbarrionuevo, Today, 04:30 PM
        0 responses
        9 views
        0 likes
        Last Post Pbarrionuevo  
        Started by vantojo, Today, 01:39 PM
        0 responses
        20 views
        0 likes
        Last Post vantojo
        by vantojo
         
        Working...
        X