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

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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X