Creating code using angel

 

Hi there,

Hi friend, can anyone help make code with the following rules: Buy if the angle formed between the MA 50 indicator with a horizontal direction is greater or equal to 30 degrees or Sell if the angle formed between the MA 50 indicator with a horizontal direction is less than or equal to 330 degrees. I want to EA trade in this condition (the market is trending), or I avoid opening a position when the market is sideways. Attached picture!
Files:
CT-forex-1.PNG  126 kb
 
JONI Spd :

Hi there,

Hi friend, can anyone help make code with the following rules: Buy if the angle formed between the MA 50 indicator with a horizontal direction is greater or equal to 30 degrees or Sell if the angle formed between the MA 50 indicator with a horizontal direction is less than or equal to 330 degrees. I want to EA trade in this condition (the market is trending), or I avoid opening a position when the market is sideways. Attached picture !

The concept of "corner" in Forex is a visual deception. It is easy to check: change the scale of the chart or change the size of the chart :)


 
Can you help, how to make a function in the Meta editor a comparison between (current closing price-expect close 5 bars ago) / 5
 
  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. 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

  5. The word is angle not angel.