Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cant simulate multitimeframe renko

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

    Cant simulate multitimeframe renko

    Hi,

    I think there is something wrong in my code. I have generated the strategy with wizard and changed AddDataSeries() to AddRenko(). I am trying to have two Renkos where QQE indicator watches the primary and TrendMagic indicator watches TmRenko that is set to 10000 with input variable called TmRenko. I checked with charts and both Renkos are generating multiple bars in the charts alone so it should not be the amount of bars.

    else if (State == State.Configure)
    {
    AddRenko("TMRenko", TmRenko, Data.MarketDataType.Last);
    }
    else if (State == State.DataLoaded)
    {
    amaQQE1 = amaQQE(Close, 14, 5, 14, 2.618, 4.236, 70, 30, amaQQETrendDefinition.Cross);
    AkunTrendMagic1 = AkunTrendMagic(Closes[1], 2, 200, 10);
    amaQQE1.Plots[0].Brush = Brushes.Blue;
    amaQQE1.Plots[1].Brush = Brushes.Red;
    amaQQE1.Plots[2].Brush = Brushes.DarkGoldenrod;
    AddChartIndicator(amaQQE1);
    }
    }

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

    if (CurrentBars[0] < 0
    || CurrentBars[1] < 0)
    return;

    #2
    Just realized that my parameter "string instrumentName" is not an named as wanted instrument (or any instrument that matter) and that is most likely the problem. Is there a way use it always as same as primary one or do I need to always change it in code when I want to change pairs. Also read that using variables determing brick size is not recommended.

    Comment


      #3
      Hello Gelotuz,

      With the AddRenko that lacks the overload to take the primary instrument so you would need to hard code it. With AddDataSeries and all of the data adding methods like AddRenko they can fail if variables are being used for the values of the added series or instrument name. It is best to just hard code those items to ensure it works as expected.

      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Working...
      X