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 poplagelu, Today, 05:00 AM
          0 responses
          3 views
          0 likes
          Last Post poplagelu  
          Started by fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,407 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          98 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          160 views
          0 likes
          Last Post loganjarosz123  
          Working...
          X