Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

eliminate difference between real trades and backtesting

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

    eliminate difference between real trades and backtesting

    Hello, I need to make trading system closer to backtesting results, in reality there is a delay in execution of orders, and it influences the results of trading. System executes orders by close of a candle. I need good decision, may be to execute orders before 200 ms of ending of candle period or something else?

    Thanks!

    #2
    Hello U0000999,

    Thanks for your post.

    If your strategy is running with the setting of Calculate.OnBarClose then it would run your strategy once per bar and any orders to be placed would be placed and may be filled on the next bar. This is also the same mode that historical data is processed on.

    If you run the strategy with the setting of Calculate.OnEachTick or Calculate.OnPriceChange then the strategy would execute (On live or market replay only, not on historical data) on every tick or every price change that occurs with a bar. This would certainly get you an earlier opportunity but you have to know that in these modes, it is possible to unintentionally place multiple orders and you would need your own additional logic to prevent this. It is also possible that the intrabar conditions may show conditions that favor an entry but when reviewed historically the conditions would not be favorable. An example of the later is a crossover condition that appears intrabar but when the bar finally closes would not show a crossover because of the final price movement. You would need to determine how best you wanted to handle that particular situation.

    If you are backtesting with an exotic bar, such as Renko or Heiken-Ashi, please note that you may achieve false positive results as these bars do not reflect that actual price movement that occurred within the bar.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    71 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    43 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    25 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    28 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    56 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X