nyanmt4:
I am using the following methods to get current time and price coordinate of a chart.
But I am always getting
time is 1970.01.01 00:00:00
price is 0.0
if its mt5 you need a modifier after the OBJPROP_TIME and OBJPROP_PRICE , like 1, 2 etc
ObjectGetInteger(0,"angle",OBJPROP_TIME,1);Also you can edit a post instead of re posting it :)
I am implementing this in OnTick().
void OnTick() { if(angleCounter == 0) { time1 = (datetime)ObjectGetInteger(0, "angle", OBJPROP_TIME,1); price1 = ObjectGetDouble(0, "angle", OBJPROP_PRICE,1); Print("time1"); Print(time1); Print(price1); } if(angleCounter >= 10){ time2 = (datetime)ObjectGetInteger(0, "angle", OBJPROP_TIME,2); price2 = ObjectGetDouble(0, "angle", OBJPROP_PRICE,2); //angle = GetAngle(); Print("time2"); Print(time2); Print(price2); angleCounter = -1; } angleCounter++; }
angle is double
anglecounter starts from 0 and get time1 and price1.
Once reach to 10, get one more time2 and price2. then reset anglecounter to 0.
No I am going to compute trend angle.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am using the following methods to get current time and price coordinate of a chart.
But I am always getting
time is 1970.01.01 00:00:00
price is 0.0