My requirement is to draw a trendline/line by giving x & y coordinates as input. following code creates a line but its y & x coordinates are totally misplaced. in a 5 min tf chart to draw a line left extended from pts -
30 nov 2017 9:20 am , 10314.2 to point 01 Jan 2018 9:15 am , 10533.3.
for x, i did some conversion as per formula given in AFL help but issue is line is not taking these coordinates. Pl help.
==============CODE====================
x0= 1171130092000;
//11/30/2017 9:20:00 AM
//Date conversion by formula - 10000 * (year - 1900) + 100 * month + day
@Gloriafilamino , Thanks for the replied thread. Though there was no ready made answer in it but after lot of trial and error I was able to resolve my own query. And here is the code-
//x coordinate is actuall a bar number , just count bar number from left to right and deduct 1 to get desired line //from x coordinate. y is off course price.