Here is one of my favorite swing trade systems.
Three lines converge on 100, it signals a short; coverge on -100 strong buy.
It is based on IBSI and EMA. This signal is pretty sensitive and normally gives you a good timing. You have to put 5% stop loss on it for actual trading
Backtest on SP500, I believe one of big loss is on BSC . So 5% stop loss might not work in this case.
{$I 'NewMax'}
{#OptVar1 50;5;65;5} {#OptVar2 30;5;65;5} {#OptVar3 20;5;65;5} {#OptVar4 20;5;65;5}
function IBSISeries( Series, Period: integer ): integer; begin Result := MultiplySeriesValue( SumSeries( DivideSeries( SubtractSeries( Series, #Low ), SubtractSeries( #High, #Low ) ), Period ), 100/Period ); end;
const MA1 = #OptVar1; const MA2 = #OptVar2; const MA3 = #OptVar3; const MA4 = #OptVar4;
var IBSISer,Bar: integer; var Trend1, Trend2, Trend3, Trendpane: integer; var Trendlow,Trendhigh,Tbar: integer;
Trend1 := EMASeries( #Close, MA1 ); Trend2 := EMASeries( #Close, MA2 ); Trend3 := EMASeries( #Close, MA3 ); IBSISer := IBSISeries( #Close, 5 );
Trendlow := NewMaxSeries( Trend3, MA4 ); TrendHigh := NewMaxSeries( Trend1, MA4 ); Tbar := NewMaxSeries( IBSISer, MA4 ); PlotSeriesLabel( Trend1, 0, 007, 1, 'EMA-'+IntToStr( MA1 ) ); PlotSeriesLabel( Trend2, 0, 060, 1, 'EMA-'+IntToStr( MA2 ) ); PlotSeriesLabel( Trend3, 0, 500, 1, 'EMA-'+IntToStr( MA3 ) );
TrendPane := CreatePane( 75, true, true ); PlotSeries( Trendlow,TrendPane , 900, 2 ); PlotSeries( Trendhigh, TrendPane, 050, 2 ); PlotSeries( Tbar, TrendPane, 009, 2 ); DrawLabel( 'ISBI Trend', TrendPane );
InstallProfitTarget( 2);
for Bar := 65*3 to BarCount() - 1 do begin ApplyAutoStops( Bar ); if (( Getseriesvalue(bar,Trendlow) = -100) and ( Getseriesvalue(bar,Trendhigh) = -100) and ( Getseriesvalue(bar,Tbar) = -100) ) then BuyAtMarket( Bar + 1, '0' ); end;
[ 本帖最后由 biorjin 于 2008-5-19 01:58 编辑 ] |