Hey guys, I am making an EA but I want to include an indicator that will detect a trendline and use it to determine if a trade should be opened. My problem is how I can construct an indicator that will figure what I did with this chart:
How could I have the indicator determine what I just did with only the numbers that I get from the close or open arrays? What would the math be behind this?
Thank you very much.
It's going to be tricky to program the way the human eye draws trendlines, but one technique that might help you is the following. Identify the price extremes (separating highs and lows) and draw a linear regression line across them. Example:
You can also try this for a support trendline: (this is what I did)
Thank you very much guys. I really appreciate your response.
which indicator most using in trading system