The “Price Action Forecast” (PAF) indicator, created by Zeiierman, is designed to predict future market movements based on historical candlestick patterns. It uses a series of candles to identify similar events in the past and projects these patterns into the future, providing a visual and quantitative tool to anticipate potential trends and price changes.
This indicator is particularly useful for traders who use technical analysis and seek to leverage repetitive patterns in historical price data.
Let’s explain the different parts of the “Price Action Forecast” (PAF) indicator code:
The indicator starts by defining and calculating the necessary variables:
The main code executes on the last tick of the bar (islastbarupdate):
If Display is enabled, rectangles are drawn around the areas of interest on the chart, helping to better visualize the detected patterns.
The “Price Action Forecast” (PAF) indicator allows users to adjust various parameters to suit their specific trading needs. Below are the main configurable parameters and how they can be modified:
To customize the indicator, users can adjust the values of the input variables directly at the beginning of the code. Here is an example of how to do it:
// Input variables
Series = 10 // Increased the number of series candles
Forecast = 50 // Reduced the number of forecast candles
Display = 0 // Do not display events on the chart
These adjustments allow traders to tailor the indicator to different market conditions and specific trading strategies.
To illustrate the use of the “Price Action Forecast” (PAF) indicator, here are some practical examples of how it can be applied to real charts.
Suppose we configure the indicator with Series = 7 and Forecast = 100. The indicator will search for sequences of candles (bullish and bearish) that match the last 7 candles on the current chart.
Interpretation:
By configuring the indicator with Series = 10 and Forecast = 50, we can focus on detecting patterns that occurred at support levels. Suppose the current price is at a previously identified support zone.
Interpretation:
The PAF indicator can be applied in different timeframes to suit various trading strategies. For example, on an hourly chart, we can configure Series = 5 and Forecast = 30 for short-term predictions.
Interpretation:
The “Price Action Forecast” (PAF) indicator created by Zeiierman is a powerful tool for predicting future market movements based on historical candlestick patterns. By identifying similar events in the past and projecting them into the future, this indicator provides a quantitative and visual insight that can significantly enhance trading strategies.
We recommend traders to experiment with the indicator’s parameters to find the configuration that best suits their trading style and use this tool as a complement to their technical analysis.
//--------------------------------------------------------------//
//PRC_Price Action Forecast
//version = 0
//18.06.24
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//--------------------------------------------------------------//
// Variables de entrada
Series = 7 // Candle Series
Forecast = 30 // Forecast Candles
Display = 1 // Display Event
atr=averagetruerange[14](close)
// Variables y Arrays
Once dataSize = 0
datasize=barindex
if (Close > Open) then
$dataD[dataSize] = 1
else
$dataD[dataSize] = -1
endif
dataSize = dataSize + 1
if islastbarupdate then
// Crear velas de predicción
IF dataSize >= Series THEN
Found = 0
Events = 0
// Buscar eventos similares en el pasado
FOR i = Series TO dataSize - Series DO
Equal = 1
FOR j = 0 TO Series - 1 DO
IF $dataD[dataSize - j - 1] <> $dataD[dataSize - i - j - 1] THEN
Equal = 0
BREAK
ENDIF
NEXT
// Si se encuentra un evento similar
IF Equal = 1 THEN
Found = 1
Dist = 1
x=barindex[i]
y1=low[i]
y2=high[i]
Prev = close[i]
Diff = ((Close - Prev) / Prev) + 1
// Crear velas de predicción
FOR j = 1 TO min(i,Forecast - 1) DO
IF dataSize - i - j > 0 THEN
Pos = $dataD[i - j]
IF close[i-j]>open[i - j] THEN
myTop = close[i-j] * Diff
myBot = open[i - j] * Diff
r=0
g=255
ELSE
myTop = open[i - j] * Diff
myBot = close[i-j] * Diff
r=255
g=0
ENDIF
Hi = High[i - j] * Diff
Lo = Low[i- j] * Diff
drawsegment(barindex+Dist+1,myTop,barindex+Dist+1,hi)coloured(r,g,0)
drawsegment(barindex+Dist+1,myBot,barindex+Dist+1,lo)coloured(r,g,0)
DRAWRECTANGLE(barindex+Dist, myTop,barindex+ Dist + 2, myBot)coloured(r,g,0)fillcolor(r,g,0)
ENDIF
Dist = Dist + 3
NEXT
BREAK
ENDIF
NEXT
IF Display THEN
drawrectangle(x,y1-2*atr,x+series,y2+2*atr)fillcolor("yellow",90)
drawrectangle(barindex[series],min(low,low[series])-2*atr,barindex,max(high,high[series])+2*atr)fillcolor("yellow",90)
drawline(barindex+1,high,barindex+1,low)style(dottedline2,3)coloured("grey")
ENDIF
ENDIF
endif
return