help needed in AFL for metastock TFC FORMULA

#1
hi
plz can any one write this metastock formula for amibroker afl
thanks in advance.


TREND
BULLISH
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S)
BEARISH
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S)
BUY OUT BOTH RSI/STOC
{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((Stoch(5,3)>20 AND Ref(Stoch(5,3)<20,-1))
)
AND
((RSI(5)>30 AND Ref(RSI(5)<30,-1))
)
BUY- out - both STOCH
{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((Stoch(5,3)>20 AND Ref(Stoch(5,3)<20,-1))
)
BUY- out - both RSI

{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((RSI(5)>30 AND Ref(RSI(5)<30,-1))
)
SELL - out both RSI/STOCH
{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((Stoch(5,3)<80 AND Ref(Stoch(5,3)>80,-1))
)
AND
((RSI(5)<70 AND Ref(RSI(5)>70,-1))
)
SELL - out - both STOCH
{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((Stoch(5,3)<80 AND Ref(Stoch(5,3)>80,-1))
)

SELL - out - both - RSI
{WYJCIE ZE STREF}
( ( ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
OR
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) )<>1
AND
((RSI(5)<70 AND Ref(RSI(5)>70,-1))
)

UPTREND
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) )
AND
Ref((({ To jest brak trendu: ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))>ADX(14) OR ADX(14)<15}
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S)) OR ((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) ) ))<>1,-1)


END OF UPTREND
Ref((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) ) ,-1)
AND
(({ To jest brak trendu: ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))>ADX(14) OR ADX(14)<15}
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S)) OR ((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) ) ))<>1

DOWNTREND
(ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) )
AND
Ref(((
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S)) OR ((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) ) ))<>1,-1)


END OF DOWNTREND
Ref((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 {doda warunek WZROSTOWY/SPADKOWY}
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S) ) ,-1)
AND
((
ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15
AND MACD()<Mov(MACD(),9,E)
AND Mov(C,5,S)<Mov(C,20,S)) OR ((ValueWhen(2,ADX(14)<>Ref(ADX(14),-1),ADX(14))<ADX(14) AND ADX(14)>=15 AND MACD()>Mov(MACD(),9,E)
AND Mov(C,5,S)>Mov(C,20,S) ) ))<>1
 

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?