Sunteți pe pagina 1din 3

Tradingtuitions.

com
AFL of the week: USD-INR Currency Trading strategy
2016-03-21 11:03:45 admin

We have received many requests from our readers to publish AFL for USD-INR Currency Trading strategy. This post would cater to all those requests. This is an
extremely profitable trend following strategy for USD-INR currency pair. See the backtest report for its performance. It is an intraday strategy based on triple crossover of
Exponential moving averages.
Read our article on AFL tutorial here.

AFL Overview

Paramter

Value

Preferred Timeframe 10 minutes


Indicators Used

EMA 3, EMA 21, EMA 46

Buy Condition

EMA Period 3 is greater than EMA period 21, and EMA period 21 is greater than EMA period 46.

Sell Condition

EMA Period 3 is less than EMA period 21, and EMA period 21 is less than EMA period 46

Stop Loss

0.5%

Targets

No fixed target, Stop and reverse when AFL gives opposite signal

Position Size

80% of Trading Capital

Initial Equity

100000

Brokerage

50 per order

Margin

2.5% (for USD-INR Currency futures)

AFL Code
//-----------------------------------------------------//
// Formula Name:
USD-INR Trading Startegy
// Author/Uploader: Trading Tuitions
// E-mail:
support@tradingtuitions.com
// Website:
www.tradingtuitions.com
//-----------------------------------------------------_SECTION_BEGIN("USD-INR Trading Startegy");
SetTradeDelays( 1, 1, 1, 1 );
SetOption( "InitialEquity", 100000);
SetOption("FuturesMode" ,True);
SetOption("MinShares",1);
SetOption("CommissionMode",2);
SetOption("CommissionAmount",50);
SetOption("AccountMargin",10);
SetOption("RefreshWhenCompleted",True);
SetPositionSize( 80, spsPercentOfEquity );
SetOption( "AllowPositionShrinking", True );
BuyPrice=Open;
SellPrice=Open;
ShortPrice=Open;
CoverPrice=Open;

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedVa
EMAPeriod1=3;
EMAPeriod2=21;
EMAPeriod3=46;
Buy = EMA(C, EMAPeriod1) > EMA(C, EMAPeriod2) AND EMA(C, EMAPeriod2) > EMA(C, EMAPeriod3);
Sell = EMA(C, EMAPeriod1) < EMA(C, EMAPeriod2) AND EMA(C, EMAPeriod2) < EMA(C, EMAPeriod3);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = Sell;
Cover = Buy;
StopLoss=0.5;
ApplyStop(Type=0,Mode=1,Amount=StopLoss);
Plot( Close,
Plot(ema( C,
Plot(ema( C,
Plot(ema( C,

"Price", colorWhite, styleCandle );


EMAPeriod1 ),"3EMA",colorWhite);
EMAPeriod2 ),"21EMA",colorBlue);
EMAPeriod3 ),"46EMA",colorRed);

/* Plot Buy and Sell Signal Arrows */


PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Cover, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);


PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
_SECTION_END();

AFL Screenshot

Backtest Report

Paramter
Initial Capital

Value
USD-INR Currency Futures
100000

Final Capital

896807.50

Backtest Period

07-07-2015 to 03-03-2016

Timeframe

10 minutes

Net Profit %

796.81%

Annual Return %

2672.58%

Number of Trades

111

Winning Trade %

39.64%

Average holding Period

64 periods

Max consecutive losses

Max system % drawdown

-44.49%

Max Trade % drawdown

-28.39%

Download the detailed backtest report here.


Please note that you can expect even better results if you allow compounding of your returns.

Equity Curve

Additional Amibroker settings for backtesting


Goto Symbol>Information, and specify the lot size and margin requirement. The below screenshot shows lot size of 1000 and margin requirement of 2.5% for USD-INR:

Disclaimer:
All the AFLs posted in this section are for learning purpose. Trading Tuitions does not necessarily own these AFLs and we dont have any intellectual property rights on
them. We might copy useful AFLs from public forums and post it in this section in a presentable format. The intent is not to copy anybodys work but to share knowledge. If
you find any misleading or non-reproducible content then please inform us at support@tradingtuitions.com
Liked this article? Please spare few seconds to share it. Share on FacebookShare on TwitterShare on Google+Share on Linkedin

Related

S-ar putea să vă placă și