plz add exploration code and backtesting lines in this code , will be thankful to u .....................also if any one here can explain me what is this all about :sos::!
_SECTION_BEGIN("dhamal");
netbull= Sum(C<Ref(C,-1),3)==3;
netbear= Sum(C>Ref(C,-1),3)==3;
NLBL= ValueWhen(netbull,Ref(H,-2));
NLSL= ValueWhen(netbear,Ref(L,-2));
netline=IIf(BarsSince(NLBL)<BarsSince(NLSL),NLBL, NLSL);
Plot(IIf(Ref(C,-1)< NLBL,NLBL,Null),"NLBL",colorLime,styleDots|styleNoLine|styleThick);
Plot(IIf(Ref(C,-1)> NLSL,NLSL,Null),"NLSL",colorRed,styleDots|styleNoLine|styleThick);
Couleur= IIf(C> NLBL, colorBlue, IIf(C<NLSL, colorRed, colorBlack));
Plot( C, "Close", couleur, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Buy= Cross(C,NLBL);
Sell= Cross(NLSL,C);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
//Short = ExRem(Short, Cover);
//Cover = ExRem(Cover, Short);
AlertIf( Buy, "", "BUY @ " + C, 1 );
AlertIf( Sell, "", "SELL @ " + C, 2 );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
//Plot( Close, "Price", colorBlack, styleCandle );
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ), 0, IIf( Buy, Low, High ) );
dist = 0.5*ATR(10);
dist1 =1*ATR(10);
//SLB = LLV(L,swingN);
//SLS = HHV(H,swingN);
sup=LLV(L,10);
res=HHV(H,10);
/*
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
*/
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
//PlotText( "\nBuy:" + H[ i ] + "\nRisk= " + (H-sup) + "\nSL= " + (sup), i, L[ i ]-dist, colorGreen, colorWhite );
PlotText( "\n" + H[ i ] + "(R)" + (H-sup) , i, L[ i ]-dist, colorWhite, colorBlue );
}
if( Sell )
{
PlotText( "" + L[ i ] + "(R)" + ((res-L)) , i, H[ i ]+dist1, colorWhite, colorPlum );
}
}
_SECTION_END();
_SECTION_BEGIN("wtesttrend");
r1 = PDI(14);
r2 = MDI (14);
Period = Param("Period",20,1,100,1);
TI = WMA( 2*WMA((r1-r2),int(Period/2))- WMA((r1-r2),Period),int(sqrt(Period)));
for( i = 1 ; i < BarCount-2; i++ )
{
if (TI <TI[i-1] &&TI <TI[i+1])
Lpml=1;
else
Lpml =0;
if (TI >TI[i-1] &&TI >TI[i+1])
Lpmh=1;
else
Lpmh =0;
}
GR =ExRem(LpmH,Lpmh);
RD =ExRem(Lpml,Lpml);
Plot( TI, _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style") );
_SECTION_END();
_SECTION_BEGIN("dhamal");
netbull= Sum(C<Ref(C,-1),3)==3;
netbear= Sum(C>Ref(C,-1),3)==3;
NLBL= ValueWhen(netbull,Ref(H,-2));
NLSL= ValueWhen(netbear,Ref(L,-2));
netline=IIf(BarsSince(NLBL)<BarsSince(NLSL),NLBL, NLSL);
Plot(IIf(Ref(C,-1)< NLBL,NLBL,Null),"NLBL",colorLime,styleDots|styleNoLine|styleThick);
Plot(IIf(Ref(C,-1)> NLSL,NLSL,Null),"NLSL",colorRed,styleDots|styleNoLine|styleThick);
Couleur= IIf(C> NLBL, colorBlue, IIf(C<NLSL, colorRed, colorBlack));
Plot( C, "Close", couleur, styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
Buy= Cross(C,NLBL);
Sell= Cross(NLSL,C);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
//Short = ExRem(Short, Cover);
//Cover = ExRem(Cover, Short);
AlertIf( Buy, "", "BUY @ " + C, 1 );
AlertIf( Sell, "", "SELL @ " + C, 2 );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
//Plot( Close, "Price", colorBlack, styleCandle );
PlotShapes( shape, IIf( Buy, colorBlue, colorRed ), 0, IIf( Buy, Low, High ) );
dist = 0.5*ATR(10);
dist1 =1*ATR(10);
//SLB = LLV(L,swingN);
//SLS = HHV(H,swingN);
sup=LLV(L,10);
res=HHV(H,10);
/*
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
tar1 = entry - (entry * .0050);
tar2 = entry - (entry * .0112);
tar3 = entry - (entry * .0212);
*/
for( i = 0; i < BarCount; i++ )
{
if( Buy )
{
//PlotText( "\nBuy:" + H[ i ] + "\nRisk= " + (H-sup) + "\nSL= " + (sup), i, L[ i ]-dist, colorGreen, colorWhite );
PlotText( "\n" + H[ i ] + "(R)" + (H-sup) , i, L[ i ]-dist, colorWhite, colorBlue );
}
if( Sell )
{
PlotText( "" + L[ i ] + "(R)" + ((res-L)) , i, H[ i ]+dist1, colorWhite, colorPlum );
}
}
_SECTION_END();
_SECTION_BEGIN("wtesttrend");
r1 = PDI(14);
r2 = MDI (14);
Period = Param("Period",20,1,100,1);
TI = WMA( 2*WMA((r1-r2),int(Period/2))- WMA((r1-r2),Period),int(sqrt(Period)));
for( i = 1 ; i < BarCount-2; i++ )
{
if (TI <TI[i-1] &&TI <TI[i+1])
Lpml=1;
else
Lpml =0;
if (TI >TI[i-1] &&TI >TI[i+1])
Lpmh=1;
else
Lpmh =0;
}
GR =ExRem(LpmH,Lpmh);
RD =ExRem(Lpml,Lpml);
Plot( TI, _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style") );
_SECTION_END();