I found this in the forum made some changes on the code, but it could written in Chinese
		
			
			
			
			
				
					
				
					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
 
						//Heikin-Ashi 
xClose  =   (Open + High + Low + Close )/ 4 
if (barindex > 2 )  then 
xOpen  =   (xOpen[ 30 ]   +   xClose[ 30 ] )/ 2 
endif 
changeToGreencandle  =   xClose[ 30 ] > xOpen[ 30 ]   AND   xClose[ 30 ] < xOpen[ 30 ] 
ChangeToRedcandle  =   xClose[ 30 ] < xOpen[ 30 ]   AND   xClose[ 30 ] > xOpen[ 30 ] 
Greencandle= xclose> xopen
redcandle= xclose< xopen
If   changeToGreencandle  then 
Indicator1= 1 
elsif   greencandle  then 
indicator1= 0.5 
Else 
Indicator1= 0 
Endif 
 
If   ChangeToRedcandle  then 
 
Indicator22= - 1 
elsif   redcandle  then 
indicator22= - 0.5 
Else 
Indicator22= 0 
Endif 
Return   indicator1  COLOURED (0 ,255 ,0 )  as   "Buy" ,  indicator22  COLOURED (255 ,0 ,0 )  as   "Sell"