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

High - last indicator

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

    High - last indicator

    Hi,

    I have been using a high - last indicator that seemed to be working all right, but this morning it is not. The indicator is ok in the chart, but I must have something goofy setup in the MA.

    Here is the gist of what I am using:

    Code:
    double HighMinusCurrent = CurrentDayOHL().CurrentHigh[0] - Input[0];
    Difference.Set(HighMinusCurrent);
    I was using daily data on the MA and looking back one day. It seemed to work fine all last week. This morning it is only 0.

    I am using NT 7 -B15.

    Thanks for any help.

    #2
    Actually - I just changed the data to a 5 minute set and looking back 78 bars. It is working now.

    But I am not sure I understand what is going on - what it is supposed to be set at, what difference a change makes, and - why didn't the daily work anymore?

    Thanks!

    Comment


      #3
      Hello,

      Not sure I understand whats going on here. Could you be chance take screeshots and upload them of the working chart and the chart that does work so that I may further assist. Also what version of NinjaTrader are you on, this is found in the Control Center->Help->About and is located to the right of the NinjaTrader logo.

      To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

      I look forward to assisting you further.

      Comment


        #4
        Hi Brett,

        As mentioned in the first post I am using NT7 B15.

        Things worked fine today after I change the interval from day to 5 minutes on the market analyzer (MA). It works now, but I would like to understand what the different intervals do - and how they can change the value of the presented indicator. I noticed that I had to set # of bars to look back to 78 (6.5 hours == 78.5 minute intervals; I took a guess at this, it had been 5 (from the days setting) and the value was definitely off.

        Thanks for the help!

        Comment


          #5
          Depends on the indicator, some indicators start calculating from the time they are started and use there previous values and in the case of these indicators the start point is important, as you need to have the same start point on your chart and MA for the values to line up. Also the bar type needs to be the same as the indicator is calculated with the bar data and as such with most indicator values will change depending on the bar interval used.

          Let me know if I can be of further assistance.

          Comment


            #6
            Thanks Brett.

            You will notice that the code above references CurrentDayOHL - which I think is what is confusing me. I am using minutes on the chart and MA.

            So I assume that anything less than 78 in the # of bars to look back for a 5 minute data series (in the MA settings) would not work for this? And 156 will give me the high from the prior two days?

            Thanks for indulging me =)

            Comment


              #7
              It will only return the high of the current session. You will need enough bars back for the session to count the first bar of the session in the case the the first bar of the session was the high for the day. NinjaTrader uses the session manager and you will find the session template for the MA is set by right clicking on the chart and selecting properties and then changing the session for session template. By Default it uses the setting the is specific for the instrument which is already setup for you in the instrument manager for most instruments.

              The current session is the current day.

              Let me know if I can be of further assistance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              3 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X