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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        80 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X