Vertical line with date

How can I draw a vertical line on a candle and plot the date of the line.
Regards

hi. @LOL111

i have the feeling that you must spend little bit of your free time here.

https://www.amibroker.com/guide/tutorial.html

And later on here https://www.amibroker.com/kb/

2 Likes

jajaja, I do it but afl is not easy compared to other languages ​​like prorealtime. This is more professional and for older people like me it is hard for us to adapt. regards

Hi @LOL111
Thats fine. In that case.... you can use this clasic code and tell us if it is ok for you?

Here if you click on the chart you can see also the date of the bar,

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));
Plot( C, "",  colorDefault ,styleCandle); 
_SECTION_END();

I appreciate the help. As you can see, tonight I got a code published on another website that has a calendar to put a vertical line on the day I want. But now it is the most difficult.
How can I have him paint me days in the future on the right side of the graph and also on the vertical line I paint the date I am selecting.
Thank you.

_SECTION_BEGIN("__add custom lines to pricechart");

STOPLOSS = 2.5;
PROFIT = 2.5;
EPT1= 1.0;
EPT1a= 1.5;
EPT2= 2.0;
EPT3= 3.0;
EPT4= 4.0;

EPT5= 5.0;
EPT6= 7.5;
EPT7= 10.0;

line = DateNum() == ParamDate("VUL IN V/D DAG NA SIGNAAL: DATUM", "24/02/2012", 0); //plot vertical line

Value = Param( "VUL IN V/D DAG NA SIGNAAL: OPEN", 327.52,200,600,0.01 );

LinesLONG  = ParamToggle("Toon lijnen positie LONG ","No|Yes",0);
LinesSHORT = ParamToggle("Toon lijnen positie SHORT ","No|Yes",1);

if (LinesLONG  )
Plot(Value ,"INGEVULD:",colorBlue ,styleLine | styleThick, Null, Null, 10) AND
Plot(Value +((Value /100)*PROFIT)," TARGET ",colorGreen,styleLine | styleThick, Null, Null, 10) AND
Plot(Value -((Value /100)*STOPLOSS)," STOP ",colorRed,styleLine | styleThick, Null, Null, 10) AND
Plot(Value +((Value /100)*EPT1)," 1.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT1a)," 1.5% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT2)," 2.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT3)," 3.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT4)," 4.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT5)," 5.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT6)," 7.5% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value +((Value /100)*EPT7)," 10.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(line, "", colorLightBlue, styleHistogram | styleOwnScale | styleNoLabel | styleThick);

if (LinesSHORT )
Plot(Value ,"INGEVULD:",colorBlue ,styleLine | styleThick, Null, Null, 10) AND
Plot(Value -((Value /100)*PROFIT)," TARGET ",colorGreen,styleLine | styleThick, Null, Null, 10) AND
Plot(Value +((Value /100)*STOPLOSS)," STOP ",colorRed,styleLine | styleThick , Null, Null, 10) AND
Plot(Value -((Value /100)*EPT1)," 1.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT1a)," 1.5% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT2)," 2.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT3)," 3.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT4)," 4.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT5)," 5.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT6)," 7.5% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(Value -((Value /100)*EPT7)," 10.0% ",colorBlack,styleLine|styleDashed, Null, Null, 10 ) AND
Plot(line, "", colorLightBlue, styleHistogram | styleOwnScale | styleNoLabel | styleThick);
_SECTION_END();

1 Like