Detection of the candlestick pattern 3 Black Crows and 3 White Soldiers. The indicator contains extra parameters for detecting any sequence of alternative numbers of crows/soldiers (e.g. 2, 3, 4, etc). Extra optional condition is inserted to take into account the minimum ratio between the body and the range of candle. (e.g. the bodies must be at least 70% of the total candle)
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 |
//Candlestick pattern x crows / x soldiers //With or without body length compared to the wicks //E.g. body must be at least 70% of total candle //Parameters NbrCandles = 3 Bodysize = 70 //in percentage BodySizeOnOff = 1 //standard 'On' //3 or x white soldiers for i=0 to NbrCandles-1 do CondSoldier = close[i] > open[i] and close[i] > close[i+1] If BodySizeOnOff then CondBodySizeSoldier = (((close[i] - open[i]) / (high[i]- low[i])) > (BodySize / 100)) if CondSoldier and CondBodySizeSoldier then else CondSoldier = 0 break endif elsif CondSoldier then else CondSoldier = 0 break endif next //3 or x black crows for i=0 to NbrCandles-1 do CondCrows = close[i] < open[i] and close[i] < close[i+1] If BodySizeOnOff then CondBodySizeCrows = (((open[i] - close[i]) / (high[i]- low[i])) > (BodySize / 100)) if CondCrows and CondBodySizeCrows then else CondCrows = 0 break endif elsif CondCrows then else CondCrows = 0 break endif next //Determining and drawing of indicator if CondSoldier = 1 then //3 or x White Soldiers CrowSoldier = 1 elsif CondCrows = 1 then //3 or x Black Crows CrowSoldier = -1 else CrowSoldier = 0 endif HorLine = 0 return CrowSoldier as "CrowSoldier", HorLine coloured (0,0,255) as "HorLine" |
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
copied it to pro real time not working. what to do?