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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        56 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        133 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X