Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator DataSeries Not seen in Strategy

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

    Indicator DataSeries Not seen in Strategy

    I have a Indicator that I added a Dataseries to mark when the indicator arrow went up or down. Then I would look at the status of arrow in my strategy.
    I have print statements in the indicator that show the code gets to the dataseries and works as expected, but on strategy side all I see is 0's from the dataseries in the indicator.. I should see a 1 with arrow up and arrow down = -1 and 0 = no arrow.
    I can show code if you need??
    Indicator snippet:

    #2
    bbucha_stk,

    Could you please post your code so we can take a look?

    I look forward to helping you resolve your issue.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Note The indicator txt file look at around lines 140
      ShowArrows=true; //added bb
      if(ShowArrows)
      {
      if(currentUpTrend && !priorUpTrend)
      {
      DrawArrowUp(
      "arrow" + CurrentBar, true, 0, newStop - 0.5*offset, upColor);
      myArrowSeries.Set(
      1);
      Print(Time[
      0] + "Arrow Indicator....ArrowUP" ) ;


      The Strategy around Line 160
      if (anaSuperTrend(1,4,14).MyArrowSeries[0] > 0 )
      {
      Print(Time[
      0] + "Arrow Strategy....ArrowUP" ) ;
      ArrowDirection =
      1;
      Attached Files

      Comment


        #4
        Hi bbucha_stk,

        Thanks for attaching those files. The code looks good for what you're looking to do. Did you make sure to match up the parameter set between the indicator applied to the chart, and the one you reference in your strategy code? That's the only thing I could think of before simplifying and stripping everything unrelated out.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Did you try running the code? Everything looks good like I said the indicator prints in output window values but the strategy doesnt see the value??
          Try running it with an output window.

          Comment


            #6
            Yes, unfortunately we do not have the resources to provide full code debugging for you. I have taken out the sections you posted about, and included them in the attached simplified strategy and indicator. The strategy prints as expected. You will need to simplify and work through your code until it works the way you expect, and then add additional complexity only after verifying each previous layer works.

            If you are looking for professional support to help through this, please consider one of our 3rd party NinjaScript consultants.
            Attached Files
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Do you guarantee that for a given strategy the onbarupdate will be called for each indicator before the onbarupdate for the strategy is called?

              Comment


                #8
                Yes, if I understand correctly your question. See below from:


                We suggest using any available class that implements the IDataSeries interface. These include the following:
                BoolSeries Class
                DataSeries Class
                DateTimeSeries Class
                FloatSeries Class
                IntSeries Class
                StringSeries Class

                These classes hold internal logic that ensure that the OnBarUpdate() method of the indicator is processed prior to accessing the current bar’s value. This guarantees you will receive up-to-date values when retrieving the calculations.
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X