Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error running a strategy in the analyzer

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

    Error running a strategy in the analyzer

    Hello,
    I've writing a strategy and now testing the AddSeries methods. I've wrotten the next code:

    Code:
    else if (State == State.Configure)
    {
    AddRenko(null, 4, MarketDataType.Last);
    AddVolumetric(null, BarsPeriodType.Range, 4, VolumetricDeltaType.BidAsk, 1, false);
    }​
    When I run the Strategy Analyzer, it throws the next error:

    Default Failed to call 'Add' method: System.InvalidOperationException: RemoveLastBar() not supported for tick replay. See 'IsRemoveLastBarSupported' property at NinjaTrader.Data.Bars.RemoveLastBar() at NinjaTrader.Data.BarsType.RemoveLastBar(Bars bars) at NinjaTrader.NinjaScript.BarsTypes.RenkoBarsType.On DataPoint(Bars bars, Double open, Double high, Double low, Double close, DateTime time, Int64 volume, Boolean isBar, Double bid, Double ask)
    If I don't use AddVolumetric, it runs, and if I don't user AddRenko, it runs too.

    Is it possible to use both methods of DataSeries? Do I have wrong configuration?

    Thank you in advance

    #2
    Hello ruina,

    That is because of the AddRenko and using TickReplay. Those cannot be used together to be accurate, renko relies on realtime data to drive its logic.

    Comment


      #3
      Hello,
      then if I've understood it, I can run the Strategy Analyzer without Tick Replay, and add both dataseries: AddRenko and AddVolumetric, the point is the principal DataSeries, it affects AddRenko, but without Tick Replay the AddVolumetric runs fine, aren't it?

      Thanks in advance.

      Comment


        #4
        Hello ruina,

        Tick replay is a feature that allows a script to process tick by tick and have OnMarketData called historically, if you don't specifically need those features you can just disable tick replay. That feature is not used to increase accuracy in a backtest so it is often not required to be used at all.

        Renko bars use a feature called remove last bar which is only supported in realtime so those bars specifically will provide different results between a backtest and realtime, if you use renko the suggested would be to test only in realtime using playback or a live connection.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X