• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ISSUE : NT8 reference indicator - SpreadOscillator

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

    ISSUE : NT8 reference indicator - SpreadOscillator

    NT Team,

    A small modification to the NT reference indicator SpreadOscilliator uncovers an issue.

    Please find attached the modified script. The change converts the SpreadOscillator to just Spread (i.e. series two minus series one). This change does not present any issue.

    The issue presents in the SMA (the issue could be in SMA script which downloads with the SpreadOscillator indicator). As the SMA period is reduced (e.g. period = 5) the issue is more apparent. The issue can be seen in the attached screenshot. The SMA plot (orange) is consistently below the Spread (grey) and by a significant margin. It is as though the calculation the SMA is dividing by (period -1) (i.e. one fewer than expected).

    Regards
    Shannon
    Attached Files

    #2
    Hello Shansen,

    Thanks for your post.

    So I can replicate, how many days of 30 minute bars are loaded?

    Is the chart session hours based on the ^SP500?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Paul,

      Thanks for you quick reply.

      1850 bars are loaded. Well in excess of the SMA period of 5.

      Shannon

      Comment


        #4
        Hello Shansen,

        Thanks for your reply.

        To replicate I need all of the facts, thank-you for the number of bars.

        What is the session hours template in use on the chart?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          US Equities RTH

          Comment


            #6
            Hello Shansen,

            Thanks for your reply.

            I have been able to recreate your chart set-up (note that mine is MST zone). I created a seperately named indicator called mSpreadOscillator (attached) that has the changes you show in your supplied code.

            I do not get the same spread results that you do. Please download the indicator and advise if I have missed anything.
            Attached Files
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Paul,

              Thank you for the quick investigation. Your mSpreadOscillator script correctly replicates the modifidedSpreadOscillator script.

              However, the issue I am experiencing persists. Please find attached a screenshot showing both indicators.

              Shannon
              Attached Files

              Comment


                #8
                Hello Shansen,

                Thanks for your reply.

                Just to add further detail:

                Please advise what version of Ninjatrader 8 you running (Help>about) 8.0.0.x need the x

                Please advise your source of historical data and data feed.

                Thank-you.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Paul,

                  For interest sake, please find attached two screenshots:

                  - Your mSpreadOcilator (upper and lower bounds removed to improve readability)
                  - The spread (grey) and SMA (orange) are unchanged (and unchanged in the underlying script)
                  - The SMA (green) is added as another indicator with the input as mSpreadOcilator.Spread
                  - The Indicator Window showing the SMA on mSpreadOscillator.Spread.

                  This shows the SMA applied to the chart (green) works as expected.
                  The SMA applied within NinjaScript (orange) does not work as expected.
                  I believe the issue occurs when the series is passed to SMA within script.

                  Again, any help is greatly appreciated.
                  Shannon
                  Attached Files

                  Comment


                    #10
                    Paul,

                    I am running 8.0.0.8 64-bit (Standard) - BETA.
                    The historical data and data feed are both Interactive Brokers.

                    Thanks
                    Shannon

                    Comment


                      #11
                      Paul,

                      The issue lies in the Global Merge Policy.
                      My Global Merge Policy is set as "Merge non back adjusted"
                      My Merge Policy for ES is set as "Use global settings"

                      Looking at the history of the chart the SMA (orange and green) calculated correctly until the first contact expiry (~ 10 September 2015)

                      Shannon

                      Comment


                        #12
                        Hello Shansen,

                        Thanks for your reply.

                        I'm glad you found the difference.
                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Paul,

                          The cause of the issue appears to be isolated, yes. However, unless I am missing something, the solution will require development from NT. In its current form, I believe this issue is a bug.

                          Please submit the issue for resolution and advise the tracking number.

                          Thanks again
                          Shannon

                          Comment


                            #14
                            Hello Shansen,

                            Thanks for your reply.

                            In what I have been looking at I do not see any issues with the SMA and have been unable to replicate your results. On your end I (mis?) understood that you found a difference in your settings that once corrected resolved the discrepancy you were attributing to the SMA.

                            So I am not sure what bug it is that you are asking me to write a bug report on.

                            Thanks for your patience and appreciate your efforts to help me understand.
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Paul,

                              Please find attached a longer-dated screenshot of the indicator.
                              As noted, my merge settings for this instrument (i.e. ES) is "merge non back adjusted".

                              You will see in the indicator before the first contract roll the SMA (orange) appropriately fits the Spread (grey). After the first roll, the SMA is "offset" from the Spread by a constant amount. After the second roll, the SMA is "offset from the Spread by a different constant amount.

                              It is my understanding the SMA is based upon the values of each Spread datapoint. While at rollover, yes the spread will jump (as seen), the SMA of subsequent Spread datapoints should not become "offset".

                              Thanks again
                              Shannon
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pstrusi, Today, 09:06 AM
                              0 responses
                              8 views
                              0 likes
                              Last Post pstrusi
                              by pstrusi
                               
                              Started by vpzdcv, Today, 02:31 AM
                              0 responses
                              11 views
                              0 likes
                              Last Post vpzdcv
                              by vpzdcv
                               
                              Started by YevhenShynkarenko, Today, 01:22 AM
                              1 response
                              20 views
                              0 likes
                              Last Post YevhenShynkarenko  
                              Started by ttodua, Today, 12:52 AM
                              0 responses
                              8 views
                              0 likes
                              Last Post ttodua
                              by ttodua
                               
                              Started by ttodua, Today, 12:50 AM
                              0 responses
                              8 views
                              0 likes
                              Last Post ttodua
                              by ttodua
                               
                              Working...
                              X