|
Post by moneycard on Oct 27, 2015 7:24:30 GMT
Hi, Thanks for your Helping us
i need this afl to be Modified with scale in scale out
My condition for Scale out is
When buy or short signals Come Stoploss Remains the Same On profit side i want to exit 50% of position at Specified Target(like points or in % in intraday)
the afl iam using is
_SECTION_BEGIN("");
Cap=450000;
SetBacktestMode( backtestRegularRaw );
SetOption( "InitialEquity",Cap);
SetOption("AccountMargin",10);
SetOption("CommissionMode",1);
SetOption( "UsePrevBarEquityForPosSizing", 1 );//
SetPositionSize (200, spsPercentOfEquity );
_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("ema_crossover");
x = EMA(Close,3);
y = EMA(Close,8);
Buy=Cross(x,y);
Sell=Cross(y,x);
Short=sell;
cover=buy;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
PlotShapes(shapeUpArrow*Buy,colorGreen);
PlotShapes(shapeDownArrow*Sell,colorRed);
_SECTION_END();
Thanks for your Hand on it
|
|