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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      333 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X