Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stochastics not plotting - with Attachment to reproduce

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

    Stochastics not plotting - with Attachment to reproduce

    I've tried to create as minimal of a test scenario as I can.

    This works in NT6.5, but not in NT7 B12

    Not sure if I've missed one of the upgrade guidelines, have a system problem, or if this is a bug.


    Essentially, I've duped my exact scenario that I have in a full blown indicator, so I've got the exact functions (even if empty in the example), just to duplicate it as I'm using it.

    Essentially, in NT7, there is a straight line drawn on the bottom.

    In NT6.5, Stochastics are drawn.


    Could someone take a moment and identify if this is a coding error on my behalf, if I've stumbled onto something bigger, or doing something I'm not supposed too (like an unsupported feature of some kind)

    Thanks

    Matt
    Attached Files

    #2
    tazatek, are there any errors in the logs (right-most tab of Control Center)? By "straight line drawn on the bottom" do you mean that nothing is plotted or the plot never changes?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Nothing in the logs...

      By straight line, I mean a line with a pricemarker of 0 for the entire history of data...

      If you run the demo that I uploaded, and open up an output window, you'll see that the input values are good values, but when Stochastics() is called with those parameters, 0 is returned.

      I just had it happen to another one of my indicators that I'm working on too... it must be something I'm doing, but I can't seem to see it.

      Did you have a chance to run the indicator I uploaded? What should be a stochastic is just a horizontal line at price 0.

      Matt

      Comment


        #4
        I think that this is actually a dup of my other thread here. They presented differently so I initially opened them as two different issues.

        Comment


          #5
          tazatek,

          You cannot do this line:

          Indicator = Stochastics(slowPeriodD, slowPeriodK, slowSmooth);

          This is not supported.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            so what would be the right way to initialize such an IDataSeries with something that is going to hold an indicator series?

            Comment


              #7
              tazatek,

              Why can't you just call the indicator directly like how you are already doing in OnBarUpdate()?

              Otherwise I believe you can try something like this (Note that this is unsupported):
              private Stochastics someStoch;
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Josh View Post
                tazatek,

                Why can't you just call the indicator directly like how you are already doing in OnBarUpdate()?

                Otherwise I believe you can try something like this (Note that this is unsupported):

                private Stochastics someStoch;
                I'm passing a DataSeries (Indicator) around into several functions....of which the indicator isn't set at compile time, but at run time (via a dropdown).

                Things work fine in NT 6.5, but seems to be breaking in NT7

                The example is just a slimmed down version of something much more complex... so I can't just do what I'm doing.

                I don't think I'm doing anything too off the wall, but some suggestion of something that will work in NT 7 would be appreciated.

                Surely there's a supported way of doing this?

                Thanks

                Matt

                Comment


                  #9
                  Would something like this work/be supported?

                  IDataSeries Indicator
                  Indicator = new DataSeries(Stochastics(14,7,3));

                  Comment


                    #10
                    Unfortunately not.

                    What you could try is just create a generic DataSeries then use a switch to decide what values to set it to that DataSeries through .Set()
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Josh View Post
                      Unfortunately not.

                      What you could try is just create a generic DataSeries then use a switch to decide what values to set it to that DataSeries through .Set()
                      So for every barupdate() I'll need to take the result of the indicator, and Set() it into a generic dataseries?

                      That seems like a safe way to do it...

                      Do I use an IDataSeries, or just a DataSeries?

                      Thanks for your suggestion.

                      Matt

                      Comment


                        #12
                        Variables region
                        Code:
                        private DataSeries someSeries;
                        Initialize()
                        Code:
                        someSeries = new DataSeries(this);
                        OnBarUpdate() in some switch
                        Code:
                        someSeries.Set(Stochastics(7, 14, 3)[0]);
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        591 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        342 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        103 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        555 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        552 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X