Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Trend following Currency trading strategy for Amibroker (AFL)

Rating:
5 / 5 (Votes 2)
Tags:
moving average, currency, trading system, amibroker

This is an extremely profitable trend following strategy for USD-INR currency pair (Can be applied on other currency pairs too) It is an intraday strategy based on triple crossover of Exponential moving averages. Strict stoploss and money management is must for long-term profitability of this strategy.

See the backtest report in the below link for its performance.

http://tradingtuitions.com/afl-of-the-week-usd-inr-currency-trading-strategy/

Screenshots

Indicator / Formula

Copy & Paste Friendly
//------------------------------------------------------
//
//  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, SelectedValue( ROC( C, 1 ) ) ));

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, "Price", colorWhite, styleCandle );
Plot(ema( C, EMAPeriod1 ),"3EMA",colorWhite);
Plot(ema( C, EMAPeriod2 ),"21EMA",colorBlue);
Plot(ema( C, 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();

2 comments

1. rahuldnayak9

what time frame for crudeoil n banknifty gives good result

2. godisbogus

Rahuldnayak 5min

Leave Comment

Please login here to leave a comment.

Back