Disliked{quote} Thanks for your help. However, It seem like the calculation start from the 3rd bar of new signal because it is based on previous 1 and 2 bars. It is supposed to get the complete high low price at the 1st bar of new signal. Any suggestions? Appreciate.Ignored
You will need to know when blue turns white and white turns blue, thats what the snippet of code will tell you. I would suggest using the snippet in an EA to understand how it works. Have it plot a Vertical Line at the point it gives a signal to buy and also at the signal to sell.
Once you can do that then you are ready to put the snippet in your indicator where you will need a while or for loop. In the indicator you will need to put the loop index var in to the iCustom call index where 1 and 2 are now. Then keep track of what the values of the Close are on one end of where your rectangles vs the other end. This will tell you if the trend is up or down.
I could do it for but then what would you learn.