Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PF and Kagi

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

    PF and Kagi

    What are the differences between how point and figure and kagi bars are constructed live vs in a backtest?

    #2
    Hello samish18,

    Thank you for your post.

    Advanced bar types like PnF and Kagi have issues running Calculate settings other than OnBarClose.

    In backtest, there would not be a way to know how the bar formed (the way it did in real-time) so it is impossible to accurately fill an order - the same issue as Renko bars.

    Consider point 1 from this forum post:

    Please consider the nature of backtesting a PnF chart and the underlying inherent differences between real-time and backtesting exacerbated by this particular chart type. In real-time you are able to have your profit targets and stop loss fill based on actual price action inside that PnF column. In a backtest, you are unable to know the sequence of events that happened in that PnF column. It is not possible to pinpoint when your orders will be filled or even at what price as there is not enough granular information. In real-time your orders fill when the exact price action moves to your order’s prices. In a backtest we can only guess what happened based on end of column information. End of column information could contain information from a huge amount of time and the longer the column is you can see how the inaccuracies can become more apparent. This is not a bug and is simply the limitation of backtesting PnF charts. With imperfect information orders filling can be different than what happens in real-life trading.


    You can help alleviate the discrepancy using 1-tick intrabar granularity. However like Renko bars it would be more accurate to use Market Replay to backtest.

    Comment


      #3
      Does it repaint the open like Renko bars. Additionally, If I am using onBarClose exclusively and not using profit targets or any inter-bar actions, should the backtest, (like renko) be consistent with live?

      Comment


        #4
        Hello,

        No, that is not how PnF bars work. The linked post explains how PnF bars work.

        Also no, as explained complex bar types aren't ideal for backtesting in the Analyzer and it would be better to backtest using Market Replay. You could alleviate the discrepancy of backtesting in the Analyzer by implementing intrabar granularity however.

        Comment


          #5
          The post indicates that if a strategy is only executing onBarClose and not taking any intrabar actions (profit target and stop loss), intrabar granularity should not be needed

          Comment


            #6
            Hello samish18,

            Intrabar granularity is needed regardless of Calculate setting, for any bar type. Intrabar granularity is not for intrabar actions. It is for higher accuracy order fills.

            Tick Replay is for intrabar actions. Tick Replay isn't necessary if using OnBarClose.
            Last edited by NinjaTrader_Gaby; 10-15-2024, 06:19 AM.

            Comment


              #7
              I have been using a secondary data series of the same instrument to get accurate price fills. Would the timing of orders be correct on a PF aand Kagi chart?

              Comment


                #8
                Is the secondary data series a 1-tick series that you are submitting the orders to? That would be necessary for higher accuracy in backtest.

                Comment


                  #9
                  It is 1 minute, but I have using higher than 1 minute PF bars

                  Comment


                    #10
                    As mentioned, higher accuracy in backtest would require 1-tick intrabar granularity and actually submitting the orders to the 1-tick series.

                    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
                    132 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