BUY is executed one bar to late, why?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #244783 quote
    johan.huldberg
    Participant
    New

    I have coded a indicator that assignes a variable the value 500 when all my conditions are meet.

    I have a automatic trading system (strategy) that have exactly the same conditions as the indicator, fullfilled conditions = BUY x contract.

    But, the automatic trading system (strategy) executes the BUY one bar after the variable is 500, why?
    The BUY should be executed at the same bar as the variable is 500? This is when I backtest, I have never tested this strategy in real life. Is it different then?

    #244784 quote
    LucasBest
    Participant
    Average

    Your variable become 500 at the close (end) of the current bar, not at the open of the current bar!
    Your automatic trading system (strategy) can’t guess that your variable will be equal to 500 before the end of the current bar…
    Therefore your automatic trading system executes the BUY at the open of the next candle… (the bar that is next the one that is 500)
    It is just normal and the same in backtest and in real life.

    Iván González and robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

BUY is executed one bar to late, why?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by LucasBest
11 months, 2 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/09/2025
Status: Active
Attachments: No files
Logo Logo
Loading...