Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question about Net Change indicator - Calculated values does not seem correct?

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

    Question about Net Change indicator - Calculated values does not seem correct?

    Hi,

    I was very happy to discover the Net Change indicator today, but I was puzzled when the calculation didn't seem to add up.

    To be clear:

    Net change = (Last Price -. Close Prior Session) / Close Prior Session

    Right?

    I could have supplied the arithmetic, but as can be seen, I have measured a 51,00 point move from the prior close to the last traded price.

    Yet, the indicator says 55,00 point difference.

    And 2,00 % change. Calculated from the prior Close, it should be a 1,85 % change, I think.

    Either I'm doing something wrong or have understood the metric OR the indicator is using a different settlement/close price than what's on the chart.

    Any advice?

    Thanks.

    Johnny
    Last edited by Johnny; 10-16-2018, 12:31 PM.

    #2
    Hello Johnny,

    Thank you for the post.

    The code for the NetChangeDisplay indicator is available to view through a NinjaScript editor.

    Here are the calculations that are made:

    Percent:
    Value = (Current Price - LastClose) / LastClose
    Pips:
    Value = ((Current Price - LastClose) / TickSize) * 1 (* 0.1 if Forex)
    Ticks:
    Value = (Current Price - LastClose) / TickSize;
    Currency:
    Value = (Current Price - LastClose) * PointValue * rate * 1 (* by DefaultLotSize if Forex)
    Points:
    Value = (Current Price - LastClose)

    Edit:
    To clear the formatting, one would need to modify the code to either change the formatting method or you can get rid of the formatting altogether by replacing FormatValue(currentValue), to just currentValue on line 126. You can make a copy of the script by right-clicking the NetChangeDisplay indicators code and clicking "Save as" in the NinjaScript editor. This will allow you to make changes to it.

    Please let me know if I can assist further.
    Last edited by NinjaTrader_ChrisL; 10-16-2018, 01:19 PM.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Chris,

      Great.

      However, it does not seem clear to me what the LastClose value is?

      I use the US Equities RTH sessions ranging from 09:30-16:00 NY Time.

      The last bar on my prior day is at 16:00 and on the chart above that is 2753,00.

      According to the formula then:

      Points:
      Value = (2804 - 2753) = 51 points.

      Yet the indicator prints 55 points as can be seen on the picture above.

      The only explanation I can see is that the indicator use a different Last Close than what I have on my charts.

      Thanks for helping.

      Johnny

      Comment


        #4
        Hello Johnny,

        Thank you for the reply.

        I tested out the indicator by printing out this property:

        marketDataUpdate.Instrument.MarketData.LastClose.P rice

        That property is different for my chart as well, so I will ask my supervisor what is happening with this value.

        Thanks in advance for your patience.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello Johnny,

          Thanks for your patience.

          This value is expected because the property grabs a daily bar's close from your data provider. That value is the adjusted settlement, if you compared the close to a daily chart it will match.

          Please let me know if we can assist further.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChrisL View Post
            Hello Johnny,

            Thanks for your patience.

            This value is expected because the property grabs a daily bar's close from your data provider. That value is the adjusted settlement, if you compared the close to a daily chart it will match.

            Please let me know if we can assist further.
            Chris,

            Thank you. Sadly, that's what I suspected.

            To me, it doesn't make sense that this indicator should use a different close than the prior close I have on my current chart to which the indicator is applied.

            Is there a way to fix this? If anything, it should be possible to adjust this as an option, IMO.

            If not, I fear this indicator won't be useful for me after all.

            Best regards,

            Johnny

            Comment


              #7
              Hello Johnny,

              Thanks for the reply.

              You could modify the code of a NetChnageDisplay copy to use PriorDayOHLC values instead of the OnMarketData values.

              Please let me know if I can assist further.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                ChrisL,

                Great. Thanks!

                Sadly, I don't think I'd be able to implement that on my own. Any further pointers?

                Johnny

                Comment


                  #9
                  Hello Johnny,

                  Thank you for the reply.

                  I will submit a feature request to have an option to use a daily bar or to get the close price by some other means. Also, if you send an email to [email protected] and paste the link to this forum thread in the body of the email then I will forward your inquiry to our sales support team who can provide a list of third-party consultants/developers for NinjaScript who can implement this for you.

                  Please let me know if I can assist further.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    ChrisL,

                    Thank you! That would be great.

                    Johnny

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by CortexZenUSA, Today, 12:53 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post CortexZenUSA  
                    Started by CortexZenUSA, Today, 12:46 AM
                    0 responses
                    0 views
                    0 likes
                    Last Post CortexZenUSA  
                    Started by usazencortex, Today, 12:43 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post usazencortex  
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,262 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    10 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Working...
                    X