ATR analysis oopsie!!

Discussion in 'Technical Analysis' started by STD Deviant, Aug 10, 2018.

  1. I completed a very extensive manual backtest and just this week started trading it live. After reviewing some of the data I noticed my "daily" ATR number was differing from the number I was using at the open of the US trading period.

    To my horror I quickly recognized my indicator was giving an up-to-the-minute ATR output - shown in the top left corner of the window and on the chart itself if you measure the bars with your pointer. When you highlight the current day's bar on the main price chart it shows yet another number - neither are the same as the final total you'd get after the day is completed. I thought ATR on a daily chart would give you the preceding "X" number of days based on your time frame. Instead, this was including the not yet completed current day slightly skewing the ATR number to the downside in most cases.

    I'm worried now that my backtest is ruined. I'm using an ATR period of less than 20 days so this shortened final day is affecting the computation more than I'd like. What should I do? I guess in the future I should highlight the preceding day and use that number? Or does the average trader just take the "up-to-the-minute" number regardless if it's using a partial day with artificially low volatility data.

    As we know, indicators usually work best when used just like everybody else regardless if they are accurate or not.


    Thanks in advance!

    P.S.- I'm using the standard ATR indicator in Metatrader 4.
  2. this "future looking" stuff is done all the time. I did it a while back and everything looked good until real trading. One way to minimize this bias is to reference the bar before and STOP there and trade off of it.
    so instead of BUY if > ATR...Buy > ATR(-1).ie previous days atr.
    STD Deviant likes this.
  3. fan27


    The software is behaving as expected. While the ATR value will be variable until the bar actually closes, to get the backtest and live trading results to line up, you should only check for signals on the OnBarClose event or whatever is used for Metatrader.
    STD Deviant likes this.
  4. Exactly! I was in essence using an ATR crystal ball. I haven't identified yet how much of an impact it had on my overall profitability but I'm certain there was some.

    I also just got an idea: Say I'm in a trade and the ATR is adjusting real-time - reacting to higher or lower than normal volatility. Could I then adjust my PT's up or down throughout day? In this way my PT's are slightly dynamic rather than static for 24 hrs. Of course I would start the trading day using an initial figure of "X" periods - 1.
  5. This particular indicator doesn't allow you to choose parameters like "high, low, on close". I could however just use the previous day's number as suggested by mushinseeker. I just wanted to obtain some feedback on what was normal protocol.
  6. fan27


    Are you using the same code to backtest that you are using for live trading?
    STD Deviant likes this.
  7. I'm not using "code". You mean trading plan? My trading is manual.

    Initially during my "manual" backtest, I was using the daily ATR (closed bar) numbers. Upon live trading I was using that morning's, of that day's, ATR number. After learning that the daily ATR was updating live, I knew my data was corrupt. The fact that my ATR is of a shorter time frame makes it even worse.
  8. fan27


    I understand. I missed the part about the backtest being manual. How come you are manually backtesting your strategy and not writing code to do so? Even if you don't know how to code, might be worth the investment in paying someone to do it.
    STD Deviant likes this.
  9. I don't know if this trading strategy could be automated. It would be a pretty complicated algorithm.

    I will admit, I am a little technologically disadvantaged when it comes to automated processes in this field. But what I've read/learned/heard is that automated systems are not all they've cracked up to be and backtesting strategies years and years into the past is a waste of time in most cases as the market is continually evolving.
  10. fan27


    How were you able to manually backtest your strategy without it being rules based?
    #10     Aug 10, 2018
    STD Deviant likes this.