Advanced support resistence and trendlines afl

vijayanscbe

Well-Known Member
#1
Hi friends

i hav created a new afl which draw supp/resis line and trend line............

i hav not created the rule for this system

pls pls this is not for beginners ...................

this is for the persons who use amibroker and hav gud exp in mkt ........... rest all wait for some more days ............

friends use this afl and share ur ideas.....................

this look into future datas so backtesting should be done by bar replay option ............

dont backtest simply seeing the chart and dont create any rules ............

see this pic



RULES:
buy/sell arrows appears after some reversal ie it calculates frm futs data not exact recommendation ........... but if i got buy signal and the price crossing the greentrend line i may go long and viceversa

NOTE
i hav not used this afl with stocks ........i used only with NIFTY and BANKNIFTY spot
 
Last edited:

vijayanscbe

Well-Known Member
#2
///////////////////////////////////////////////////////////////////////////////////////////
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} ,{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot(C, "", IIf(O>=C, colorOrange, colorGreen),styleCandle);

SetChartBkGradientFill( ParamColor("Inner panel upper",colorBlack),ParamColor("Inner panel lower",colorBlack));
_N(Title = EncodeColor(colorWhite)+StrFormat(" {{NAME}} - {{INTERVAL}} {{DATE}} Open:%g, Close:%g ,{{VALUES}}",O,C ));

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

Plot(EMA(C,13),"",colorYellow);
/////////////////////////////////////////////////////////////

per1=Param ("per1", 0.325,0.1,50,0.10);

per=per1;
x = Cum(1);
s1=L;
s11=H;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 1 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);
Plot(g3,"",colorRed,styleDashed);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 1 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);
Plot(g4,"",colorGreen,styleDashed);
//////////////////////////////////////////////////////////////////////////////////////////////////
perc=per1;
x=BarIndex();xx=SelectedValue(x);
t1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,x));
H1=SelectedValue(ValueWhen(PeakBars(C,perc)==0,C));
t11=SelectedValue(ValueWhen(TroughBars(C,perc)==0,x));
H11=SelectedValue(ValueWhen(TroughBars(C,perc)==0,C));
g=t1>t11;
shape=IIf(g,shapeDownArrow*(x==t1),shapeUpArrow*(x==t11));
Color=IIf(g,colorRed,colorGreen);
PlotShapes(shape,color);
/////////////////////////////////////////////////////////////////////////////////////////////////

per=per1;

x = Cum(1);
s1=C;
s11=C;
pS = TroughBars( s1, per, 1 ) == 0;
endt= SelectedValue(ValueWhen( pS, x, 1 ));
startt=SelectedValue(ValueWhen( pS, x, 2 ));
dtS =endt-startt;
endS = SelectedValue(ValueWhen( pS, s1, 1 ) );
startS = SelectedValue( ValueWhen( pS, s1, 2 ));
aS = (endS-startS)/dtS;
bS = endS;
trendlineS = aS * ( x -endt ) + bS;
g3= IIf(x>startt-10,trendlineS,-1e10);
Plot(g3,"",colorRed,styleThick);

pR = PeakBars( s11, per, 1 ) == 0;
endt1= SelectedValue(ValueWhen( pR, x, 1 ));
startt1=SelectedValue(ValueWhen( pR, x, 2 ));
dtR =endt1-startt1;
endR = SelectedValue(ValueWhen( pR, s11, 1 ) );
startR = SelectedValue( ValueWhen( pR, s11, 2 ));
aR = (endR-startR)/dtR;
bR = endR;
trendlineR = aR * ( x -endt1 ) + bR;
g4= IIf(x>startT1-10,trendlineR,-1e10);
Plot(g4,"",colorGreen,styleThick);
//////////////////////////////////////////////////////////////////////////////
 

vijayanscbe

Well-Known Member
#3
note : i hav not created this afl frm zero.................

i hav altered few afls and produced my cocktail :thumb:

any alteration in this afl or any new ideas or rules which is more profitabl r welcome......

any more emas or indicators needed can also add with this system......:cool:
 

Similar threads