For searching the good time to place order, I'd like to find the range bound period. In my opinion, it should be a good market after the range bound. Then I wrote the indicator named RangeBoundMA. It based on the different prices among the 3 SMA lines that the periods are 38, 140 and 210. You can attach it to your chart with a horizontal line as 25. Then you'll see once the indicator under the 25 line in some period, the prices are in the range bound. When the price breaks the highest or lowest price during the range bound, it is the just time to place order.
However, when I wrote the code into an Expert Advisor, it is always false that I can't get the reason because I am still new to Expert Advisor mql4 code. Would someone please help me to check the code? What wrong is it? Will greatly appreciated if reply.
The indicator specifies on trend and lateral movements of the price.GruchaAverage Trend Line
The moving average that divides the prices for classes. The classes with extreme price get bigger weight (importance)