Testing Candlesticks

Discussion in 'Technical Analysis' started by LearningMarkets, Aug 19, 2008.

  1. LearningMarkets

    LearningMarkets ET Sponsor

    A little while ago I wrote a series of articles about mechanically testing candlestick patterns in the forex. Because spot forex lacks gaps, a lot of traders ignore candles even though they can still be used productively.

    In this first test I set up some simple parameters and looked at what kind of profitability you could expect from hammers in the forex. I thought the findings were really interesting.

    You can see that article here: http://www.pfxglobal.com/pfx-forex-blog/hammer-out-some-profits-with-candlestick-patterns.html

    Any candlestick analysts out there? What are your thoughts?
     
  2. Corey

    Corey

    I enjoy the premise, and would love to seem more articles on similar topics, but the article lacks follow through.

    'Expectancy' and 'on average' are the most dangerous words in ivory tower jargon. It's why so many portfolios are spectacular on paper, but fail miserably in real life -- the systems are too hard to follow or impossible to implement. In your case, specifically, you don't answer a few questions that I consider quite important.

    How many signals were generated? Does the system have a statistically significant positive expectancy (based on a t-test or z-test)? How does the 25 pip trailing stop affect the overall performance of the system?

    Finally, how effective is this on different time frames? Is the pattern fractal in nature? Does it work similarly for a 1 minute, 5 minute, 1 day, 5 day, 1 week time frame?

    Anyway, I don't mean to be too critical. I would love to see more articles like that!
     
  3. what was the entry and exit criteria (I saw you wrote enter next candle, is that following daily open? profit exit when)? What was the max daily drawdown (in %) and sharp ratio.

    What window do you use for your drawdown?

    Interesting work. I've run similar tests on equities previously, and they didn't pan out too well for hammers or shooting stars.

    48% winners pretty much looks like what I saw, basically 50/50 coin test outcome.
    The profit you realized looks to be more of a function of theoretical tight stops/zero slippage and whatever the profit exit method you used, rather than signal reliability. i.e. how does it perform vs. random entry.
     
  4. AndreTheGiant

    AndreTheGiant Guest

    Not bad 2:3-1 real time reward to risk is respectable. I look for at least 3:1 reward-risk. Good point from other readers about adding details to study (ie stops, entry levels). Simple is better - I prefer simple and robust trading systems that true traders can understand and execute in real markets.
     
  5. ammo

    ammo

    is there a timeframe that these are more likely suited for,30 min ,daily,5 min,do they give a lot of false signals with shorter timeframes?
     
  6. LearningMarkets

    LearningMarkets ET Sponsor

    These are good comments. I meant to answer most of them in the article but apparently I was not clear enough so here is another attempt.

    Corey:
    - There were 325 signals generated during that period.

    - I used a standard fixed risk formula to calculate expectancy. I did that because I was merely trying to establish a baseline. Clearly actual results will vary if for no other reason than "past results do not predict future results." But I felt that if results were positive in the mechanical test it would at least show that the signals could be of assistance to a trader during their trade decision making process.

    - The 25 pip stop is arbitrary in developing the benchmark. If I wanted to optimize it, obviously the results would vary but the whole "past data" issue makes me uninterested in over-analyzing the data.

    - If you ignore trading costs the system was similarly effective with a smaller trailing stop in shorter term (ie 1 hour, 4 hour etc.) however, when you add trading costs (spread & slippage) it underperforms the results based on the daily periods because your trading frequency goes way up but your upside doesn't.

    - I am not sure what an Ivory Tower is but my office is on the third floor of an ivory colored building so perhaps you are not too far off. I agree that any mechanical testing has to only be taken so far. If it really were that easy then we could just let our computers do the trading. I like testing because it helps me get some perspective on a system and it helps me identify several setups at a time so I can be more efficient but that is as far as I think most traders should take it. (thanks for your questions!)

    Dtrader:
    - I got in at the open of the next candle.

    - The system drew down 15% max in the portfolio with a fixed investment amount per trade. The fixed investment amount was at a portfolio leverage amount of 2:1 (The sample portfolio was 100K so I was trading two full size contracts- 200K of notional value.) The Sharpe ratio was too high to be considered indicative considering that the entries were pretty "perfect." It becomes a guessing game at that point as to how much inefficiency I should insert into the test. I kept it at 3 pips slippage per trade.

    Ammo:
    - The shorter time frames were fine. I didn't test lower than 1 hour periods. However, trading costs killed the returns since the upside had to be crimped more to stay profitable. It underperformed the daily periods.

    The bottom line in the article was not to use this as a model system to simply look for hammers and then get in on the next candle with a trailing stop. That was the test. The real market is much more complex. It was a way to show whether there was value in the indicator itself and whether it makes sense to look for these patterns at support levels or as a trigger for a new long term entry.
     
  7. I'm not a believer in being able to test the merits of Japanese Candlesticks via a mechanical code especially when real trading conditions are much more complex.

    My main merits litmus is real trading results via a well defined trading plan of using Japanese Candlesticks.

    That trading plan is much more than just an entry signal that involves confirmation signal (not the candlestick pattern signal), initial stop/loss placements, trailing stops, profit targets and exit signal.

    It also involves the price action the Japanese Candlestick pattern is occurring within.

    Those above reasons alone out of many others I didn't mention will have dramatic changes on the results of Japanese Candlesticks if a trader has a different trading plan in comparison to another trader.

    Thus, real trading should force any trader to use a trading plan and that's where the real puzzle is at and the main reason why I prefer to manually test Japanese Candlesticks because no mechanical code can duplicate how I actually trade them due to all those other objective variables in the trading plan.

    I then compare my manual back testing results to my real trading results to determine the merits of a particular Japanese Candlestick pattern.

    Last of all, keep in mind that there are many variations (sub-groups) of each Japanese Candlestick pattern (e.g. over dozen types of Bullish White Hammer patterns).

    http://www.elitetrader.com/vb/showthread.php?s=&threadid=52880

    Mark
     
  8. Corey

    Corey

    Great stuff. Thanks!
     
  9. LearningMarkets

    LearningMarkets ET Sponsor

    One of the comments on my last post made me think about confirming candlesticks. There are a number of ways to do that and I think it helps when the candlestick pattern itself if less reliable than others.

    This is an article in which I tested inverted hammers and how likely it was for them to lead to a reversal if they were confirmed as part of a downtrend. The rate of success was about 50% but the r/r was pretty positive even with the constricted parameters I included.

    - I found 175 patterns over the test period.

    Check out the results I found here:
    http://www.pfxglobal.com/pfx-forex-blog/confirming-candlestick-patterns-inverted-hammers.html
     
  10. Back to the original question I posed (you answered some, but not all).

    If the results show an ~ 50% rate of success, then how is that different than random entry. I.e. If you use the candlestick entry and objective exit parameters, how do the resulting metrics compare to completely random entry with identical exit parameters? To be thorough, you'd have to do some kind of monte carlo simulation and look at how significant the return parameters were compared to random entry.

    My point in asking this is it seems to me that you are attributing the positive expectancy to candlestick based entry points. But how do you know (without comparing) that it wasn't just attributable to a random entry and your specified exit criterion. My question pretty much mirrors another posters regarding t tests. It's important to make this assessment as it shines light on the efficacy of your observations on candlestick entries.

    If one makes the argument that other criterion have to be added to actually look at it in context, then the test itself is subjective and doesn't prove much about candlesticks contributing to an edge.

    BTW. Refreshing to see someone approach the subject objectively. We need more of that here.
     
    #10     Aug 20, 2008