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

Indicator value for current bar

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

    Indicator value for current bar

    This question may ahve already been asked, but... how do I display a value of indicator for a current bar (bar that has not closed yet)?

    I use Overlay=true, CaluculateOnBarClose=false, and assign value to indicator as follows

    OnBarUpdate() {
    Value.Set(Close[0]+delta);
    }

    but it doesn't show value for current bar...

    #2
    How are you determining it is not the current value? If you have CalculateOnBarClose = false then it is the current value as determined by the latest OnBarUpdate(). This update is triggered by the latest tick and as such your values will be the latest.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I see that on the chart (remember it's an overlay) there is no value of indicator matching the current bar; the most recent value shows up 1 bar ago and it is static.

      Comment


        #4
        Please check your indicator selection window then. You may have it still set to true. A code change for CalculateOnBarClose is not applied simply by refreshing the indicator. You need to remove/readd it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I think the reason is in that I've added plotted overlay lines by hand, after dummy code was generated by NT wizard. I will try it after the holidays; thank you for the attention

          Update: this indeed was the cause, now it works as it should - thanks for your attention
          Last edited by billitin; 01-19-2009, 03:32 PM. Reason: issue resolved

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by giulyko00, Yesterday, 12:03 PM
          3 responses
          12 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by habeebft, Today, 07:27 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_ChristopherS  
          Started by AveryFlynn, Today, 04:57 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by Max238, Today, 01:28 AM
          4 responses
          39 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by r68cervera, Today, 05:29 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X