Question regarding trendline in EA

 

Hi all,

 I read somewhere we can draw trendline in indicator but the information is still very vague for me

 Need help to clarify a few things

 

1. I assume it is true you can draw trendline with mql4. do we use obj_trend for this?

2.  is it possible to write an EA whereby once the trendline is drawn, the line is extended so that when price crosses that trendline in the future, it triggers an entry? if yes, where can i find information regarding this?

 

Thanks 

 
bobo1974:

Hi all,

 I read somewhere we can draw trendline in indicator but the information is still very vague for me

 Need help to clarify a few things

 

1. I assume it is true you can draw trendline with mql4. do we use obj_trend for this?

2.  is it possible to write an EA whereby once the trendline is drawn, the line is extended so that when price crosses that trendline in the future, it triggers an entry? if yes, where can i find information regarding this?

 

Thanks 

Yes use
OBJPROP_RAY

And

OBJPROP_RAY_RIGHT

https://www.mql5.com/en/docs/constants/objectconstants/enum_object

https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property#enum_object_property_integer

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Properties - Reference on algorithmic/automated trading language for MetaTrader 5