- Angled Trendlines
- I dunno how to use Trendline by Angle
- Angle in degrees
Because angle or tan(x/y) must be unit-less. X/Y is. A chart has price and time. Like saying what is the angle of a car going 30 miles in 15 minutes. Meaningless. You can specify the slope pips/time but not an angle.
Hi Dear Sr. Programmers.
could you please help me. I am struggling to draw a Vline at a particular angle
example: if you assume the chart window screen from left corner to right corner is 360 degrees if i want to draw a Vline for every 30 degrees (or whatever i give in input selections), How i can i achieve this please?
the vlines are based on time and price i could not get it drawn on a particular area of the screen .
your help is highly appreciated.
Thanks,
Rao
-
Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.
- Loop through the bars, left most to right most, step n/(360/30)
Chart Price Max/Min - MQL4 programming forum
double read_angle(double price1,long time1,double price2,long time2) { double result=0; int x1=0,x2=0; int y1=0,y2=0; long chart = ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS,0); ChartTimePriceToXY(0,0,time1,price1,x1,y1); ChartTimePriceToXY(0,0,time2,price2,x2,y2); int size = (int)chart; y1=size-y1; y2=size-y2; double angle =NormalizeDouble((MathArctan(((double)y2-(double)y1)/((double)x2-(double)x1))*180)/M_PI,1); result=angle; return(result); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use