Draw trendline in code
- Middle Mouse button - Now unrecognised
- #define's for known commands that can be used for PostMessageA()
- Chart event when mouse button is pressed
i wrote a simple trend line program but it needs that u give two lows/highs prices and times on it. it dont draw line for u but it returns price of trend line up/down of index price
maybe it can help u, this is for h1 candles,
input float fx = 1; // FIRST HIGH/LOW PRICE input float gx = 1; // SECOUND HIGH/LOW PRICE input datetime x1 = D'2021.4.1 12:00' ;// FIRST DATE TIME WITH THIS FORMAT input datetime x2 = D'2021.4.1 12:01' ;// SECOUND DATE TIME WITH THIS FORMAT double price =NormalizeDouble(((gx-fx)/(Bars(Symbol(),PERIOD_H1,x1,x2)) * (1+Bars(Symbol(),PERIOD_H1,x1,TimeCurrent())))+ fx,Digits);
i wrote a simple trend line program but it needs that u give two lows/highs prices and times on it. it dont draw line for u but it returns price of trend line up/down of index price
maybe it can help u, this is for h1 candles,
Thanks!
but I was looking for something more like this
https://www.mql5.com/en/forum/159058
- 2016.05.06
- www.mql5.com