I need help with this code


Hello everybody

can anybody discover what is the error in this code please ?

i want to creat un indicator which help to give the angle between 2 last closed candlestick on the daily frame

here is the code


Improperly formatted code removed by moderator. Please EDIT your post and use the CODE button (Alt-S) when inserting code.

Code button in editor

Hover your mouse over your post and select "edit" ... 


Please edit your code and post it as code by Alt+S or
Yasar Akil: to give the angle between
  1. Post your code properly if you want help.

  2. Can't be done.
    1. There is no angle from 2 anchor points. An angle requires distance divided by distance; a unit-less number. A chart has price and time. What is the angle of going 30 miles in 45 minutes? Meaningless!

    2. You can get the slope from a trendline: m=ΔPrice÷ΔTime or m=ΔPrice÷Δ(bar index). Changing the price scale, bar width, or window size, changes the apparent angle, the slope is constant. Angle is meaningless.

    3. You can create an angled line using one point and setting the angle (Object Properties - Objects Constants - Standard Constants, Enumerations and Structures - MQL4 Reference.) The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle (and thus is meaningless.)

    4. If you insist, take the two price/time coordinates, convert them to pixel coordinates and then to apparent angle with arctan.
                How to get the angle of a trendline and place a text object to it? - Trend Indicators - MQL4 programming forum - Page 2