/  Forum 

MQL4 Language for Newbies. Technical Indicators and BuiltIn Functions This is the third article from the series "MQL4 Language for Newbies". Now we will learn to use builtin functions and functions for working with technical indicators. The latter ones will be essential in the future development of your own Expert Advisors and indicators. Besides we will see on a simple example, how we can trace trading signals for entering the market, for you to understand, how to use indicators correctly. And at the end of the article you will learn something new and interesting about the language itself. 

Certainly. Angle and slope are synonymous. Draw a line with a slope of 0.618 for example: int start(){ string name = "a"; double theSlope= 0.618; int startBar = 39; int runBars = 7; double price = Close[startBar]; double angle; if(ObjectFind(name) != 1) ObjectDelete(name); ObjectCreate(name, OBJ_TREND, 0, Time[startBar], price, Time[startBarrunBars], price + (runBars * theSlope * Point)); angle = MathArctan(theSlope)/ 3.1415965 * 180; Comment("The angle of line "+name+" is "+DoubleToStr(angle, 2)+" degrees"); return(0); } By rearranging things a bit, you can find the angle of an arbitrary line, or draw a line at an arbitrary angle. The angle will be "visually" correct only on a squared chart (in chart properties scale fix 1:1). 



Trendline by angle is usable on a squared chart only. It is a "visual" angle tied to the monitor, not the chart. A 45 degree Trendline by Angle is a visual 45 degree line on your display. zoom
in zoom out or squeeze the Therefore, it has no relation to time or price, unless you happen to know the ratio
of pips to time you have on The only "known" setup is 1:1, and that is useless for higher timeframes. For trading purposes, an angle needs to be defined in terms of price and time, thus
sticking it to the chart. In 

phy wrote:
Certainly. Angle and slope are synonymous. Draw a line with a slope of 0.618 for example: int start(){ string name = "a"; double theSlope= 0.618; int startBar = 39; int runBars = 7; double price = Close[startBar]; double angle; if(ObjectFind(name) != 1) ObjectDelete(name); ObjectCreate(name, OBJ_TREND, 0, Time[startBar], price, Time[startBarrunBars], price + (runBars * theSlope * Point)); angle = MathArctan(theSlope)/ 3.1415965 * 180; Comment("The angle of line "+name+" is "+DoubleToStr(angle, 2)+" degrees"); return(0); } By rearranging things a bit, you can find the angle of an arbitrary line, or draw a line at an arbitrary angle. The angle will be "visually" correct only on a squared chart (in chart properties scale fix 1:1). Hi Howdo you get the slope of the line. It says here 0.618 but how do you get that slope off OBJ_TREND? 

Consult Geometry 101 




Hi Eveyone
I would like to know if anyone knows how to code an angled trendline.
I am wanting to draw an angled trendline from point a to point b then point c etc,
After I have coded the angled trendlines then I would like to store the angles from each trendline and put them in an array for later us.
If anyone has any pointers that would be great
thanks
dd