one to one coaching

(Req) How to open afl files?

cherpu

Member
i hv got K-9 Master Trader v6.1 | Super Discounted Payment Link | Lifetime Validity.but all are afl?.i cant open ?

//SetChartOptions(0,chartShowArrows|chartShowDates);
//_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


_SECTION_BEGIN("Volume At Price");
PlotVAPOverlay(Param("Lines", 1000, 100, 1000, 10), Param("Width", 0, 0, 100, 1), ParamColor("Color", colorBlue));

_SECTION_END();
_SECTION_BEGIN("BACK COLR");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),

ParamColor("BgBottom", colorBlack),ParamColor("titleblock",colorPlum));

//WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","");
//WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","");
//WriteIf( sss ,"No trading signals today.","") ;



SetBarsRequired(600,0);

GraphXSpace = 20;
SetChartOptions( 0, chartShowArrows | chartShowDates );
 
Last edited:

cherpu

Member
//============== TITLE ==============

_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",30,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorGold) );
Hor=Param("Horizontal Position",970,1,1200,1);
Ver=Param("Vertical Position",50,1,830,1);
GfxTextOut(""+C, Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Times New Roman", 11, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorBlack) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor , Ver+45 );

_SECTION_END();


BuyPrice = Open;
SellPrice = Open;

Derived=WMA(WMA(WMA(((H+L)/2)+(O-C),92),1),1);
i=WMA(Derived,3);
Upper=Ref((Derived+StDev(Derived,7))+ATR(2)/0.8,0);
Lower=Ref((Derived-StDev(Derived,7))-ATR(2)/1.5,0);


//Plot(Upper,"upper band",colorRed);
//Plot(Lower,"lower band",colorLime);
//Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

/* Buy or Sell Condition */
Buy = Ref(Cross(C,Lower),0);
Sell = Cross(upper,C);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
//Cover=Buy;
//Short=Sell;
 

cherpu

Member
/Buy = Buy;
//Sell = Sell;
//Cover = Cross(C,UPPER);
//Short = Ref(Cross(LowER,C),0);
//Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
//Buy = ExRem(Buy,Sell);
//Sell = ExRem(Sell,Buy);
//Short = ExRem(Short, Cover);
//Cover = ExRem(Cover, Short);
/*
*/

dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
// PlotText( "\nBuy @" + C[ i ] + "\nTGT=> " + (C*1.0050) +"\nSL=> " + (C*0.9975), i, L[ i ]-dist, colorBrightGreen, colorBlack );
}
if( Sell )
{
//PlotText( "\nSell @" + C[ i ] + "\nTGT=> " + (C*0.9950) + "\nSL=> " + (C*1.0050), i, H[ i ]+dist1, colorOrange, colorBlack );
}
}




for( i = 0; i < BarCount; i++ ){
if (Buy == 1) {
entry = H;
sig = "BUY";
sl = (O*0.9970);
tar1 = entry + (entry * .0047);
tar2 = entry + (entry * .0090);
tar3 = entry + (entry * .0179);
bars = i;
}
if (Sell) {
sig = "SELL";
entry = L;
sl = (O*1.0055);

tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0100);
tar3 = entry - (entry * .0170);
bars = i;

}
}

Offset = 20;
Clr = IIf(sig == "BUY", colorDarkGreen, colorRed);
ssl = IIf(bars == BarCount-1, sl[BarCount-1],sl);
sl = ssl[BarCount-1];
/*Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), "", Clr, styleLine|styleDots, Null, Null, Offset);
Plot(LineArray(bars-Offset, sl, BarCount, sl,1), "", colorDarkRed, styleLine|styleLine, Null, Null, Offset);
Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorGreen, styleLine|styleLine, Null, Null, Offset);
*/
 

cherpu

Member
//PlotShapes(IIf(H>=tar1, shapeDigit1,shapeNone) ,colorOrange,0, H, Offset=-20) ;
Prd1=4;//Param("ATR Period 1-20",4,1,20,1);
Prd2=12;//Param("LookBack Period 1-20",11,1,20,1);
Green=HHV(LLV(L,Prd1)+ATR(Prd1),Prd2);

//{Red} {Stop loss when Close<Red}
//RED=LLV(HHV(H,Prd1)-ATR(Prd1),Prd2);
RED = LLV(HHV(H,PRD2),PRD2);
Color=IIf(C>Green ,colorBrightGreen,IIf(C < RED,colorRed,colorBlue));


//Plot(Green,"Green",colorBrightGreen,styleLine);

//Plot(RED,"Red",ParamColor("RED",colorGold),styleLine);
//Plot(C,"",Color,64);

///////////////////////////////////////////////////////////////////





{
GfxSelectFont( "Tahoma", 13, 100 );
GfxSetBkMode( 1 );
GfxSetTextColor( colorGold );

if (sig =="BUY"){
GfxSelectSolidBrush( colorDarkGreen ); // this is the box background color
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 420;


y = Status( "pxchartheight" );
y=200;

GfxSelectPen( colorGold, 2);
//GfxRoundRect( x, y - 130, x2, y+150 , 7, 7 ) ;
GfxTextOut(" ",10,275);
GfxTextOut(" ",10,300);
GfxTextOut(" ",10,250);
}
else
{
GfxSelectSolidBrush( colorDarkRed ); // this is the box background color
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 420;


y = Status( "pxchartheight" );
y=200;

GfxSelectPen( colorGold, 2);
//GfxRoundRect( x, y - 130, x2, y+150 , 7, 7 ) ;
GfxTextOut("",10,275);
GfxTextOut(" ",10,300);
GfxTextOut(" ",10,250);}
//GfxSelectSolidBrush( colorDarkRed );
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 5;
x2 = 420;


y = Status( "pxchartheight" );
y=200;
/*
GfxSelectPen( colorGold, 2);
GfxRoundRect( x, y - 130, x2, y+65 , 7, 7 ) ;
GfxTextOut( Name(),13,y-120);
GfxTextOut( ("Exit From Trade If "+Interval()/60+ " Min Candle Close SL => " + sl + " "), 13, y-40);


GfxTextOut( ("" + WriteIf(sig =="Buy",sig + " Only if "+Interval()/60+" Minutes Candle Close Above",sig + " Only if "+Interval()/60+" Minutes Candle Close ") + " => " + entry), 13, y-100);

//GfxTextOut( ("Trailing SL : " + sl + " "), 13, y-80);
GfxTextOut( ("TGT:1 : " + tar1), 13, y -80);
GfxTextOut( ("TGT:2 : " + tar2), 13,y-60);
//GfxTextOut( ("Current P/L : " + WriteVal(IIf(sig == "BUY",(C-entry),(entry-C)),2.2)), 13, y-25);;
GfxTextOut( ("Last "+Interval()/60+" Minutes Candle Close Was =>"+Ref(Close,-1)),13,y-20);

/*{if (sig =="BUY");
GfxTextOut( ("NOTE : "),13,y+3 );
GfxTextOut( ("Buy Only If "+Interval()/60+" Minute Candle Close Above =>" + entry),13,y +150);
if (sig =="SELL");
GfxTextOut( ("Sell Only If "+Interval()/60+" Minute Candle Close Below => "+ entry),13,y +50);}*/
}
_SECTION_BEGIN("KBL Arrow Detection");

Buy=Buy;
Sell=Sell;
/*
PlotShapes(IIf(Buy, shapeSquare,shapeNone) ,colorBlue,0, Low, Offset=-20) ;
PlotShapes(IIf(Buy, shapeSmallUpTriangle,shapeNone) ,colorLime,0, Low, Offset=-22) ;
PlotShapes(IIf(Sell, shapeSquare,shapeNone),colorRed,0, High, Offset=10) ;
PlotShapes(IIf(Sell, shapeSmallDownTriangle,shapeNone),colorLime,0, High, Offset=-12) ;
 

cherpu

Member
PlotShapes(IIf(Cover, shapeSquare,shapeNone) ,colorBlue,0, Low, Offset=-10) ;
PlotShapes(IIf(Cover, shapeStar,shapeNone) ,colorLime,0, Low, Offset=-10) ;
PlotShapes(IIf(Short, shapeSquare,shapeNone),colorRed,0, High, Offset=-1) ;
PlotShapes(IIf(Short, shapeStar,shapeNone),colorRed,0, High, Offset=-1) ;
*/
_SECTION_END();





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

//Plot(YY,"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, colorGold );

}

_SECTION_END();



/****************/
/* */
/* ALERT OUTPUT */
/* */
/****************/

TxtX = Param("Text Left1", 430, 0, 1000, 10);
TxtY = Param("Text Top1", 61, 1, 650, 10);

GfxSelectFont("Tahoma", 14, 700 );
GfxSetBkMode(1);

if(LastValue(Buy) OR SelectedValue(Buy))
{
GfxSetTextColor(colorBrightGreen);
GfxTextOut("BUY Signal Captured :: Buy On Next Candle Open", TxtX, TxtY);
Say("");


}

else if(LastValue(Sell) OR SelectedValue(Sell))
{
GfxSetTextColor(colorRed);
GfxTextOut("SELL Signal Captured :: Sell On Next Candle Open ", TxtX, TxtY);
Say("");
}

else
{
GfxSetTextColor(colorGold);
GfxTextOut(" ", TxtX, TxtY);
GfxTextOut("", TxtX, TxtY);
}

_SECTION_BEGIN("sys");

x=Param("xposn",315,0,1000,1);
y=Param("yposn",576,0,1000,1);


GfxSetTextColor(colorGold);
GfxTextOut( ( " "),60,y-110);
GfxSetTextColor(colorGold);
GfxTextOut( ( " "),50,y-90);
GfxSetTextColor(colorGold);
GfxTextOut( ( " "),30,y-70);
/*
GfxSetTextColor(colorBrightGreen);
GfxTextOut( ( "Recieving Channel : Funds Server "),300,y-110);*/
GfxSetTextColor(colorBrightGreen);
//GfxTextOut( ( "Contact Us For Custom AFL Development "),300,y-90);
/*GfxSetTextColor(colorBrightGreen);
GfxTextOut( ( "Data Status : Recieving "),300,y-70);*/
_SECTION_END();
_SECTION_BEGIN("Background text");
C11=ParamColor("up panel",colorBlack );
C12=ParamColor("dn panel",colorBlack );
C13=Param("fonts",20,10,30,1 );
C14=Param("left-right",2.1,1.0,5.0,0.1 );
C15=Param("up-down",8,1,30,1 );
Miny = Status("axisminy");
Maxy = Status("axismaxy");
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxwidth = Status("pxwidth");
pxheight = Status("pxheight");
GfxSetBkMode( 0 );
GfxSelectFont("Tahoma", 12, 500, False, False, 0);
GfxSetTextColor(colorCustom12);
GfxSetTextAlign( 6 );
GfxSelectFont("Tahoma", 15, 600, False, False, 0);
GfxSetTextColor(colorWhite);
GfxSetTextAlign( 6 );
GfxSelectFont("Tahoma", 12, 400, False, False, 0);
GfxSetTextColor(colorBrightGreen);
GfxSelectFont("Tahoma", 12, 400, False, False, 0);
GfxSetTextColor(colorRed);
pricechange=(C-Ref(C,-1))*100/Ref(C,-1);
changeponit=C-Ref(C,-1);
Vlp=Param("Volume lookback period",15,10,300,10);
Vrg=MA(V,Vlp);
St = StDev(Vrg,Vlp);
Vp3 = Vrg + 3*st;
Vp2 = Vrg + 2*st;;
Vp1 = Vrg + 1*st;;
Vn1 = Vrg -1*st;
Vn2 = Vrg -2*st;
 

cherpu

Member
x=Param("xposn",1,0,1000,1);
y=Param("yposn",1,0,1000,1);

GfxGradientRect( 1, 1, 1400, 40, colorCustom13, colorBlack);
GfxSetBkMode(0);
GfxSelectFont( "Georgia", 18, 800, False );
GfxSetTextColor( colorGold );
GfxTextOut( "K-9 Master Trader ® v6.1 ", x+600, y+10 );
GfxSelectFont( "Tahoma", 16, 800, False );
GfxSetTextColor( colorGold );
GfxTextOut( Name(), x+120, y+10 );
GfxSelectFont( "Century Gothic", 15, 100, False );
GfxSetTextColor( colorGold );
GfxTextOut( Date(), x+1000, y+10 );
GfxSelectFont( "Comic Sans MS", 15, 500, False );
GfxSetTextColor( colorGold );
//GfxTextOut( Interval(2), x+275, y+10 );
//------------------------------------------------------------ H, L, O, C----------------------
GfxGradientRect( 1, 40, 1400, 55, colorCustom13, colorBlack );
GfxSetBkMode(0);
GfxSelectFont( "Areal", 9, 200, False );
GfxSetTextColor( colorWhite );
GfxTextOut( "High:"+WriteVal(H,1.2), x+100, y+40 );
GfxSelectFont( "Areal", 9, 200, False );
GfxSetTextColor( colorWhite );
GfxTextOut( "Low:"+WriteVal(L,1.2), x+200, y+40 );
GfxSelectFont( "Areal", 9, 200, False );
GfxSetTextColor( colorWhite );
GfxTextOut( "Open:"+WriteVal(O,1.2), x+300, y+40 );
GfxSelectFont( "Areal", 9, 200, False );
GfxSetTextColor( colorWhite );
GfxTextOut( "Close:"+WriteVal(C,1.2), x+400, y+40 );
GfxSelectFont( "COMIC SANS MS", 12, 100, False );
GfxSetTextColor( colorGold );
GfxTextOut( " ", x+1000, y+35 );


_SECTION_BEGIN("Time Left");
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
return SecondNum;
}
RequestTimedRefresh( 1 );
TimeFrame = Interval();
SecNumber = GetSecondNum();
Newperiod = SecNumber % TimeFrame == 0;
SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;
SecsToGo = TimeFrame - SecsLeft;
/*
x=Param("xposn",50,0,1000,1);
y=Param("yposn",380,0,1000,1);

GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );
GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );
if ( NewPeriod )
{
GfxSelectSolidBrush( colorYellow );
GfxSelectPen( colorYellow, 2 );
Say( "New period" );
}
//GfxRoundRect( x+45, y+40, x-3, y-2, 0, 0 );
//GfxSetBkMode(1);
GfxSelectFont( "Arial", 12, 550, False );
GfxSetTextColor( colorGold );
//GfxTextOut( "Time Left For "+Interval()/60+" Minutes Candle Close => "+SecsToGo+" Seconds", x+155, y+80 );
_SECTION_END();
GfxSelectFont( "Arial", 14, 550, False );
GfxSelectSolidBrush( colorDarkBlue ); // this is the box background color
pxHeight = Status( "pxchartheight" ) ;
xx = Status( "pxchartwidth");
Left = 1100;
width = 310;
x = 40;
x2 = 450;
y = Status( "pxchartheight" );
y=500;
GfxRoundRect( x-35, y - 35, x2, y+65 , 7, 7 ) ;

*/


TS = Param("KSF",80,20,1000,1);
//t=Plot( TSF(Close,TS), "KBL Series Finder",colorGold,styleThick );
//GfxTextOut("KBL Series Finder : "+TSF(C,ts),125,500);
GfxTextOut("Software Updated On : 03-04-2017 ",200,650);
//GfxTextOut( "Time Left For "+Interval()/60+" Min Candle Close => "+SecsToGo+" Seconds", 210, 480 );

/*
_SECTION_BEGIN("Breakout Setting");
no=Param( "Swing", 1, 1, 55 );
res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);
Buy=Cover=Cross(High,tsl) ;

Sellperiods=Ref(Param("Exit Breakout",5,1,100,1,1),-1);

Sell= C<Ref(LLV(Low,Sellperiods),-1);
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
Cover = Buy;
Short = Sell;
Cover = ExRem(Buy,Sell);
Short = ExRem(Sell,Buy);
PlotShapes( IIf( Buy, shapeSmallUpTriangle, shapeNone ), colorGold,0,Low,Offset=-15);
PlotShapes( IIf( Sell, shapeSmallDownTriangle, shapeNone ), colorGold,0,High, offset = -15);*/

_SECTION_BEGIN("short signal");
HaClose=(O+H+L+C)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( H, Max( HaClose, HaOpen ) );
HaLow = Min( L, Min( HaClose, HaOpen ) );
BG2=HHV(LLV(Low,4)+ATR(4),8);
BR2=LLV(HHV(High,4)-ATR(4),8);
SetBarFillColor( IIf(O <C, colorSeaGreen,colorOrange) );
k = Optimize("K",Param("K",1.75,1,5,0.25),1,5,0.25);
Per= Optimize("atr",Param("atr",10,3,30,1),3,30,1);
j=HaClose;
nm= (H-L);
rfsctor = WMA(nm, PER);
revers = K * rfsctor;
Trend = 1;
NW[0] = 0;
for(i = 1; i < BarCount; i++)
{
if(Trend[i-1] == 1)
{
if(j < NW[i-1])
{
Trend = -1;
NW = j + Revers;
}
else
{
Trend = 1;
if((j - Revers) > NW[i-1])
{
NW = j - Revers;
}
else
{
NW = NW[i-1];
}
}
}
if(Trend[i-1] == -1)
{
if(j > NW[i-1])
{
Trend = 1;
NW = j - Revers;
}
else
{
Trend = -1;
if((j + Revers) < NW[i-1])
{
NW = j + Revers;
}
else
{
NW = NW[i-1];
}
}
}
}

Plot(NW, "", IIf(Trend == 1, 6, 4), 4);


_SECTION_BEGIN("MACD Exploration");
r1 = Param( "Fast avg", 12, 2, 200, 1 );
r2 = Param( "Slow avg", 26, 2, 200, 1 );
r3 = Param( "Signal avg", 9, 2, 200, 1 );
Z=Param("zig",1,0,10,0.1);


Cond1 = Cross(MACD(r1,r2),Signal(r1,r2,r3));

Cond3 = Zig(C,z)>Ref(Zig(C,z),-4);
Buy = Cond1 AND Cond3;

Cond4 = Cross(Signal(r1,r2,r3),MACD(r1,r2));

Cond6 = Zig(C,z)<Ref(Zig(C,z),-4);
Sell = Cond4 AND Cond6;
Trigger = WriteIf(Buy, "Buy", "") + WriteIf(Sell, "Sell", "");

_N(Title = StrFormat("{{NAME}} {{DATE}} {{INTERVAL}}: O=%1.2f, H=%1.2f, L=%1.2f, C=%1.2f, V=%1.0f\n{{VALUES}}", O, H, L, C, V));

BG = IIf(Buy, colorPaleGreen, IIf(Sell, colorRose, colorDefault));
FG = IIf(Buy, colorDarkGreen, IIf(Sell, colorDarkRed, colorDefault));

if(Status("action") == actionIndicator)
{
/*Plot(C, "", colorGrey50, styleBar);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-30);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-30);
*/
}

//------------------------------------------------------------------------------------------------
if(Status("action") == actionExplore)

Filter = Buy OR Sell;
SetOption("NoDefaultColumns", True);

AddTextColumn(Name(), "Symbol", 77, FG, BG, 120);
AddColumn(DateTime(), "Date", formatDateTime, FG, BG, 100);
AddColumn(TimeNum() ,"Time",1);
AddColumn( C, "Close", 1.3 );
AddColumn( H, "High", 1.3 );
AddColumn(V, "Volume");
AddColumn(Ref(V,-1),"P-Vol");
AddColumn(V/Ref(V,-1)*100,"Increase in Vol");
AddColumn( Buy, "Buy", 1 );
AddColumn( Sell, "Sell", 1 );

shape = Buy * shapeUpTriangle + Sell * shapeDownTriangle;
 

cherpu

Member
PlotShapes( shape, IIf( Buy, colorGold, colorGold ), 0, IIf( Buy, Low, High ) );

GraphXSpace = 7;

GraphXSpace = 7;
_SECTION_END();
color=IIf(BarsSince(Cross(nw,C))>BarsSince(Cross(C,nw)), colorBrightGreen,colorRed);
Plot(C,"",color,64);

dist = 0.8*ATR(10);
dist1 = 2*ATR(10);
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
PlotText( "\nBuy @" + C[ i ] + "\nTGT=> " + (C+10) +"\nSL=> " + (C-10), i, L[ i ]-dist, colorBrightGreen, colorBlack );
}
if( Sell )
{
PlotText( "\nSell @" + C[ i ] + "\nTGT=> " + (C-10) + "\nSL=> " + (C+10), i, H[ i ]+dist1, colorOrange, colorBlack );
}
}

GraphXSpace = 30;

_SECTION_BEGIN("Volume At Price1");
PlotVAPOverlay( Param("Lines", 300, 100, 1000, 1 ), Param("Width", 5, 1, 100, 1 ), ParamColor("Color", colorCycle ), ParamToggle("Side", "Left|Right" ) | 4*ParamToggle("Z-order", "On top|Behind", 1 ) );

_SECTION_END();

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();


// set criteria to scan for big stock only;
BigStock = MA( V, 10 ) * MA( C, 10 ) > 100;

//---------------Color------------------------
per1 = 6;
per2 = 2;
Om = MA( O, per1 );
hm = MA( H, per1 );
lm = MA( L, per1 );
Cm = MA( C, per1 );

// 1. Heiken Ashi
HACLOSE = ( Om + Hm + Lm + Cm ) / 4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );


Of = MA( Haopen, per2 );
Cf = MA( Haclose, per2 );
Lf = IIf( haOpen < haClose, MA( Halow, per2 ), MA( Hahigh, per2 ) );
Hf = IIf( haOpen < haClose, MA( Hahigh, per2 ), MA( Halow, per2 ) );
//Color = IIf( Cf > Of, colorGreen, colorRed );


//----------------------------------------------------

TrailStop = HHV( C - 2 * ATR( 10 ), 15 );
ProfitTaker = EMA( H, 13 ) + 2 * ATR( 10 );

/* **********************************
Code to automatically identify pivots
********************************** */

// -- what will be our lookback range for the hh and ll?
farback = 140; //How Far back to go
nBars = 12; //Number of bars

// -- Create 0-initialized arrays the size of barcount
aHPivs = H - H;
aLPivs = L - L;

// -- More for future use, not necessary for basic plotting
aHPivHighs = H - H;
aLPivLows = L - L;
aHPivIdxs = H - H;
aLPivIdxs = L - L;
nHPivs = 0;
nLPivs = 0;
lastHPIdx = 0;
lastLPIdx = 0;
lastHPH = 0;
lastLPL = 0;
curPivBarIdx = 0;

// -- looking back from the current bar, how many bars
// back were the hhv and llv values of the previous
// n bars, etc.?
aHHVBars = HHVBars( O, nBars );
aLLVBars = LLVBars( O, nBars );
aHHV = HHV( O, nBars );
aLLV = LLV( O, nBars );

// -- Would like to set this up so pivots are calculated back from
// last visible bar to make it easy to "go back" and see the pivots
// this code would find. However, the first instance of
// _Trace output will show a value of 0
aVisBars = Status( "barvisible" );
nLastVisBar = LastValue( Highest( IIf( aVisBars, BarIndex(), 0 ) ) );
_TRACE( "Last visible bar: " + nLastVisBar );

// -- Initialize value of curTrend
curBar = ( BarCount - 1 );
curTrend = "";

if ( aLLVBars[curBar] < aHHVBars[curBar] )
{
curTrend = "D";
}
else
{
curTrend = "U";
}

// -- Loop through bars. Search for
// entirely array-based approach
// in future version
for ( i = 0; i < BarCount; i++ )
{
curBar = ( BarCount - 1 ) - i;
// -- Have we identified a pivot? If trend is down...

if ( aLLVBars[curBar] < aHHVBars[curBar] )
{
// ... and had been up, this is a trend change
if ( curTrend == "U" )
{
curTrend = "D";
// -- Capture pivot information
curPivBarIdx = curBar - aLLVBars[curBar];
aLPivs[curPivBarIdx] = 1;
aLPivLows[nLPivs] = L[curPivBarIdx];
aLPivIdxs[nLPivs] = curPivBarIdx;
nLPivs++;
}

// -- or current trend is up
}
else
{
if ( curTrend == "D" )
{
curTrend = "U";
curPivBarIdx = curBar - aHHVBars[curBar];
aHPivs[curPivBarIdx] = 1;
aHPivHighs[nHPivs] = H[curPivBarIdx];
aHPivIdxs[nHPivs] = curPivBarIdx;
nHPivs++;
}

// -- If curTrend is up...else...
}

// -- loop through bars
}

// -- Basic attempt to add a pivot this logic may have missed
// -- OK, now I want to look at last two pivots. If the most
// recent low pivot is after the last high, I could
// still have a high pivot that I didn't catch
// -- Start at last bar
curBar = ( BarCount - 1 );

candIdx = 0;

candPrc = 0;

lastLPIdx = aLPivIdxs[0];

lastLPL = aLPivLows[0];

lastHPIdx = aHPivIdxs[0];

lastHPH = aHPivHighs[0];

if ( lastLPIdx > lastHPIdx )
{
// -- Bar and price info for candidate pivot
candIdx = curBar - aHHVBars[curBar];
candPrc = aHHV[curBar];

if (
lastHPH < candPrc AND
candIdx > lastLPIdx AND
candIdx < curBar )
{
// -- OK, we'll add this as a pivot...
aHPivs[candIdx] = 1;
// ...and then rearrange elements in the
// pivot information arrays

for ( j = 0; j < nHPivs; j++ )
{
aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs- ( j+1 )];
aHPivIdxs[nHPivs-j] = aHPivIdxs[nHPivs-( j+1 )];
}

aHPivHighs[0] = candPrc ;

aHPivIdxs[0] = candIdx;
nHPivs++;
}
}
else
{
// -- Bar and price info for candidate pivot
candIdx = curBar - aLLVBars[curBar];
candPrc = aLLV[curBar];

if (
lastLPL > candPrc AND
candIdx > lastHPIdx AND
candIdx < curBar )
{
// -- OK, we'll add this as a pivot...
aLPivs[candIdx] = 1;
// ...and then rearrange elements in the
// pivot information arrays

for ( j = 0; j < nLPivs; j++ )
{
aLPivLows[nLPivs-j] = aLPivLows[nLPivs-( j+1 )];
aLPivIdxs[nLPivs-j] = aLPivIdxs[nLPivs-( j+1 )];
}

aLPivLows[0] = candPrc;

aLPivIdxs[0] = candIdx;
nLPivs++;
}
}

//============== EXPLORATION ==============
Buy = Cover = BigStock AND aLPivs == 1;

Sell = Short = BigStock AND aHPivs == 1;

SellPrice = ValueWhen( Sell, C, 1 );

BuyPrice = ValueWhen( Buy, C, 1 );

Long = Flip( Buy, Sell );

Shrt = Flip( Sell, Buy );

//============== Plot price ==============
n = 15;

a = C > ( MA( H, n ) + MA( L, n ) ) / 2;// then Buy next bar at market;

b = C < ( MA( H, n ) + MA( L, n ) ) / 2;// then Sell Short next bar at market;

state = IIf( BarsSince( a ) < BarsSince( b ), 1, 0 );

Longs = state == 1;

shorts = state == 0;

//Chart
//Colorbar = IIf( Longs, colorGreen, IIf( Shorts, colorRed, colorGrey40 ) );

//Plot( C, "Close", colorDefault, styleCandle );

//============== Plot Shape ==============;
//============== EMA(13) ==============
//Plot( EMA( C, 13 ), "" , colorSkyblue + styleLine + styleNoRescale );

//============== TRENDING ==============
DTL = 150; // DTL = Define Trend Long

DTM = 70; // DTM = Define Trend Medium

DTS = 14; // DTS = Define Trend Short

TL = LinRegSlope( MA( C, DTL ), 2 ); // TL = Trend Long

TM = LinRegSlope( MA( C, DTM ), 2 ); // TM = Trend Medium

TS = LinRegSlope( MA( C, DTS ), 2 ); // TS = Trend Short

TLL = IIf( LinRegSlope( MA( C, DTL ), 2 ) > 0, True, False );

TMM = IIf( LinRegSlope( MA( C, DTM ), 2 ) > 0, True, False );

TSS = IIf( LinRegSlope( MA( C, DTS ), 2 ) > 0, True, False );
 

cherpu

Member
//============== VOLUME ==============
Vlp = 30; //Volume lookback period

Vrg = MA( V, Vlp );

St = StDev( Vrg, Vlp );

Vp3 = Vrg + 3 * st;

Vp2 = Vrg + 2 * st;

Vp1 = Vrg + 1 * st;

Vn1 = Vrg - 1 * st;

Vn2 = Vrg - 2 * st;

//============== WILLIAM'S %R ==============
WR = ( ( HHV( H, 14 ) - C ) / ( HHV ( H, 14 ) - LLV ( L, 14 ) ) ) * -100;

//============== A/D ==============
TRH = IIf( Ref( C, -1 ) > H, Ref( C, -1 ), H );

TRL = IIf( Ref( C, -1 ) < L, Ref( C, -1 ), L );

ad = IIf( C > Ref( C, -1 ), C - TRL, IIf( C < Ref( C, -1 ), C - TRH, 0 ) );

WAD = Cum( ad );

wu = wad > Ref( wad, -1 );

wd = wad < Ref( wad, -1 );

//============== MACD ==============
MB = Cross ( MACD(), Signal() );

MS = Cross( Signal(), MACD() );

MB = ExRem( MB, MS );

MS = ExRem( MS, MB );

MB1 = MACD() > Signal();

MS1 = MACD() < Signal();

//============== STOCH ==============
StochKval = StochK( 10, 5 );

StochDval = StochD( 10, 5, 5 );

StochBuy = Cross( StochK( 10, 5 ), StochD( 10, 5, 5 ) );

StochSell = Cross ( StochD( 10, 5, 5 ), StochK( 10, 5 ) );

StBuy = StochK( 10, 5 ) > StochD( 10, 5, 5 );

StSell = StochK( 10, 5 ) < StochD( 10, 5, 5 );

//============== ADX ==============
adxBuy = Cross( PDI( 14 ), MDI( 14 ) );

adxSell = Cross( MDI( 14 ), PDI( 14 ) );

adxBuy = ExRem( adxBuy, adxSell );

adxSell = ExRem( adxSell, adxBuy );

adxbuy1 = PDI( 14 ) > MDI( 14 );

adxsell1 = MDI( 14 ) > PDI( 14 );

//==============Zero Lag TMA ==============
function ZeroLagTEMA( array, period )
{
TMA1 = TEMA( array, period );
TMA2 = TEMA( TMA1, period );
Diff = TMA1 - TMA2;
return TMA1 + Diff ;
}

haClose = ( haClose + haOpen + haHigh + haLow ) / 4;

periodtm = 55;
ZLHa = ZeroLagTEMA( haClose, periodtm );
ZLTyp = ZeroLagTEMA( Avg, periodtm );
TMBuy = Cross( ZLTyp, ZLHa );
TMSell = Cross( ZLHa, ZLTyp );
TMBuy1 = ZLTyp > ZLHa ;
TMSell1 = ZLHa > ZLTyp ;

//============== ZLW ==============
R = ( ( HHV( H, 14 ) - C ) / ( HHV ( H, 14 ) - LLV ( L, 14 ) ) ) * -100;
MaxGraph = 10;
PeriodZ = 10;
EMA1 = EMA( R, PeriodZ );
EMA2 = EMA( EMA1, 5 );
Difference = EMA1 - EMA2;
ZeroLagEMA = EMA1 + Difference;
PR = 100 - abs( ZeroLagEMA );
MoveAvg = MA( PR, 5 );
ZBuy = Cross( PR, moveAvg ) AND PR < 30;
ZSell = Cross( moveAvg, PR ) AND PR > 70;
ZBuy1 = PR >= MoveAvg AND PR >= Ref( PR, -1 ) ;
ZSell1 = ( PR < MoveAvg ) OR PR >= MoveAvg AND PR < Ref( PR, -1 ) ;

//============== RS ==============
p = ( H + L + C ) / 3;
r1 = ( 2 * p ) - L;
s1 = ( 2 * p ) - H;
r2 = p + ( r1 - s1 );
s2 = p - ( r2 - s1 );
R3 = P + ( R2 - S2 );
S3 = P - ( R3 - S2 );

//============== IBUY ==============
Ibuy = Cross( RSI( 50 ), EMA( RSI( 50 ), 45 ) );
Isell = Cross( EMA( RSI( 50 ), 45 ), RSI( 50 ) );
Ibuy = ExRem( Ibuy, ISell );
Isell = ExRem( ISell, Ibuy );
BlRSI = RSI( 14 ) > EMA( RSI( 14 ), 9 );
BrRSI = RSI( 14 ) < EMA( RSI( 14 ), 9 );
IBuy[BarCount-1]=Null;
ISell[BarCount-1]=Null;
BlRSI[BarCount-1]=Null;
BrRSI[BarCount-1]=Null;
//PlotShapes(iBuy*shapeUpArrow,colorGreen,0,L);
//PlotShapes(isell*shapeDownArrow,colorRed,0,H);
/*
PlotShapes(blrsi*shapeUpArrow,colorGreen,0,L);
PlotShapes(brrsi*shapeDownArrow,colorRed,0,H);*/


/*ET = ParamTime("ENTRY TIME","09:15:00",0);
ETD = ParamTime("ENTRY TIME END","11:15:00",0);
RC = IIf(TimeNum()>ET AND TimeNum()<ETD,ParamColor("BACK COLOR",colorDarkOliveGreen),colorBlack);
Plot(100, "ribbon", RC, styleOwnScale|styleArea|styleNoLabel, -0.5,100);
//YPlotBoolRibbon(TimeNum()>ET AND TimeNum()<ETD, "Trading Hours", colorGreen);*/


TS = Param("TSF",1,20,1000,1);
Plot( TSF(Close,TS), "Time Series Forecast",colorWhite );
//SetChartBkColor(ParamColor("Outer panel color ",colorWhite));
showSignals=ParamToggle("Display signals","Off|On",0);
_SECTION_BEGIN("Trendlines Multitimeframe");
// Amibroker AFL code by Edward Pottasch, 6/8/2011
// Using fractals to create automatic trendlines
// Using option to show multiple timeframes
Version(5.21);
xx=BarIndex();x=xx;Lx=LastValue(x);
nbar=Param("N Pivot Bars",3,2,50,1);
tf=Param("Time Frame (min)",5,1,100000,1);tfrm=in1Minute*tf;
CleanPivots=ParamToggle("Use Clean Pivots","Off|On",0);
PivotSymmetry=ParamToggle("Use Symmetric Pivots","Off|On",0);
tld=ParamToggle("All trendlines","Show|Hide",1);
showSignals=ParamToggle("Display signals","Off|On",0);

TimeFrameSet(tfrm);
if (PivotSymmetry)
{
fc=1;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
else
{
fc=2;
pk=H>Ref(HHV(H,nbar*fc),-1) AND Ref(HHV(H,nbar),nbar)<=H;
tr=L<Ref(LLV(L,nbar*fc),-1) AND Ref(LLV(L,nbar),nbar)>=L;
}
px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);
if (CleanPivots)
{
tr=IIf(pk AND tr AND ph1>ph2 AND tl1>tl2,False,tr);
pk=IIf(pk AND tr AND ph1<ph2 AND tl1<tl2,False,pk);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

pk=IIf(pk AND px1>tx1 AND ph1<tl1,False,pk);
tr=IIf(tr AND tx1>px1 AND tl1>ph1,False,tr);
pk=IIf(pk AND px0<tx0 AND ph0>ph1,False,pk);
tr=IIf(tr AND px0>tx0 AND tl0<tl1,False,tr);
pk=IIf(pk AND px2>tx1 AND ph1<=ph2,False,pk);
tr=IIf(tr AND tx2>px1 AND tl1>=tl2,False,tr);
pk=IIf(pk AND px0>px1 AND px1>tx1 AND px1>tx0 AND ph0>ph1,False,pk);
tr=IIf(tr AND tx0>tx1 AND tx1>px1 AND tx1>px0 AND tl0<tl1,False,tr);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

pk=IIf(pk AND px1>tx1 AND ph1<tl1,False,pk);
tr=IIf(tr AND tx1>px1 AND tl1>ph1,False,tr);
pk=IIf(pk AND px0<tx0 AND ph0>ph1,False,pk);
tr=IIf(tr AND px0>tx0 AND tl0<tl1,False,tr);
pk=IIf(pk AND px2>tx1 AND ph1<=ph2,False,pk);
tr=IIf(tr AND tx2>px1 AND tl1>=tl2,False,tr);
pk=IIf(pk AND px0>px1 AND px1>tx1 AND px1>tx0 AND ph0>ph1,False,pk);
tr=IIf(tr AND tx0>tx1 AND tx1>px1 AND tx1>px0 AND tl0<tl1,False,tr);

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);

pk=IIf(pk AND px1>tx1 AND px2>tx1 AND ph1<ph2,False,pk);
tr=IIf(tr AND tx1>px1 AND tx2>px1 AND tl1>tl2,False,tr);
}
pkh=IIf(pk,H,Null);
trl=IIf(tr,L,Null);
TimeFrameRestore();
fact=Max(tfrm/60,Interval()/60)/(Interval()/60);
Lkbk=tfrm/Interval();
if(Lkbk>1)
{
pk=TimeFrameExpand(pk,tfrm,expandFirst);
pkh=TimeFrameExpand(pkh,tfrm,expandFirst);
pkhs=IIf(!IsEmpty(pkh),1,0);pkhs=pkhs-Ref(pkhs,-1);
pk=pk AND H==pkh;
cond1=Sum(pk,BarsSince(pkhs==1)+1)==1 AND pk;
pk=pk AND cond1;

tr=TimeFrameExpand(tr,tfrm,expandFirst);
trl=TimeFrameExpand(trl,tfrm,expandFirst);
trls=IIf(!IsEmpty(trl),1,0);trls=trls-Ref(trls,-1);
tr=tr AND L==trl;
cond1=Sum(tr,BarsSince(trls==1)+1)==1 AND tr;
tr=tr AND cond1;

px0=ValueWhen(pk,x,0); tx0=ValueWhen(tr,x,0);
px1=ValueWhen(pk,x,1); tx1=ValueWhen(tr,x,1);
px2=ValueWhen(pk,x,2); tx2=ValueWhen(tr,x,2);
ph0=ValueWhen(pk,H,0); tl0=ValueWhen(tr,L,0);
ph1=ValueWhen(pk,H,1); tl1=ValueWhen(tr,L,1);
ph2=ValueWhen(pk,H,2); tl2=ValueWhen(tr,L,2);
}
y0=ValueWhen(tr,trl,0);
y1=ValueWhen(tr,trl,1);
y2=ValueWhen(tr,trl,2);
y3=ValueWhen(tr,trl,3);
x0=ValueWhen(tr,xx,0);
x1=ValueWhen(tr,xx,1);
x2=ValueWhen(tr,xx,2);
x3=ValueWhen(tr,xx,3);

aa=(Y0-Y1)/(X0-X1);
ls1=aa*(xx-X1)+Y1;
dls1=ls1-Ref(ls1,-1);
aa=(Y1-Y2)/(X1-X2);
ls2=aa*(xx-X1)+Y1;
dls2=ls2-Ref(ls2,-1);
dls2=IIf(tr,Ref(dls1,-1),dls2);
aa=(Y2-Y3)/(X2-X3);
ls3=aa*(xx-X2)+Y2;
dls3=ls3-Ref(ls3,-1);
dls3=IIf(tr,Ref(dls2,-1),dls3);
y0=ValueWhen(pk,pkh,0);
y1=ValueWhen(pk,pkh,1);
y2=ValueWhen(pk,pkh,2);
y3=ValueWhen(pk,pkh,3);
x0=ValueWhen(pk,xx,0);
x1=ValueWhen(pk,xx,1);
x2=ValueWhen(pk,xx,2);
x3=ValueWhen(pk,xx,3);
aa=(Y0-Y1)/(X0-X1);
hs1=aa*(xx-X1)+Y1;
dhs1=hs1-Ref(hs1,-1);
aa=(Y1-Y2)/(X1-X2);
hs2=aa*(xx-X1)+Y1;
dhs2=hs2-Ref(hs2,-1);
dhs2=IIf(pk,Ref(dhs1,-1),dhs2);
aa=(Y2-Y3)/(X2-X3);
hs3=aa*(xx-X2)+Y2;
dhs3=hs3-Ref(hs3,-1);
dhs3=IIf(pk,Ref(dhs2,-1),dhs3);
if (tld)
{
dd=0.0;
Vh=dd*(ValueWhen(pk,C)-ValueWhen(pk,Ref(C,-1)))/ValueWhen(pk,C);
Vl=dd*(ValueWhen(tr,C)-ValueWhen(tr,Ref(C,-1)))/ValueWhen(tr,C);
ls1=IIf(dls1>=Vl,ls1,Null);
ls2=IIf(dls2>=Vl,ls2,Null);
ls3=IIf(dls3>=Vl,ls3,Null);
hs1=IIf(dhs1<=Vh,hs1,Null);
hs2=IIf(dhs2<=Vh,hs2,Null);
hs3=IIf(dhs3<=Vh,hs3,Null);
}
ls2a=IIf(BarsSince(tr)<=nbar*fact,ls2,Null);
ls2b=IIf(BarsSince(tr)>nbar*fact,ls2,Null);
ls3=IIf(BarsSince(tr)<=nbar*fact,ls3,Null);
hs2a=IIf(BarsSince(pk)<=nbar*fact,hs2,Null);
hs2b=IIf(BarsSince(pk)>nbar*fact,hs2,Null);
hs3=IIf(BarsSince(pk)<=nbar*fact,hs3,Null);
_SECTION_END();

_SECTION_BEGIN("Chart Colors");
SetChartBkColor(ParamColor("Background Color",ColorRGB(0,0,0)));
SetChartOptions(0,chartShowDates);
SetBarFillColor(IIf(C>O,ParamColor("Candle UP Color",
colorGreen),IIf(C<=O,ParamColor("Candle Down Color",
colorRed),colorLightGrey)));
Plot(C,"Price",IIf(C>O,ParamColor("Wick UP Color",
colorDarkGreen),IIf(C<=O,ParamColor("Wick Down Color",
colorDarkRed),colorLightGrey)),64,0,0,0,0);
/*
Plot(pkh,"",colorRed,styleThick,0,0,0,-1);
Plot(trl,"",colorBrightGreen,styleThick,0,0,0,-1);
PlotShapes(shapeSmallCircle*tr,IIf(Lx-ValueWhen(tr,x)>nbar*fact,ColorRGB(0,100,0),colorWhite),0,L,-10);
PlotShapes(shapeSmallCircle*pk,IIf(Lx-ValueWhen(pk,x)>nbar*fact,ColorRGB(255,0,0),colorWhite),0,H,10);
Plot(ls1,"\nLower Trendline",colorBrightGreen,styleLine,0,0,0,-1);
Plot(ls2a,"",colorLightGrey,styleNoLine|styleDots|styleThick,0,0,0,-1);
Plot(ls2b,"",colorDarkGreen,styleNoLine|styleDots|styleThick,0,0,0,-1);
Plot(ls3,"",colorDarkGreen,styleNoLine|styleDots|styleThick,0,0,0,-1);
Plot(hs1,"\nUpper Trendline",colorRed,styleLine,0,0,0,-1);
Plot(hs2a,"",colorLightGrey,styleNoLine|styleDots|styleThick,0,0,0,-1);
Plot(hs2b,"",colorOrange,styleNoLine|styleDots|styleThick,0,0,0,-1);
Plot(hs3,"",colorOrange,styleNoLine|styleDots|styleThick,0,0,0,-1);*/
_SECTION_END();


if(showSignals)
{
Buy=( (!IsEmpty(Ref(hs2b,-1)) AND Ref(C<hs2b,-1)) AND (!IsEmpty(hs2b) AND
C>hs2b) )
OR ( (!IsEmpty(Ref(hs3,-1)) AND Ref(C<hs3,-1)) AND (!IsEmpty(hs3) AND C>hs3) )
OR ( (!IsEmpty(Ref(hs2b,-1)) AND Ref(C<hs2b,-1)) AND (!IsEmpty(hs3) AND C>hs3)
);
Buy=ExRem(Buy,tr OR pk);
BuyPrice=C;

Short=( (!IsEmpty(Ref(ls2b,-1)) AND Ref(C>ls2b,-1)) AND (!IsEmpty(ls2b) AND
C<ls2b) )
OR ( (!IsEmpty(Ref(ls3,-1)) AND Ref(C>ls3,-1)) AND (!IsEmpty(ls3) AND C<ls3) )
OR ( (!IsEmpty(Ref(ls2b,-1)) AND Ref(C>ls2b,-1)) AND (!IsEmpty(ls3) AND C<ls3)
);
Short=ExRem(Short,tr OR pk);
ShortPrice=C;
PlotShapes(IIf(Buy,shapeSmallUpTriangle,shapeNone),colorGold,0,L,-30);
PlotShapes(IIf(Buy,shapeSmallCircle,shapeNone),colorWhite,0,BuyPrice,0);
PlotShapes(IIf(Short,shapeSmallDownTriangle,shapeNone),colorGold,0,H,-30);
PlotShapes(IIf(Short,shapeSmallCircle,shapeNone),colorWhite,0,ShortPrice,0);
}
 

ajayzerodha

New member
i hv got K-9 Master Trader v6.1 | Super Discounted Payment Link | Lifetime Validity.but all are afl?.i cant open ?

//SetChartOptions(0,chartShowArrows|chartShowDates);
//_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


_SECTION_BEGIN("Volume At Price");
PlotVAPOverlay(Param("Lines", 1000, 100, 1000, 10), Param("Width", 0, 0, 100, 1), ParamColor("Color", colorBlue));

_SECTION_END();
_SECTION_BEGIN("BACK COLR");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),

ParamColor("BgBottom", colorBlack),ParamColor("titleblock",colorPlum));

//WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,","");
//WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",","");
//WriteIf( sss ,"No trading signals today.","") ;



SetBarsRequired(600,0);

GraphXSpace = 20;
SetChartOptions( 0, chartShowArrows | chartShowDates );
Dear Brother,
Afl is an extension of the file.
Afl files are indicators used in the Amibroker charting platform.

Let me clear you

.MQ4 and .ex4 files are related to Meta trader 4 right.

Afl files are related to Amibroker Charting software.

Hope you understand

Thankyou
 
one to one coaching
Top