Predicting the next candlestick direction

For those of you who have not seen some of my other posts I am a computer programmer that has access to a Forex API which means I have a lot of data at my fingertips and the ability to analyse it easily. I have been doing a bit more statistical analysis and I may have come up with something useful. I was looking at the ability to predict the direction of the next candlestick, not magnitude, just direction.

Experiment 1
I just counted the number of up vs down candlesticks over the maximum number of days that the OANDA API lets me go back (5000). The result is pretty much a 50/50 split between up and down.

Experiment 2
Using a moving average I counted the number of times the candlesticks matched the price being above or below the moving average. I went from 2 to 50 days for the moving average, sma and ema and I found that the split was 50/50. In other words, being above or below the moving average had no effect on the direction of the candlestick.

Experiment 3
Using various candlestick patterns I found that after various patterns the next candlestick has a 50/50 chance of being up or down.

Experiment 4 - The interesting one.
Using RSI I found that if the RSI (periods 5) is below 50 then the up/down split for the next candle is about 60/40. Yes that is right, 60% of the time over the last 5000 daily candles the RSI has predicted the direction of the next candle. I checked and double checked the calculations and everything seems to be right.

I am going to be testing this RSI signal on a demo account to see if it works in real life.

5 Likes

i’ve seen (and enjoyed, and appreciated, and duly “liked”) at least some of them, and had been kind of wondering “who you are”, so i’m pleased to hear that :sunglasses:

your first 3 experiments mentioned above don’t surprise me at all - but the 4th does

i just want to check that i didn’t misunderstand (which sometimes happens!): you’re saying that when the RSI-5 is below 50, the up/down split is 60/40, in other words 60% of the time the direction of the next candle is up?

1 Like

What I meant to say was…
When the RSI(5) is below 50 then down=60% and up=40%.
When the RSI(5) is above 50 then up=60% and down=40%.
Bear in mind that this only affects the next candlestick.

1 Like

The 4th experiment was very surprising and I had to step through the code to make sure that it was working properly. From everything I can see it is working just fine. I ran through 70 pairs and the 60/40 split seems to be true no matter what pair you use.
I am going to try the following, it is a slight modification of what I am already trying out.
Using AUD/NZD, CAD/CHF, EUR/USD, GBP/JPY I am waiting until an hour or so after the day starts (5pm Eastern) then I am looking at the charts. For each of the pairs…

  1. Look at RSI(5) to decide if I want to buy (RSI>50) or sell (RSI<50).
  2. Look at the ATR(5) and using that for the take profit pips.
  3. Use the ATR(5) divided by 2 for the stop loss pips.
  4. Calculating the risk at 1% for the position size.
  5. Opening the position.
  6. Letting the positions close out when they hit either the SL or TP point even if it takes more than one day.

Very interesting. I enjoy these types of stats.

One simple but often overlooked fact about the above stat is that although this is an average, there are more up bars in an uptrend and more down bars in a downtrend.

Knowing and paying attention to little things like this can help give you an edge.

2 Likes

You would think that there would be more up bars in an uptrend etc… but I do not notice that in my data. I have a +/- 2% “noise factor” which might be filtering that out. It also might be that using the above or below a moving average is not a good way to determine a trend (Experiment 2). This also does not take into account the magnitude of the candlesticks so it could also be that the candlesticks go up further than they go down to make an uptrend.

This is why RSI is the most useful. It also probably works with (10) as well. Add MACD 3-10-16 and use the histogram bar movements as a confirmation move, and maybe use both for scalping 1-5 m charts.

Disclaimer: I use the above on Daily (trend), 4hr (trend entry) 1hr (trend continuation) charts. All like 3 ducks in a row. My 2023 win rate is 55%.

2 Likes

This is much more gambling than trading.

The majority is pretty slim whenever I have looked at trends. In a typical uptrend perhaps only 55% of days have higher closes than the day before: the longer the time duration, the more likely the result is 55:45.

Of course the 55% days with higher closes mostly have greater daily rises than the 45% with lower have falls, so the positive outcome is reinforced.

But for me, holding for one bar in a trend is something I’ve never been able to prove sustainable.

1 Like

Hi igillman, maybe a bit of an old topic but I was wondering, do you had any feedback on this RSI theory, is this statistic still valid? and could this also be valid for lower time frames? I suspect so, maybe with a lower reliability rate

Unfortunately it did not work out and slowly slipped back to be about 50/50 (same as everything else). I never did figure out what the anomaly was.

I recently started running two strategies which in part involve predicting the direction of the next daily candlestick, since both carry the option of exiting at the first profitable close.

Mean reversion -
If the close is in the bottom 20% of the day’s range and is below the 50EMA, buy. Exit at the first profitable close. Set a stop-loss at least 1% below entry price.
Reverse for a short.

Outside day reversals -
See the D1 charts for an outside bar with the close higher or lower than the range of the previous bar.
Wait for the first close above or below the outside bar’s range.
Buy if the close is higher, sell if the close is lower.
Set a stop-loss at the furthest end of the outside bar’s range.
Exit at the first profitable close.

Thanks for the info, it’s still very useful to know how it went. Out of curiosity, have you ever performed similar analyzes on tick data? for example where each candle is made up of 1000 ticks, instead of time-based candles which are fixed cut-points in time

Tommor thanks for sharing, how is it going so far?

I have not done anything with tick data.

1 Like

Strategies that have been neatly arranged and can be implemented. Do you apply to many pairs or just certain ones? But from what I see, this is a common strategy for multi-instruments. Because on the basis of a candlestick chart with the right time frame, future predictions can be made. Of course, with predetermined TP and SL settings.

I am applying the mean reversion strategy to all Forex pairs, hoping to identify whether it works better on high or low volatility markets.

I want to do the same with outside day breakouts but I would rather be using profit than deposited capital so trials of this strategy are slow right now.

1 Like

Your posts on that have been interesting, and I’ll be disappointed for you, if you don’t get something “playable” out of that one. That’s going to go better for you than mean reversion, surely?

(I don’t mean to imply that there’s no such thing as “mean reversion” in forex: I know there is, but finding a playable edge there isn’t likely to be easy at all?)

You make a fair point. The outside day strategy has great potential for long-term positions with massive gains. I’m assuming that I won’t be trailing the stop-loss. It’s also possible that I will only use stop-and-reverse to exit a winner.

1 Like

How’s this going?

The mean reversion strategy has proven itself just as simple as described and it just keeps making money and making money. The win rate is astronomical, far better than opening range breakout trades for example.