Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Periodtype.Renko

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

    Periodtype.Renko

    I am experimenting with multi-time frame code ...which works for tick, range, minute, but not for Renko. Below I have listed a very simple piece of code that works with (PeriodType.Range,4) .....but will not work with (PeriodType.Renko,4).

    private int cntr = 0;

    protected override void Initialize()
    {
    CalculateOnBarClose = true;
    Add(PeriodType.Range, 4); // BarsInProgress index = 1
    }

    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 1 )
    {
    if (CurrentBar < 1) return;
    cntr ++;
    }
    //--------------------------------
    if (BarsInProgress == 0)
    {
    if (CurrentBar < 1 ) return;
    DrawText("cntr"+CurrentBar, cntr.ToString(),0,High[0],Color.Black);
    }
    }

    I have no idea why this works with everything except Renko...

    Thanks...........

    #2
    Hello,

    Thanks for the forum post.

    The reason this occurs is that you need to use AddRenko() instead for these special bar type.



    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Great!!

      Thanks so much for the fast reply....(and on a weekend no less!!!)

      Ninja support never sleeps

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      155 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      90 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      137 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      130 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X