Re: Trading system - Test it before use it
Hi,
Anyone who wanted to trade on their own..u can try this system, you can earn very good money if u trade as per system..
Apply ADX (50) PSAR ( standard setings),in your chart...
Going Long:
whenever PSAR gives buy signal, look at ADX chart, if D+ above D-, then entre buy trade.. SL as per PSAR..target 100 points..
Going Short:
whenever PSAR gives sell signal, look at ADX chart, if D- above D+, then entre Sell trade.. SL as per PSAR..target 100 points..
Test it in demo trade..it should work 80-90% of time..
I have an Afl for this strategy
///////////////////ADX EXPLORATION//////////////////////
_SECTION_BEGIN("ADX");
range = Param("ADX Periods", 7, 2, 200, 1 );
Col_adx = IIf(ADX(range) > Ref(ADX(range),-1) AND ADX(range) > 30,colorBlue, colorGrey40);
Col_pdi = IIf(PDI(range) > MDI(range) AND PDI(range) > 30,colorBrightGreen,colorDarkGreen);
Col_Mdi = IIf(MDI(range) > PDI(range) AND MDI(range) > 30,colorRed,colorDarkRed);
Plot( ADX(range), _DEFAULT_NAME(), Col_adx , ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", Col_pdi, ParamStyle("+DI style") );
Plot( MDI(range), "-DI", Col_mdi, ParamStyle("-DI style") );
//Plot (20,"",colorGrey40);
Plot (30,"",colorWhite);
//trend = IIf(Col_adx ==colorBlue AND Col_pdi==colorBrightGreen,colorBrightGreen,IIf(Col_adx ==colorBlue AND Col_mdi==colorRed,colorRed,IIf(Col_pdi == colorBrightGreen AND Col_mdi == colorRed,colorYellow, IIf(Col_pdi==colorBrightGreen,colorDarkGreen,IIf(Col_mdi==colorRed,colorDarkRed,colorBlack)))));
trend = IIf(MDI(range) > PDI(range) AND MDI(range) > 30,colorRed,IIf(PDI(range) > MDI(range) AND PDI(range) > 30,colorBrightGreen,colorGrey40));
Plot(2, "", trend, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
Plot(6, "", Col_adx, styleOwnScale| styleArea|styleNoLabel,-0.5,100);
_SECTION_END();
_SECTION_BEGIN("ADX + EMA + MACD");
// This combines three indicators into one timing Signal
//function ParamOptimize( description, default, minv, maxv, step )
// { return Optimize(description, Param(description,default, minv, maxv, step ), minv, maxv, step ); }
tgl = ParamToggle("Result", "AND logic|Compare");
// ema
emaPrice = ParamField("Ema Price field", 3);
PeriodShort = Param("Ema Short Periods", 5, 2, 20, 1);
PeriodLong = Param("Ema Long Periods", 15, 2, 100, 1);
pS = EMA(emaPrice , PeriodShort);
pL = EMA(emaPrice , PeriodLong);
upEma = IIf(pS > pL, 1, 0); // fast ema is above slow, long condition
// adx di lines
range = Param("ADX Periods", 10, 2, 200, 1 );
myPdi = PDI(range );
myMdi = MDI(range );
upAdx = IIf( myPdi > myMdi, 1, 0);
// macd
r1 = Param( "Macd Fast avg", 12, 2, 200, 1 );
r2 = Param( "Macd Slow avg", 26, 2, 200, 1 );
r3 = Param( "Macd Signal avg", 9, 2, 200, 1 );
myMacd = MACD(r1,r2);
mySignal = Signal(r1,r2,r3);
upMacd = IIf(myMacd > mySignal, 1, 0);
// switch test calculation and compare the results
if(tgl)
{
myBuy = upEma AND upAdx AND upMacd;
myShort = !upEma AND !upAdx AND !upMacd;
}
else
{
myBuy = IIf(pS > pL AND myMacd > mySignal AND myPdi > myMdi,1,0);
myShort = IIf(pS < pL AND myMacd < mySignal AND myPdi < myMdi,1,0);
}
Buy = Cover = ExRem(myBuy, myShort);
Short = Sell = ExRem(myShort, myBuy);
Plot( Buy * C, "ADX(" + NumToStr(range,1.0) + ") EMA(" + NumToStr(PeriodShort,1.0) + "," + NumToStr(PeriodLong,1.0) +
") MACD(" + NumToStr(r1,1.0) + "," + NumToStr(r2,1.0) + "," + NumToStr(r3,1.0) + ") - myBuy ", colorGreen); // a positive spike that indicates a buy or cover trade.
Plot( -Short * C , "myShort ", colorRed);
// exploration
Filter = Buy OR Short;
AddColumn(Close, "Close", 1.2);
AddColumn(Buy, "Buy", 1.0);
AddColumn(Short, "Short",1.0);
_SECTION_END();
////////////////// PARABOLIC SAR///////////////
_SECTION_BEGIN("PARABOLIC SAR");
/////////////////////////////////
// Parabolic SAR re-implemented in
// native AFL.
//
// Example of for/if/else control statements
//
// Requires:
// AmiBroker 4.31.1
//
// Written by: Tomasz Janeczko
IAF = 0.02; // acceleration factor
MaxAF = 0.2; // max acceleration
psar = Close; // initialize
long = 1; // assume long for initial conditions
af = IAF; // init acelleration factor
ep = Low[ 0 ]; // init extreme point
hp = High [ 0 ];
lp = Low [ 0 ];
for( i = 2; i < BarCount; i++ )
{
if ( long )
{
psar [ i ] = psar [ i-1 ] + af * ( hp - psar [ i-1 ] );
}
else
{
psar [ i ] = psar [ i-1 ] + af * ( lp - psar [ i-1 ] );
}
reverse = 0;
//check for reversal
if ( long )
{
if ( Low [ i ] < psar [ i ] )
{
long = 0; reverse = 1; // reverse position to Short
psar [ i ] = hp; // SAR is High point in prev trade
lp = Low [ i ];
af = IAF;
}
}
else
{
if ( High [ i ] > psar [ i ] )
{
long = 1; reverse = 1; //reverse position to long
psar [ i ] = lp;
hp = High [ i ];
af = IAF;
}
}
if ( reverse == 0 )
{
if ( long )
{
if ( High [ i ] > hp )
{
hp = High [ i ];
af = af + IAF;
if( af > MaxAF ) af = MaxAF;
}
if( Low[ i - 1 ] < psar[ i ] ) psar[ i ] = Low[ i - 1 ];
if( Low[ i - 2 ] < psar[ i ] ) psar[ i ] = Low[ i - 2 ];
}
else
{
if ( Low [ i ] < lp )
{
lp = Low [ i ];
af = af + IAF;
if( af > MaxAF ) af = MaxAF;
}
if( High[ i - 1 ] > psar[ i ] ) psar[ i ] = High[ i - 1 ];
if( High[ i - 2 ] > psar[ i ] ) psar[ i ] = High[ i - 2 ];
}
}
}
Plot( Close, "Price", colorBlack, styleCandle );
Plot( psar, "SAR", colorRed, styleDots | styleNoLine | styleThick );
range = 15;//Param("Periods", 14, 2, 200, 1 );
ADXi=ADX(range);
PDIi=PDI(range);
MDIi=MDI(range);
//Plot( ADXi=ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
//Plot( PDIi=PDI(range), "", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
//Plot( MDIi=MDI(range), "", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );
uptrend=PDIi>MDIi;//+di greater than -di
downtrend=MDIi>PDIi;//-di greater than +di
Ribboncol=IIf(upTrend,colorGreen, IIf(downtrend,colorRed, colorBlack));
Plot(6, "", Ribboncol, styleOwnScale|styleArea|styleNoLabel, -7.5,100);
Buy=Cross(L,psar) AND uptrend;
Sell=Cross(psar,H) AND downtrend;
PlotShapes(Sell*shapeDownArrow,colorRed);
PlotShapes(Buy*shapeUpArrow,colorGreen);
_SECTION_END();
pls check whether it is OK or not?