Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

EMAplusWPR - expert for MetaTrader 4

Views:
23961
Rating:
(10)
Published:
2011.02.07 08:30
Updated:
2016.11.22 07:32
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

ACTUAL VERSION : http://codebase.mql4.com/en/code/10413

Expert advisor that trade in the trend of EMA and buy/sell signals get from Williams %R

I have tried to create an Expert advisor that could by traded with 1000 EUR starting equity and to minimize the drawdown. Hope you like it. I appreciate every feedback.

Inputs EMA, iWPRPeriod are optimized for EURUSD 5M

TakeProfit = 200;

maxStopLoss=50;


maxLots = 0.1; // max lots per position

maxContracts = 2; // max open positions, 2 is optimal for smoother equity


EMA=144; // EMA to determine trend

iWPRPeriod=46; // Williams' Percentage Range to determine buy/sell signals

Test is without position sizing, 0.1 lot size

Strategy Tester Report
EMAplusWPR
XTrade-MT4 Demo (Build 225)

SymbolEURUSD (Euro vs US Dollar)
Period5 Minutes (M5) 2010.01.04 00:00 - 2011.02.01 23:55 (2010.01.01 - 2011.02.02)
ModelEvery tick (the most precise method based on all available least timeframes)
ParametersTakeProfit=200; maxStopLoss=50; maxLots=0.1; maxContracts=2; EMA=144; iWPRPeriod=46;
Bars in test59026Ticks modelled7365768Modelling qualityn/a
Mismatched charts errors8220
Initial deposit1000.00
Total net profit1624.88Gross profit4601.32Gross loss-2976.44
Profit factor1.55Expected payoff3.90
Absolute drawdown27.02Maximal drawdown331.92 (13.99%)Relative drawdown13.99% (331.92)
Total trades417Short positions (won %)198 (71.21%)Long positions (won %)219 (75.80%)
Profit trades (% of total)307 (73.62%)Loss trades (% of total)110 (26.38%)
Largestprofit trade45.15loss trade-39.67
Averageprofit trade14.99loss trade-27.06
Maximumconsecutive wins (profit in money)20 (273.90)consecutive losses (loss in money)5 (-118.47)
Maximalconsecutive profit (count of wins)326.41 (15)consecutive loss (count of losses)-153.43 (4)
verageconsecutive wins5consecutive losses2


To use my position sizing increase the maxLots size

For position sizing I use the following code:

Ilo=0.1* MathSqrt((AccountBalance()) / 300);

Lots=NormalizeDouble(Ilo, 1);

if (Lots<0.1) Lots=0.1;

if (Lots>maxLots) Lots=maxLots;

Strategy Tester Report
EMAplusWPR + position sizing
XTrade-MT4 Demo (Build 225)

SymbolEURUSD (Euro vs US Dollar)
Period5 Minutes (M5) 2010.01.04 00:00 - 2011.02.01 23:55 (2010.01.01 - 2011.02.02)
ModelEvery tick (the most precise method based on all available least timeframes)
ParametersTakeProfit=200; maxStopLoss=50; maxLots=5; maxContracts=2; EMA=144; iWPRPeriod=46;
Bars in test59026Ticks modelled7365768Modelling qualityn/a
Mismatched charts errors8220
Initial deposit1000.00
Total net profit4629.01Gross profit14103.33Gross loss-9474.32
Profit factor1.49Expected payoff11.10
Absolute drawdown54.04Maximal drawdown1293.48 (27.32%)Relative drawdown27.32% (1293.48)
Total trades417Short positions (won %)198 (71.21%)Long positions (won %)219 (75.80%)
Profit trades (% of total)307 (73.62%)Loss trades (% of total)110 (26.38%)
Largestprofit trade176.09loss trade-154.73
Averageprofit trade45.94loss trade-86.13
Maximumconsecutive wins (profit in money)20 (547.80)consecutive losses (loss in money)5 (-554.73)
Maximalconsecutive profit (count of wins)1237.52 (15)consecutive loss (count of losses)-554.73 (5)
Averageconsecutive wins5consecutive losses2

Urban Towers Urban Towers

The indicator shows the arrows point of entry into the position according to the Urban Towers Scalping Strategy.

Market Flow Analysis Method (MFAM) Indicator for Price Action Market Flow Analysis Method (MFAM) Indicator for Price Action

This indicator relies on price action alone - does the price break a previous High or Low?

"Native" MQL HTTP Client "Native" MQL HTTP Client

This library implements two simple HTTP GET / POST function and does not require external dll(s).

Twitpic - Send chart screenshot Twitpic - Send chart screenshot

Drop the script on your chart to send a screenshot to twitpic with or without a message