Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ninZaRenko Multi Data Series Streategy

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

    ninZaRenko Multi Data Series Streategy

    I’m trying to create a renko type multi data series strategy using 2 different brick sizes; primary 8 and secondary 20. I can't seem to figure out why it won’t enter the market.


    else if (State == State.Configure)
    {
    AddDataSeries(new BarsPeriod()
    { BarsPeriodType = (BarsPeriodType)12345, // ninZaRenko’s ID
    Value = 20, // Brick Size
    Value2 = 5 // Trend Threshold
    });

    }

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


    if(State != State.Realtime ) return ;

    if ((Close[0] > Open[0])
    && (Closes[1][1] > Opens[1][1])
    && (Position.MarketPosition == MarketPosition.Flat))

    {
    EnterLong(Convert.ToInt32(Entry1_Lots), @"LongEntry1");
    }
    }

    #2
    Hello TraderCornel,

    Thank you for your note.

    You have the following at the beginning of OnBarUpdate:

    if (BarsInProgress == 0
    || BarsInProgress == 1)
    return;

    This will return out of OBU whenever either data series iterates through it so no other code would be processed. You can change this to the following so it will run your logic when the primary series updates:

    if (BarsInProgress == 1)
    return;

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post

      You have the following at the beginning of OnBarUpdate:

      if (BarsInProgress == 0
      || BarsInProgress == 1)
      return;
      That did not work, but I think Imay know why, but not sure.
      Am I correct in concluding that I need to include the code logic described at the following link?


      https://ninjatrader.com/support/help...8/?seriest.htm
      Last edited by TraderCornel; 07-13-2022, 01:19 PM.

      Comment


        #4
        Hello TraderCornel,

        Thank you for your reply.

        A Series<t> variable would be a custom series with a value that can be saved for each bar on the chart - that doesn't seem to be related to what you're trying to do here.

        I've created an example script based on your logic above that uses the built in Renko bar type and I've commented out the check for real time data so you can see that it has calculated historically. I'm seeing this work as I would expect. You can compare this to your logic to see what may be occurring with your script.

        Please let us know if we may be of further assistance to you.
        Attached Files

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X