I can Create AFL but Need Strategy

Hi Sushil

Please let me know if you can convert Metastock and MT4 codes to Ami AFL,

Thanks
IAM USING ONE AMIBROKER INTRADAY INDICATORE

I NEED TO ADD MY OWN BACKTESTING FOR BUY SELL INDICATOR

MY NEED IS:::

BUY CONDITION: ALL BUY SIGNAL BUY ABOVE HIGH OF SIGNAL CANDLE.

SELL CONDITION: ALL SEIGNAL SIGNAL SELL BELOW LOW OF SIGNAL CANDLE



MY AFL IS BELOW



_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Advanced Trailstop System");



mult=Param("multi", 2.0, 0.1, 10, 0.05);
Aper=Param("ATR period", 7, 2, 100, 1 );
atrvalue=(mult*ATR(aper));

Bs[0]=0;//=L;
L[0]=0;
C[0]=0;

for( i = 9; i < BarCount; i++ )
{
if ( L[ i ] > L[ i - 1 ] AND L[ i ] > L[ i - 2 ] AND L[ i ] > L[ i - 3 ] AND L[ i ] > L[ i - 4 ] AND
L[ i ] > L[ i - 5 ] AND L[ i ] > L[ i - 6 ] AND L[ i ] > L[ i - 7 ] AND L[ i ] > L[ i - 8 ] AND
L[ i ] > L[ i - 9 ] AND C[ i ] > bs[ i - 1 ])
{
bs[ i ] = L[ i ] - ATRvalue[ i ] ;

}
else
{
if ( H[ i ] < H[ i - 1 ] AND H[ i ] < H[ i - 2 ] AND H[ i ] < H[ i - 3 ] AND H[ i ] < H[ i - 4 ] AND
H[ i ] < H[ i - 5 ] AND H[ i ] < H[ i - 6 ] AND H[ i ] < H[ i - 7 ] AND H[ i ] < H[ i - 8 ] AND
H[ i ] < H[ i - 9 ] AND C[ i ] < bs[ i - 1 ] )
{
bs[ i ] = H[ i ] + ATRvalue[ i ];

}
else
{
bs[ i ] = bs[ i - 1];
} }}

//================================================== ==
Mycolor=IIf(C>bs,colorLime,colorRed);
bcolor=IIf(C>bs,colorBlue,colorBlue);
//PlotOHLC( Open, High, Low, Close, "", Mycolor, styleBar| styleThick );
Plot(bs,"ATS",bcolor,1|styleThick);
Buy=Cover=Cross(C,bs);
Sell=Short=Cross(bs,C);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shapeUpArrow*Buy, colorLime, 0, L, -95 );
PlotShapes(shapeDownArrow*Sell, colorRed, 0, H, -30 );
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
_SECTION_END();
Filter= Buy OR Sell OR Short OR Cover;
//=================TITLE============================ ================================================== ==================

_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "Advanced Trailstop System " + " - " + Name() + " - " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - "+"\n" +EncodeColor(colorRed) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V)+"\n"+
EncodeColor(colorLime)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorWhite)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","")+
WriteIf(Long AND NOT Buy, "Trade : Long - Entry price Rs."+(BuyPrice),"")+
WriteIf(shrt AND NOT Sell, "Trade : Short - Entry price Rs."+(SellPrice),"")+"\n"+
WriteIf(Long AND NOT Buy, "Current Profit/Loss Rs."+(C-BuyPrice)+"","")+
WriteIf(shrt AND NOT Sell, "Current Profit/Loss Rs."+(SellPrice-C)+"",""));
_SECTION_END();
 

muinali

Well-Known Member
need help
how can i use same ma for 1 hour or 12 candle(in 5 tf)

// Example 20-bar Moving average shifted 10 bars into the future past the last bar:
Plot(Close,"Close",colorBlack,styleCandle);
//Plot(MA(Close,50), "Shifted MA", colorRed, styleStaircase, Null, Null, 20);
Plot(MA(Close,20), "Shifted MA", colorRed, styleStaircase,0,0, 10
);

// Note that shift occurs during plotting AND does NOT affect source array
 
Hai , I have a well tested strategy , but i canot make AFL as i donot know computer programming. If any senior can help to convert that strategy in to AFL , it will be very helpful for me and as well as other visitors of this forum.
The strategy for buy is :
condition 1 : MACD crossover in buy for 15 minutes timeframe.
condition 2 : EMA20 > EMA50 > EMA100 > EMA200 in 15 minutes timeframe and price close is above EMA20.
condition 3 : EMA20 > EMA50 > EMA100 > EMA200 in 1 minute timeframe and price close is above EMA20.
If all three conditions are satisfied then it is a strong buy signal .
The vice-versa is valid for strong sell signal.
thanks a lot in advance to seniors.
 
Hai , I have a well tested strategy , but i canot make AFL as i donot know computer programming. If any senior can help to convert that strategy in to AFL , it will be very helpful for me and as well as other visitors of this forum.
The strategy for buy is :
condition 1 : MACD crossover in buy for 15 minutes timeframe.
condition 2 : EMA20 > EMA50 > EMA100 > EMA200 in 15 minutes timeframe and price close is above EMA20.
condition 3 : EMA20 > EMA50 > EMA100 > EMA200 in 1 minute timeframe and price close is above EMA20.
If all three conditions are satisfied then it is a strong buy signal .
The vice-versa is valid for strong sell signal.
thanks a lot in advance to seniors.
 
Hai , I have a well tested strategy , but i canot make AFL as i donot know computer programming. If any senior can help to convert that strategy in to AFL , it will be very helpful for me and as well as other visitors of this forum.
The strategy for buy is :
condition 1 : MACD crossover in buy for 15 minutes timeframe.
condition 2 : EMA20 > EMA50 > EMA100 > EMA200 in 15 minutes timeframe and price close is above EMA20.
condition 3 : EMA20 > EMA50 > EMA100 > EMA200 in 1 minute timeframe and price close is above EMA20.
If all three conditions are satisfied then it is a strong buy signal .
The vice-versa is valid for strong sell signal.
thanks a lot in advance to seniors.
 

casoni

Well-Known Member
Hello ,
Why are you posting same question repeatedly ,
you have posted 3 messages with in 8minutes with same query ..
Have patience ...
Thank you
 
Help needed to set parameters in amibroker for auto trade

Dear Friends,

Can anybody help me with afl coding for setting up parameters in Amibroker.
This will be useful for setting Robo trading.

I will post the super trend indicator (up to 90%) accuracy in success rate
for the benefit of all after incorporating the parameters afl coding.

Auto Signal Analysis Type : Optimized (Less Signals)/Correlated (More signals)
Show Stop loss line : Yes/No
Show LTP Line : Yes/No
Risk disclosure : Keep warning me/Stop warning.
Entry order type : On the same candle/on next new candle
Exit Order type : On the same candle/on next new candle
Trade entry : Close price/High Low Breakout
Order type : Long/short/both
Average trades : Allowed/not allowed
Target method : Automatic/percentage/points/none
Target 1 : according to the above settings.
Target 1 booking : Don't book/50%/100%
Target 2 : according to the above settings
Target 2 booking : Don't book/50%/100%
Sl method : Automatic/percentage/points/none
Stop loss : according to the above settings
Show message box : yes/no
Display size : small/medium/large
Box Blend code 1 : RGB (necessary code)
Box Blend code 2 : RGB (necessary code)

Thanks in advance

ATHARSH
 
lol ....... I agree on this " tech analysis but no AFL programming" but it's stupid to believe on that part ... "know AFL programming but no tech analysis" !! :D ( which includes technical analysis terminology as functions !!) ........
 

Similar threads