Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting using Renko

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

    Backtesting using Renko

    Hi

    Aplogogies if this has been addressed before but I couldn't find it in the forums.

    I'm trying to test a strategy using Renko and have my doubts that the results are accurate. This is the situation which uses BuyStop or SellStop (or Limit) to enter the market:

    Long Example using 4 Renko bars:
    Bar A forms and is a signal bar to enter the market. Strategy places a buy stop 1 tick over the high of the bar.
    Bar B forms and, historically, the Renko bar never forms higher than Bar A, so historically, the order is never triggered. However, in reallity, during renko Bar B formation, the actual price moves 3 ticks higher than Bar A and reverses to close lower than Bar A.

    So, in reality, the order was triggered, but historically it shows as a non-trade.

    Is this a common challenge when using Renko? Or can I do something different to account for this scenario?

    Thanks.

    #2
    Hi Shadowfax,

    NinjaTrader backtesting treats renko bars the same as other bar types like candle sticks or OHLC

    Conditions are evaluated on each bar. If true, then the order is submitted to the next bar following the condition. Fills are then determined on this bar using the fill type selected:


    Default
    An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
    • Limit orders only fill if the limit price was penetrated
    • Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NinjaTrader will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)

    Liberal
    An algorithm that takes a liberal approach to filling limit and stop limit orders.
    • Limit orders fill if the limit price was touched
    • On gap down bars, buy limit orders will fill at the high of the gap down bar
    • On gap up bars, sell limit orders will fill at the low of the gap up bar
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan

      Thanks for the quick response. However, I am not sure my particular question was answered. When backtesting using Renko bars, how does the strategy know that historical price penetrated the limit order (or even buy stop)? Does it check the tick data? I hope you understand my question and concern that the Renko trigger bar (B) does not close above renko setup bar (A), and therefore it is a non-trade, when in reality price may have spiked/moved up to fill the order, but reversed and never completed the renko bar (B) above (A). I hope this is making sense...

      Comment


        #4
        It uses the rules in my previous post to determine order timing and fills. It does not automatically look at tick data unless you code for intrabar granularity. Backtesting sees only the four data points for each bar, and why you will see discrepancies expected in real time compared to backtest:


        If you want to simulate real time as close as possible, best would be using market replay which allows you to quickly play back a session worth of trades.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Maybe a couple of charts to illustrate my example.

          Renko chart shows an example where Bar A is the signal bar and strategy places a SellStop order 1 tick below the low: Low is 86.82 and Short order goes in at 86.81. Next bar shows an up Renko bar with the low being 86.90. So, according to the historical data, the strategy shows this as a non-trade.

          However, in the 1 minute chart, you'll see that the low was in fact 86.75 - more than enough to trigger the sell stop order. But the market reversed and the renko bar never completed to the downside. Now, there is a disconnect between reality and the historical results. The strategy on the renko chart never recognized that the real low would in fact have triggered the ordered.

          I hope this is clear now.

          Thanks.
          Attached Files

          Comment


            #6
            Any feedback on this? Is this a bug or is one to assume that historical results with Renko using stop and limit orders are not accurate and therefore should not be used?

            Comment


              #7
              shadowfax, this is not necessarily a bug, it is just how the renko bars are built. If the price jumped from 87 to 88 in one tick, "phantom" renko bars would be built for that entire range, even though no trades took place.

              I would recommend running your strategy live on a simulation account to see how it performs during real-time trading.
              AustinNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              43 views
              0 likes
              Last Post bill2023  
              Started by yertle, Today, 08:38 AM
              6 responses
              25 views
              0 likes
              Last Post ryjoga
              by ryjoga
               
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              24 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              46 views
              0 likes
              Last Post jeronymite  
              Working...
              X