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/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
//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 |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
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
super Ivan, excellent.Muchas Gracias.