How to move a line created by LineArray?

Tags: #<Tag:0x00007f804a3693c8>


Using AFL LineArray, a line can be drawn in charts. But that line created can not be moved. To elaborate, line/trendline created by manually line/Ray tool in Amibroker, can be selected and can be moved from one point to another, I am expecting same for line created using AFL LineArray function. How to move that line?



Since the AFL LineArray is CODE based, and the manually drawn lines are User Inferface based, they are different entities. The UI does have the facility to be handled and manipulated by the UI. Code is Code. If you "hardcode" the coordinates, they will not change, and are not accessible from the UI.

Since the Code has to produce the same thing every time it runs, it will not change.


Thank you for the reply.


You can do something like this

Fwd = Param("Plot Forward", 0, 0, 500, 1);
Plot(Line ,"prehigh",ParamColor( "colorprehigh", colorRed) ,ParamStyle("styleprehigh",styleDots|styleNoRescale,maskAll  ),Null, Null,Fwd);


Thanks for the reply.
with the code below where I get line created with 2 code lines which you gave above but I can not select the drawn line and move it, where I am missing please?-

highOfDay = TimeFrameGetPrice( "H", inDaily );
lowOfDay = TimeFrameGetPrice( "L", inDaily );

x0=91; // x denotes bar number

Line = LineArray( x0, y0, x1, y1, 2 );

Fwd = Param("Plot Forward", 0, 0, 500, 1);

Plot(Line ,"prehigh",ParamColor( "colorprehigh", colorRed) ,ParamStyle("styleprehigh",styleDots|styleNoRescale,maskAll ),Null, Null,Fwd);


This code is not ploting any line
plz check code



with same code, i cane get a dark thick red line as attached in image. In the code x denotes bar number , may be your 5 min tf csv/file doesnt have those many number of bars , you can adjust x & y as per your chart file csv/xsl etc. I actually wanted to attach my 5 min tf csv file but Amibroker forum only accepts afl, jpg etc hence couldnt.


above reply for you.


since line array will take co ordinates i.e barcount
so you try to get correct barcount
This can be done by using for loop
inside another for loop
first get date values
then based on that date values calculate high and low while calculating
high low values store barcount values in a variable and
that variable u need to pass in line array function.I Guess This will Help


Initially I wanted to go for date & time as x-coordinate itself but wasnt able to convert date , time like 10-mar-2018 9:20 am into readable format for Amibroker .What is readable format for it? As a remedy I shifted to barcount.



you can use Datenum() and Timenum() functions.


@sandeep.sd9, Thanks for input, I ll try it out.