Here’s an ‘Smart Money Indicator’.
This maps zones where the price made a rapid unidirectional move without retracing, it exposes untested areas.
Based on the ‘Smart Money’ concept, the indicator helps track these ‘fair value gaps’, allowing traders to anticipate retracements and trend continuations.
Works well in Forex and Commodities markets.
Next step is to make a multi timeframe. Discussions here – //https://www.prorealcode.com/topic/smart-money-indicator-using-arrays/
//Smart Money| indicator
//Monochrome @ www.prorealcode.com
//https://www.prorealcode.com/topic/smart-money-indicator-using-arrays/
DEFPARAM DrawOnLastBarOnly = true
DEFPARAM CalculateOnLastBars = 2000
ONCE GapsIndex = 0
// Identify and store high gaps
IF High > Max(High[1], High[2]) THEN
$HighGapsTop[GapsIndex] = High
$HighGapsBottom[GapsIndex] = Max(High[1], High[2])
$GapStartHigh[GapsIndex] = BarIndex
$HighGapStatus[GapsIndex] = 0
$GapEndHigh[GapsIndex] = barindex
$GapFilledHigh[GapsIndex] = 0
GapsIndex = GapsIndex + 1
ENDIF
// Identify and store low gaps
IF Low < Min(Low[1], Low[2]) THEN
$LowGapsTop[GapsIndex] = Min(Low[1], Low[2])
$LowGapsBottom[GapsIndex] = Low
$GapStartLow[GapsIndex] = BarIndex
$LowGapStatus[GapsIndex] = 0
$GapEndLow[GapsIndex] = barindex
$GapFilledLow[GapsIndex] = 0
GapsIndex = GapsIndex + 1
ENDIF
// GAP status
// 0 for not filled
// 1 for filled upwards (High crosses over $HighGapsTop[i] and Low < $HighGapsBottom[i])
// 2 for filled downwards (Low crosses under $HighGapsBottom[i] and High > $HighGapsTop[i])
// 3 for partially filled upwards (High > $HighGapsBottom[i] and High < $HighGapsTop[i])
// 4 for partially filled downwards (Low > $HighGapsBottom[i] and Low < $HighGapsTop[i])
// 5 for filled upwards (Low crosses under $LowGapsBottom[i] and High > $LowGapsTop[i])
// 6 for filled downwards (High crosses over $LowGapsTop[i] and Low < $LowGapsBottom[i])
// 7 for partially filled upwards (Low > $LowGapsBottom[i] and Low < $LowGapsTop[i])
// 8 for partially filled downwards (High > $LowGapsBottom[i] and High < $LowGapsTop[i])
// Loop over all identified gaps and draw rectangles if they have not been filled
FOR i = 1 TO GapsIndex-1 DO
// High gaps
IF High > $HighGapsTop[i] AND Low < $HighGapsBottom[i] AND $GapFilledHigh[i] = 0 THEN // Gap Status 1
$GapFilledHigh[i] = 1
$HighGapStatus[i] = 1
$GapEndHigh[i] = BarIndex
ELSIF Low < $HighGapsBottom[i] AND High > $HighGapsTop[i] AND $GapFilledHigh[i] = 0 THEN // Gap Status 2
$GapFilledHigh[i] = 1
$HighGapStatus[i] = 2
$GapEndHigh[i] = BarIndex
ELSIF High > $HighGapsBottom[i] AND High < $HighGapsTop[i] AND $GapFilledHigh[i] = 0 THEN // Gap Status 3
$HighGapsBottom[i] = high
$HighGapStatus[i] = 3
ELSIF Low > $HighGapsBottom[i] AND Low < $HighGapsTop[i] AND $GapFilledHigh[i] = 0 THEN // Gap Status 4
$HighGapsTop[i] = low
$HighGapStatus[i] = 4
ENDIF
IF $HighGapStatus[i] <> 0 AND $GapFilledHigh[i] = 1 THEN
DRAWRECTANGLE($GapStartHigh[i], $HighGapsTop[i], $GapEndHigh[i], $HighGapsBottom[i]) coloured("red", 20) bordercolor("black", 20)
ELSIF $HighGapStatus[i] <> 0 AND $GapFilledHigh[i] = 0 THEN
DRAWRECTANGLE($GapStartHigh[i], $HighGapsTop[i], barindex, $HighGapsBottom[i]) coloured("red", 20) bordercolor("black", 20)
ENDIF
// Low gaps
IF Low < $LowGapsBottom[i] AND High > $LowGapsTop[i] AND $GapFilledLow[i] = 0 THEN // Gap Status 5
$LowGapStatus[i] = 5
$GapEndLow[i] = BarIndex
$GapFilledLow[i] = 1
ELSIF High > $LowGapsTop[i] AND Low < $LowGapsBottom[i] AND $GapFilledLow[i] = 0 THEN // Gap Status 6
$LowGapStatus[i] = 6
$GapEndLow[i] = BarIndex
$GapFilledLow[i] = 1
ELSIF Low > $LowGapsBottom[i] AND Low < $LowGapsTop[i] AND $GapFilledLow[i] = 0 THEN // Gap Status 7
$LowGapsTop[i] = low
$LowGapStatus[i] = 7
ELSIF High > $LowGapsBottom[i] AND High < $LowGapsTop[i] AND $GapFilledLow[i] = 0 THEN // Gap Status 8
$LowGapsBottom[i] = high
$LowGapStatus[i] = 8
ENDIF
IF $LowGapStatus[i] <> 0 AND $GapFilledLow[i] = 1 THEN
DRAWRECTANGLE($GapStartLow[i], $LowGapsTop[i], $GapEndLow[i], $LowGapsBottom[i]) coloured("blue", 20) bordercolor("black", 20)
ELSIF $LowGapStatus[i] <> 0 AND $GapFilledLow[i] = 0 THEN
DRAWRECTANGLE($GapStartLow[i], $LowGapsTop[i], barindex, $LowGapsBottom[i]) coloured("blue", 20) bordercolor("black", 20)
ENDIF
NEXT
RETURN
You must be logged in to post a comment.
Hello, thank you for your indicator, it indicates well the gaps area, I am happy with it as I don't need more than that, I just one comment, it indicates to me always this error message : To reduce the calculation time, you can reduce the history displayed in this chart or use the instruction "DEFPARAM CalculateOnLastBars". Also try to avoid using the "CALL" instruction. SmartMoneyIndic(FairValueGap) is it something that can be solved ? Thanks for sharing in any case, Gabriel
My gratitude to Monochrome for sharing the "Smartmoneyindicfaivaluegap.itf" indicator is a significant act of generosity. Thank you... thank you... thank you. It would be possible to obtain a guide on how it works, especially regarding its configuration and some practical advice. I would like to take this opportunity to request some expert advice in PDF format on the theory of smart money (Smart Money Concepts), in order to expand my knowledge; it should not be free. (Translation done using Google Translate)