Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Flow + Strategy Builder?

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

    #76
    I am using a simplified version of the cumulative order flow indicator I found in this forum to build a simple strategy. It's based on cumulative delta (UPDOWNTICK/BAR) which the indicator is set up for. I added the extra data series, and the strategy plots the signals only on historical data, but never on data moving forward. If I refresh the Ninjascript, signals will show up in the past, but never generates a signal in real time. I am obviously missing something. Can someone point me in the right direction? Below is the code from the Ninjascript editor.

    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }
    else if (State == State.DataLoaded)
    {
    CumDelta1 = CumDelta(Close);
    EMA1 = EMA(CumDelta1, Convert.ToInt32(TFP));
    EMA2 = EMA(Close, Convert.ToInt32(FTP));
    EMA3 = EMA(Close, Convert.ToInt32(STP));
    }
    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;

    if (CurrentBars[0] < 1)
    return;

    // Set 1
    if ((Close[1] < Open[1])
    && (CumDelta1[0] > VFLT)
    && (EMA1[0] > TFLT)
    && (EMA2[0] > EMA3[0]))
    {
    Draw.ArrowUp(this, @"MyCustomStrategy Arrow up_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] + 20) , Brushes.DodgerBlue);
    BarBrush = Brushes.DeepPink;
    }

    // Set 2
    if ((Close[1] > Open[1])
    && (CumDelta1[0] < VFST)
    && (EMA1[0] < TFST)
    && (EMA2[0] < EMA3[0]))
    {
    Draw.ArrowDown(this, @"VTES001 Arrow down_1 " + Convert.ToString(CurrentBars[0]), false, 0, (Close[0] - 20) , Brushes.Red);
    BarBrush = Brushes.DeepPink;
    }


    Comment


      #77
      Hello BullyWig Trader,

      It might be that the indicator you are calling is not returning a value you are expecting.

      Add debugging prints (using the strategy builder) to find out why no arrows are being drawn.

      Print the time of the bar, and print all the values you are using in the condition.

      Below is a link to a forum post that includes a video on how to add prints using the Strategy Builder.


      Save the output from the output window (right-click the output window, select Save As), and attach the output text file to your next post.

      I will be happy to assist with analyzing the output.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #78
        Add my vote to SFT-4377

        Comment


          #79
          Hello ZEROSYSTEM,

          Thank you for your vote.

          I've added this to SFT-4377.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          77 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          27 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          62 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X