Skip to main content

price line code for Amibroker (AFL)

jaipal7786 over 12 years ago Amibroker (AFL)

  • Rating:
    5 / 5 (Votes 1)
  • Tags:
    amibroker

cmp and pclmp price line code
it not a indicator it is code only and paste in any afl..

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Price Line");
dp= Param("dps",3,0,1000,1);
PriceLineColor=ParamColor("PriceLineColor",ColorRGB(82,82,82));
PriceLevel = ParamField("PriceField", field = 3 ); 
PriceLeve2 = ParamField("PriceField", field = dp );
Daysback    = Param("Bars Back",1,10,500,1); 
FirstBar    = BarCount - DaysBack; 
YY          = IIf(BarIndex() >= Firstbar,EndValue(PriceLevel),Null); 

Plot(YY,"Current Price",PriceLineColor,ParamStyle("LineStyle",styleLine|styleDashed|styleNoTitle|styleNoLabel|styleThick,maskAll)); 

PC=TimeFrameGetPrice( "C", inDaily, -1 ); 
Plot(pc,"Current Price",PriceLineColor,ParamStyle("LineStyle",styleLine|styleDashed|styleNoTitle|styleNoLabel|styleThick,maskAll)); 

side = Param("side",1,0,1000,1);

dist = 0; 

for( i = 0; i < BarCount; i++ ) 
{ 
 if(i+side== BarCount) PlotText( "\n    " + PriceLevel[ i ], i, YY[ i ]-dist[i], colorLightBlue );
if(i+side== BarCount) PlotText( "\n    " + Pc[ i ], i, pc[ i ]-dist[i], colorLightBlue ); 
} 

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.