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 jclose, Today, 09:37 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post jclose
                              by jclose
                               
                              Started by WeyldFalcon, 08-07-2020, 06:13 AM
                              10 responses
                              1,414 views
                              0 likes
                              Last Post Traderontheroad  
                              Started by firefoxforum12, Today, 08:53 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post firefoxforum12  
                              Started by stafe, Today, 08:34 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post stafe
                              by stafe
                               
                              Started by sastrades, 01-31-2024, 10:19 PM
                              11 responses
                              169 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X