Hi,
I want to read Trend line value (price)
Below Trend line Name has some time value(time stamp).
But I want to ignore the time stamp and just want to read the 2nd value.
How can I read the Object price2?
Use ObjectGetDouble to read the anchor points
https://docs.mql4.com/objects/objectgetdouble
- docs.mql4.com
Hi,
I want to read Trend line value (price)
Below Trend line Name has some time value(time stamp).
But I want to ignore the time stamp and just want to read the 2nd value.
How can I read the Object price2?
@ Cromo
void OnReadObj() { //--- int total; string obj_name; double obj_PriceStart=0; double obj_PriceEnd=0; total=ObjectsTotal(); for(int i=0;i<total;i++) { obj_name=ObjectName(i); if(ObjectType( obj_name)==OBJ_TREND) { obj_PriceStart=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE1),Digits); obj_PriceEnd=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE2),Digits); Print("Obj Name ",obj_name," Start Price=",obj_PriceStart," End Price=",obj_PriceEnd); } } }
Use ObjectGetDouble to read the anchor points
https://docs.mql4.com/objects/objectgetdouble
double price = ObjectSetDouble(ChartID(), "LINE12-***", OBJPROP_PRICE, 0);
Can I use **** after LINE12- ?
Can I use **** after LINE12- ?
oid OnReadObj() { //--- int total; string obj_name; double obj_PriceStart=0; double obj_PriceEnd=0; string SearchStringName="LINE12-"; total=ObjectsTotal(); for(int i=0;i<total;i++) { obj_name=ObjectName(i); if(ObjectType( obj_name)==OBJ_TREND && (StringFind(obj_name,SearchStringName,0)!=-1)) { obj_PriceStart=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE1),Digits); obj_PriceEnd=NormalizeDouble(ObjectGet(obj_name, OBJPROP_PRICE2),Digits); Print("Obj Name ",obj_name," Start Price=",obj_PriceStart," End Price=",obj_PriceEnd); } } }
Bastem
Thank you very much.
I will try this.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I want to read Trend line value (price)
Below Trend line Name has some time value(time stamp).
But I want to ignore the time stamp and just want to read the 2nd value.
How can I read the Object price2?