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 Kaledus, Today, 01:29 PM
        0 responses
        3 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by PaulMohn, Today, 12:36 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        36 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by rdtdale, Today, 01:02 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X