Parameters set up through amibroker afl need - useful to all

#1
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
 

pkgmtnl

Well-Known Member
#2
Please see if content of this post is of any help:

http: (remove space) //www(dot)marketcalls(dot)in/amibroker/amibroker-auto-trading-control-nestnow-terminal(dot)html
& also
http: (remove space) //www(dot)marketcalls(dot)in/amibroker/amibroker-button-style-manual-trading-control-nestnow(dot)html

And
KAKA Ji's contribution is:

ClientID = ParamStr("ClientId","000000");
Symbol= ParamStr("Symbol","NIFTY13APRFUT");
Slp= Param("Slippage%", 0.05);
Bprice= NumToStr(Ref(H,-1)*(1+slp/100),8.3,True);
Sprice= NumToStr(Ref(L,-1)*(1-slp/100),8.3,True);
Quantity=Param("Quantity",1,1,100,1);
OE = ParamList("Order Execution","Immediate,On Candle Completion",1);
AT = ParamToggle("AutoTrade","No,Yes");

if(OE=="On Candle Completion")
{
Buy=Ref(Buy,-1);
Short=Ref(Short,-1);
Sell=Ref(Sell,-1);
Cover=Ref(Cover,-1);
}

AplliedQuantity=IIf(LastValue(Buy) AND LastValue(Cover) OR LastValue(Short) AND LastValue(Sell),Quantity*2,Quantity);
RefNumber = Nz(StaticVarGet("RefNumber"));
Checkdt=Nz(StaticVarGet("lastdt"));
dt = LastValue( DateTime() );
Cond=LastValue(Buy) OR LastValue(Short) OR LastValue(Sell) OR LastValue(Cover);

if(AT)
{
plus = CreateStaticObject("Nest.PlusApi");
if(plus)
{
plus.SetObjectName(ClientID);
if(Cond AND Checkdt != dt )
{
if(LastValue(Buy) OR LastValue(Cover)){plus.PlaceOrder("BUY",RefNumber, "NFO",Symbol,"DAY","LIMIT",AplliedQuantity,BPrice, 0,1,"NRML",ClientID);}
if(LastValue(Short) OR LastValue(Sell)){plus.PlaceOrder("SELL",RefNumber, "NFO",Symbol,"DAY","LIMIT",AplliedQuantity,SPrice, 0,1,"NRML",ClientID);}
StaticVarSet("RefNumber",RefNumber+1);
StaticVarSet("lastdt",dt );
}
}
}

Best Wishes.....
 

Similar threads