3 Candle Predictor

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

3 Candle Predictor

Postby Apprentice » Sat Apr 26, 2025 7:51 am

EURUSD D1 (04-26-2025 1502).png


Description:
This indicator predicts the direction of the next candle based on historical patterns formed by the previous 3 candles. It analyzes whether each candle closed higher (Up) or lower (Down) compared to its open price.

How the Indicator Works:
It checks the direction (U for up, D for down) of the last 3 candles.

It searches historical data to find similar 3-candle patterns.

It then examines historically what direction the next candle moved after those matched patterns.

The indicator predicts the next candle direction based on the most frequent outcome following that pattern historically.

Possible 3-Candle Patterns:
Each candle can have 2 states: Up (U) or Down (D).
Thus, the total number of possible unique patterns of three candles is:

2×2 × 2=8  unique patterns

These 8 patterns are:
1. U U U (three candles up)
2. U U D (two candles up, last candle down)
3. U D U (first candle up, second down, third up)
4. U D D (first candle up, two candles down)
5. D U U (first candle down, two candles up)
6. D U D (first down, second up, third down)
7. D D U (two candles down, third candle up)
8. D D D (three candles down)

3 Candle Predictor.lua
(8.36 KiB) Downloaded 196 times


This oscillator calculates the prediction accuracy percentage of the "3 Candle Predictor" indicator over the last 10 candles. It measures how frequently the direction predicted by the "3 Candle Predictor" matched the actual direction of price movement (Up or Down).

Interpretation:
100%: All predictions in the last 10 candles were correct.
0%: None of the predictions were correct.
A higher percentage indicates a more reliable predictive pattern in recent market conditions.
3 Candle Predictor Accuracy.lua
(6.4 KiB) Downloaded 194 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38908
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: 3 Candle Predictor

Postby Apprentice » Sat Apr 26, 2025 8:18 am

EURUSD D1 (04-26-2025 1515).png

The N-Candle Predictor is an advanced version of the original 3-Candle Predictor.
While the 3-Candle Predictor always analyzes patterns formed by the last 3 candles, the N-Candle Predictor allows the user to define the number of candles (PatternLength) used to form the historical pattern — anywhere from 1 to 10 candles.

This flexibility enables deeper pattern recognition by using longer sequences of market behavior, offering a more customizable and adaptive prediction model compared to the fixed 3-candle approach.

Number of Possible Patterns in N-Candle Predictor
Each candle can have only 2 states:
U (Up) – if close > open
D (Down) – if close < open

Thus, the total number of possible unique patterns for N candles is:
Total Patterns=2^N

Examples:
Pattern Length (N) Number of Possible Patterns
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
N-Candle Predictor.lua
(8.66 KiB) Downloaded 200 times

N-Candle Predictor Accuracy.lua
(7.64 KiB) Downloaded 193 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38908
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: 3 Candle Predictor

Postby Apprentice » Tue Apr 29, 2025 7:52 am

EURUSD H1 (04-29-2025 1451).png

EURUSD H1 (04-29-2025 1452).png

N Candle Predictor (Historical Close)
Sampling logic:

Forms a historical pattern by including the current candle.

The pattern uses period - i (where i = 1..N).

This introduces a bias: the current forming candle (still updating) influences the pattern.

Forecast placement:

Prediction symbols are drawn below or above the current candle (low or high plus/minus some pips).

Always forecasts for the current period.

Real Time Forecast N Candle Predictor (Strict Past Only)
Sampling logic:

Forms a historical pattern using only fully closed candles.

Uses period - i - 1, ensuring the current forming candle is never included.

True real-time behavior: the prediction is purely based on the finished candles, no contamination from unfinished price action.
Real Time Forecast N-Candle Predictor.lua
(8.76 KiB) Downloaded 162 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38908
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: 3 Candle Predictor

Postby Apprentice » Mon May 05, 2025 12:00 pm

XAUUSD H1 (05-05-2025 1900).png

N-CANDLE PREDICTOR OSCILLATOR.lua
(7.21 KiB) Downloaded 85 times

MTF_MCP N-CANDLE PREDICTOR.lua
(12.07 KiB) Downloaded 86 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38908
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot] and 10 guests