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

Use Value of BarsArray[1]

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

    #16
    Hello turbofib,

    Thanks for your reply.

    Yes, you did, my mistake.

    Your code reference to High[1] would be correct in that calculate mode to obtain the previous day high, or the previous week high or the previous month high according to the chart bars. If the charts bars are not of that bar type then the High comes from the forming 1440 minute bar.
    Paul H.NinjaTrader Customer Service

    Comment


      #17
      another problem
      if i write in my code :

      Calculate = Calculate.OnPriceChange

      The Close[1] on daily chart is not correct....




      see code ..thanks
      Attached Files

      Comment


        #18
        Hello turbofib,

        Thanks for your reply.

        When you have an added data series please note that both the chart bars and the added data series will call the OnBarUpdate(). This is causing the references to shift and in one case Closed1 would be the Day close and in another case Closed1 would be the added data series close. If you add the 1440 minute bars to the chart (so you can see both day bars and the 1440 minute bars), the line will reflect the close price from the 1440 minute bars and not the day bars.

        To correct the issue, please add if (BarsInProgress != 0) return; after the line closed1 = Closes[1][0]; and before the line Values[0][0] = closed1;


        As a point of clarification, Day bars close value is adjusted to show the settlement price of the instrument, so the day bar close price will not usually be the same as the last close price of the 1440 minute bars. Reference: http://www.eurexchange.com/exchange-...-Futures/17206
        Paul H.NinjaTrader Customer Service

        Comment


          #19
          to complete information an example
          i 've a strategy that call this indicator (HighDailyIntraDay)

          If this indidicator is with Calculate = Calculate.OnPriceChange

          the strategy (that call this indicator ) can to be set with Calculate=OnPriceClose?

          Comment


            #20
            Hello turbofib,

            Thanks for your reply.

            When a script calls another script, the calling script's calculate mode will be used.

            In your case, the strategies calculate mode will be used in the indicator. As the indicator needs Calculate.OnPriceChange then the strategy should be run in that mode.
            Paul H.NinjaTrader Customer Service

            Comment


              #21
              i see other problem..

              in my indicator
              HighDailyIntraDay.cs

              the value of High (or similar Open Close Low) change in the last candle and not in the first new session
              It is a problem for my indicator (I want to assign the correct value to the variable up to end session)
              Attached Files

              Comment


                #22
                Hello turbofib,

                Thanks for your post.

                When looking historically the values would be shifted back to same as if Calculate.OnbarClose were used. Note that when connected to live data that the values change.

                Please write into [email protected] Mark the e-mail Atten:Paul and please add a link to this thread in the email. I may have an alternative for you to test/use.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GwFutures1988, Today, 02:48 PM
                0 responses
                1 view
                0 likes
                Last Post GwFutures1988  
                Started by mmenigma, Today, 02:22 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by frankthearm, Today, 09:08 AM
                9 responses
                35 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by NRITV, Today, 01:15 PM
                2 responses
                9 views
                0 likes
                Last Post NRITV
                by NRITV
                 
                Started by maybeimnotrader, Yesterday, 05:46 PM
                5 responses
                28 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X