Price Cross Trendline Problem

 

Hey,

Please look at the following chart:

 

When the market breaks the trendline, the expert should enter.  How can this be done?  Using a linier equation model cannot work because there is no x axis!  How do I program in code if the price is above the line it should enter the trade?

Any help would be appreciated!

Thanks 

 
Documentation on MQL5: Object Functions / ObjectGetTimeByValue
  • www.mql5.com
Object Functions / ObjectGetTimeByValue - Documentation on MQL5
 

Does ObjectGetValueByTime has an equivalent in OO in class CChartObjectTrend? 

All I can find there is getting the price of the anchor points, not the price at every other time on the line.

 
amir_avatar:

Does ObjectGetValueByTime has an equivalent in OO in class CChartObjectTrend? 

All I can find there is getting the price of the anchor points, not the price at every other time on the line.

I suspect not, but you can still use :

CChartObjectTrend obj;
datetime dt;

dt = ObjectGetTimeByValue(obj.ChartId, obj.Name, value, line);
And maybe fill a request to Service Desk about this.
 
TrendLine Touch Alert
  • votes: 12
  • 2013.02.11
  • Ahmed Soliman | English Russian Spanish Portuguese
  • www.mql5.com
This indicator simply alerts and sends email every time the trend line touched by the price.
Reason: