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 StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,964 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          4 views
          0 likes
          Last Post rbeckmann05  
          Started by rhyminkevin, Today, 04:58 PM
          4 responses
          52 views
          0 likes
          Last Post dp8282
          by dp8282
           
          Started by iceman2018, Today, 05:07 PM
          0 responses
          5 views
          0 likes
          Last Post iceman2018  
          Started by lightsun47, Today, 03:51 PM
          0 responses
          8 views
          0 likes
          Last Post lightsun47  
          Working...
          X