How to draw vertical line

howto
Tags: #<Tag:0x00007f2d7a52ea00>

#1

how to draw a vertical line . for example i want to draw vertical line after 10 trading days from 1-jan -2017 .
please guide


#2

@adimehta One partial solution already posted on this forum,

///@link http://forum.amibroker.com/t/how-to-draw-or-plot-vertical-line-grid-x-to-right-of-specified-bar-example-highest-bar/600/2

// vertical line at all time high
AllTimeHigh = High == LastValue( Highest( High ) );

Plot( C, "Price", colorDefault, styleCandle );
Plot( AllTimeHigh, "", colorBlue, styleHistogram | styleOwnScale, 0, 1 );

Another possible method to get you started,

// Vertical Line 2

bars = Param( "Bars since last day ", 10, 0, 50, 1 );

// Define Vertical line

Line1 = Cum( 1 ) == LastValue( Cum( 1 ) ) - bars;

Plot( C, "close", colorAqua, styleCandle );
Plot( Line1, "Line is ( " + WriteVal( bars, 1 ) + " ) bars back", colorLightBlue, styleHistogram | styleThick | styleOwnScale );

That produces a chart like this with a Parameter that can allow you to choose the number of bars back from last bar.
image


#3

@adimehta Why not use the forum search option first? You can find some ready to use examples here: How do I plot a vertical line on an intraday chart at the open?