I want to highlight Morning Star Patterns in my chart by changing the background behind the Morning Star Pattern to green. However, with the BACKGROUNDCOLOUR(r,g,b,<o>) command, I can only highlight the most recent candle’s background of the pattern that satisfies my conditions.
What I want to do is to highlight also the 2 previous candles that belong to the pattern in the same colour.
Do you have a solution for this problem.
My Code so far: (I have attached a screenshort of the result of my code):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
REM MORNING STAR & MORNING DOJI STAR
MorningS1=OPEN[2]>CLOSE[2]REM C0 is black
MorningS2=OPEN<CLOSEREM C2 is white
MorningS3=CLOSE>CLOSE[2]REM close of C2 above close of C0
MorningS4=(CLOSE-CLOSE[2])>=((OPEN[2]-CLOSE[2])/2)REM C2 penetrates more than halfway into C0's real body
MorningS5=CLOSE[1]<=(((OPEN[2]-CLOSE[2])/5)+CLOSE[2])REM C2 is not above 1/5 of the lower end of C0's real body
MorningS7=OPEN[1]=CLOSE[1]REM C1 is doji
MorningS8=(OPEN[2]-CLOSE[2])>Average[20](RANGE[2])*0.5REM black candle has significant real body
PS: If your solution involves arrays, I would be very thankful if you could provide some sample code, because I am not yet the most comfortable with implementing arrays.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue