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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      51 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      32 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      99 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      177 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      170 views
      0 likes
      Last Post CarlTrading  
      Working...
      X