An angle has nothing to do with price/time #2; if you understood that "Angles are pointless" you would know that. You call the GetAngle but you never set one Angle(double). An angle is one price + the angle.
An angle has nothing to do with price/time #2; if you understood that "Angles are pointless" you would know that. You call the GetAngle but you never set one Angle(double). An angle is one price + the angle.
What is your problem? You couldn't just answer the question? You HAD to add that comment?
Then why does MQL4 REQUIRE a second date and time price when creating the object (from the Metaedit help file: ObjectCreate(chart_ID,name,OBJ_TRENDBYANGLE,sub_window,time,price,time2,price2)? And what's the point of reading the angle of the object if all you do is just set it? Or is this just another MetaQuotes f-up?
What is your problem? You couldn't just answer the question? You HAD to add that comment?
Then why does MQL4 REQUIRE a second date and time price when creating the object (from the Metaedit help file: ObjectCreate(chart_ID,name,OBJ_TRENDBYANGLE,sub_window,time,price,time2,price2)? And what's the point of reading the angle of the object if all you do is just set it? Or is this just another MetaQuotes f-up?
Solved it
void BuildAngle() { double Price1=NormalizeDouble(iMA(NULL,0,5,0,MODE_SMA,PRICE_CLOSE,1),_Digits); double Price2=NormalizeDouble(iMA(NULL,0,5,0,MODE_SMA,PRICE_CLOSE,5),_Digits); myAngle.Delete(); myAngle.Create(0,"myAngle",0,Time[5],Price2,Time[1],Price1); myAngle.Hidden(false); ObjectSet("myAngle",OBJPROP_TIME2,Time[1]); ObjectSet("myAngle",OBJPROP_PRICE2,Price1); //ChartRedraw(); double GetAngle=myAngle.Angle(); string IBWritin=StringConcatenate(GetAngle,",",Price1,",",Price2,",","\r\n"); nFile.WriteString(IBWritin); }
What is your problem? You couldn't just answer the question? You HAD to add that comment?
Then why does MQL4 REQUIRE a second date and time price when creating the object
And what's the point of reading the angle of the object if all you do is just set it? Or is this just another MetaQuotes f-up?
- I did answer it. I had to add that comment because you said you understood but apparently don't.
- MQL4 does NOT require the second point when creating the object. The help file and ObjectCreate - MQL4 Documentation clearly shows the second and subsequent ones have default. OBJ_TRENDBYANGLE - MQL4 Documentation also clearly shows TrendByAngleCreate contains one price/time and one angle.
- Reading values from objects is done all the time so you don't have to remember a second copy.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Put this on chart. No matter how far apart the 2 prices are, it ALWAYS draws a flat trend line. Why?