This ProBuilder code snippet demonstrates how to identify a crossover event between the Kijun Sen line and the Ichimoku Cloud in a trading chart. The Ichimoku Cloud is a popular technical analysis tool used to gauge momentum, support, and resistance.
Tenkansen = (highest[9](high) + lowest[9](low))/2
Kijunsen = (highest[26](high) + lowest[26](low))/2
SSpanA = (tenkansen[26] + kijunsen[26])/2
SSpanB = (highest[52](high[26]) + lowest[52](low[26]))/2
//Chikou = close[26]
x = Kijunsen CROSSES OVER max(SSpanA,SSpanB)
SCREENER [x]
Explanation of the Code:
- Tenkansen Calculation: This line computes the Tenkan-sen (Conversion Line) by averaging the highest high and the lowest low over the last 9 periods.
- Kijunsen Calculation: Similar to Tenkansen, the Kijun-sen (Base Line) is calculated by averaging the highest high and the lowest low over the last 26 periods.
- Senkou Span A Calculation: Senkou Span A is computed by averaging the Tenkansen and Kijunsen, both shifted 26 periods into the future.
- Senkou Span B Calculation: Senkou Span B is calculated by averaging the highest high and the lowest low over the past 52 periods, then shifting this average 26 periods into the future.
- Crossover Detection: The variable x is used to detect when the Kijun-sen crosses over the maximum value between Senkou Span A and Senkou Span B. This is a significant event in trading as it might indicate a potential change in market direction.
- Screener Output: The screener function is used to filter and display symbols where the crossover condition x is true, indicating a potential trading opportunity.
This code snippet is a practical example of implementing complex technical analysis indicators in ProBuilder to identify trading signals based on the Ichimoku Kinko Hyo methodology.