This is read-only version of AFL library entry. Ability to add user formulas
and comment is only available from members-only area.
Details:
Formula name:
Index and ETF trading
Author/Uploader:
scienide - (email hidden)
Date/Time added:
2009-05-26 18:18:06
Origin:
Keywords:
Index and ETF trading system
Level:
medium
Flags:
system
DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
The system is designed to trade equity ETFs and indices. Weekly ADX is used to determine long-term trend, whereas daily Stochastic triggers the entry. The exits are conditioned by crossovers of EMAs.
Your comments and critique are more than welcome.
Formula:
Cond3 =
StochD(15,3,3) > 70 AND StochK(15,3) > 70
AND StochD(15,3,3) > Ref(StochD(15,3,3), -1) AND Ref(StochD(15,3,3), -1) >
Ref(StochD(15,3,3), -2)
AND StochK(15,3) > Ref(StochK(15,3), -1) AND Ref(StochK(15,3), -1) >
Ref(StochK(15,3), -2);
Cond4 =
StochD(15,3,3) < 30 AND StochK(15,3) < 30
AND StochD(15,3,3) < Ref( StochD(15,3,3), -1) AND Ref( StochD(15,3,3), -1) <
Ref( StochD(15,3,3), -2 )
AND StochK(15,3) < Ref(StochK(15,3), -1) AND Ref(StochK(15,3), -1) <
Ref(StochK(15,3), -2);
TimeFrameSet ( inWeekly );
Cond1 =
PDI(14) > MDI(14) AND ADX(14) > MDI(14)
AND ADX(14) > Ref(ADX(14), -1) AND Ref(ADX(14), -1) > Ref(ADX(14), -2) AND
Ref(ADX(14), -2) > Ref(ADX(14), -3)
AND ADX(14) > 22 AND ADX(14) < 60;
Cond2 =
MDI(14) > PDI(14) AND ADX(14) > PDI(14)
AND ADX(14) > Ref(ADX(14), -1) AND Ref(ADX(14), -1) > Ref(ADX(14), -2) AND
Ref(ADX(14), -2) > Ref(ADX(14), -3)
AND ADX(14) > 22 AND ADX(14) < 60;
TimeFrameRestore ();
Cond1 = TimeFrameExpand(Cond1, inWeekly);
Cond2 = TimeFrameExpand(Cond2, inWeekly);
Cond5 = Cross( EMA(C, 50), EMA(C, 250));
Cond6 = Cross( EMA(C, 250), EMA(C, 50));
Buy = Cond1 AND Cond4;
Sell = Cond6;
Short = Cond2 AND Cond3;
Cover = Cond5;
ApplyStop(stopTypeLoss, stopModePercent, 10, 1, False, 5);
PositionSize = -5;