Download MetaTrader 5
To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
15930
10
15930 2016.11.28 14:19 

Hi; i am tinkering for building an indicator program where i try to simply  draw trendlines, every time with the same fixed angle, when and where, the indicator I made of bits of everywhere code recognizes various candlestick patterns; but i got creased only at this point and i have tryed to draw GannLines instead only to shockingly get Lines with ever distorted angles not random just the same for everyline, but amazingly I get a different number at the angle properties of the Lines i get drawn everytime. Can any Pro kindly enlighten me about it? Thank you very much in advance.

Dr. West 

Carl Schreiber
5939
Carl Schreiber 2016.11.28 14:41  
How do you define the x-axis for your angles? Number of bars or a defined timespan?
whroeder1
13605
whroeder1 2016.11.28 14:53  
Can't be done.
  1. There is no angle from 2 anchor points. An angle requires distance/distance a unitless number. A chart has price/time. What is the angle of going 30 miles in 45 minutes? Meaningless!
  2. You can get the slope from a trendline. Delta price/ delta time. Changing the axes scales changes the apparent angle, the slope is constant. Angle is meaningless.
  3. You can create a angled line using one point and setting the angle. The line is drawn that angle in pixels. Changing the axes scales does NOT change the angle.
15930
10
15930 2016.11.28 17:42  

           

Well, like this;

TrendByAngleCreate(id,PatternText[shift],0,Time[shift1],Close[shift1],TrendBy_Angle,clrLime,STYLE_SOLID,1,true,false,true,False,0);

             

            Basically using the code at the Objects section in the documentation book.what is surprising me is that the angle I input at the TrendBy_Angle parameter, is not, the angle that can be observed in the created lines angle parameter at the objects_list .

             

GannLineCreate(0,PatternText[shift3],0,Time[shift1],Close[shift1],Time[shift1],Gann_gLE,Gann_scale,clrLime,STYLE_SOLID,1,true,false,false,true,False,0); 

            Then tryed this other one; For having a previous known Angle I fixed chart at some scale but then; drew a Gann grid to have a known Gann scale,  measured the algle i drew with the _Grid with a trend line by angle also by hand; the two drawn by hand objects were continually stable by a real long way, but the lines got created with a really noticeable error from the very start, for two visibly close lines that must have had the same angle reality was the two lines crossed over the other one almost nothing more the start.

 

          

/
To add comments, please log in or register