Adjusted close and open price

Discussion in 'Automated Trading' started by Bigchazza, Nov 23, 2020.

  1. Bigchazza

    Bigchazza

    Hi. Fairly newbie here, trying to learn by constructing my own auomated backtest and trading software (see journal for details!) Here's a question: the data I use has open, close and adjusted_close (plus low and high). There is lots of advice out there that you should use adjusted close price, and I get that, so I have made the system capable of either (in a consistent way) depending on a parameter. BUT...

    The way I have simulated trades in the backtests, I take the EOD close price and then essentially pretend I am ordering the next morning at open, so I use the next day's "open" price, and maybe reject the signal if it has gapped too much. But how can I do that if I use adjusted close? You don't get an "adjusted open" price. Should I try to calculate an "adjusted open" based on difference between close and adjusted close?

    What do other people do? Do you just trade on the signal price in your backtesting, even when it's a EOD signal?

    Am I overthinking this?
     
  2. traider

    traider

    EOD is very liquid for most stocks. Just try to hit the closing price and compare it with your backtest
     
    Bigchazza likes this.
  3. MarkBrown

    MarkBrown

    when you place a trade eod the signal can change because after the close they adjust for the settlement price so lets say a close price is 3500.25 on the es futures and your system buy's on that close. minutes latter that official close of the es futures is posted as 3500.00 and when your chart refreshes the close is now replaced with the settlement price of 3500.00 and your system is no longer showing the trade that it had took at 3500.25

    so to avoid this problem many people run intraday charts and program the systems to not take a trade within x number of minutes prior to the session close.
     
    Bigchazza likes this.
  4. You can calculate the adjusted open using the following formula:

    AdjO = Open * (AdjC / Close)

    I use adjusted data in my backtesting since it gives you a true idea of returns by including dividends. It also removes gaps due to splits, special dividends, etc.
     
    Bigchazza likes this.
  5. Bigchazza

    Bigchazza

    Thanks all. I think I'll look for specific examples of disruptive splits and divs to see what the impact is. Like I say I have coded it up to do either way, so I'm open. @GaryBtrader I have taken your formula for the adj open - cheers.