Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2016.07.01 11:11

Spazm - expert for MetaTrader 4

| English Español Português 日本語 Deutsch Русский

votes: 7
Spazm.mq4 (5.23 KB)view
extern double k=5.0;// multiplier for opening a trade relative to the current volatility, i.e. movement_for_opening=volatility_over_period*k
extern int period=24;// period to calculate the volatility in bars
extern int exp=0;// volatility smoothing mode, 0-simple moving average, 1-linearly weighted
extern int open.close=0;// mode of volatility calculation by 1-open/close, 0-High/Low
extern double SL_pp=0;// set stop loss as a percentage of the movement that took place (from 0 to 1, 0-stop loss is not set at all)
extern bool visualize=true; // plot movements

Large drawdowns, suggestions on improvements are welcome

Strategy Tester Report
TeleTrade-Server (Build 220)

SymbolEURUSD (Euro vs US Dollar)
Period1 Hour (H1) 2008.01.02 10:00 - 2009.01.16 17:00 (2008.01.01 - 2010.01.01)
ModelEvery tick (the most accurate mode based on the shortest available time frames)
Parametersk=6; period=24; exp=0; open.close=0; SL_pp=0; visualize=false;

Bars in test7413Ticks modelled3693207Modelling quality90.00%
Mismatched chart errors15

Initial deposit1000000.00

Net profit35223.60Gross profit89637.40Gross loss-54413.80
Profit factor1.65Expected payoff451.58

Absolute drawdown2399.60Maximum drawdown19886.20 (1.93%)Relative drawdown1.93% (19886.20)

Total trades78Short positions (won %)39 (53.85%)Long positions (won %)39 (43.59%)

Profit trades (% of total)38 (48.72%)Loss Trades (% of total)40 (51.28%)
Largestprofit trade14433.60loss trade-3496.80
Averageprofit trade2358.88loss trade-1360.34
Maximumconsecutive wins (profit in money)6 (24475.80)consecutive losses (loss in money)8 (-10623.20)
Maximalconsecutive profit (count of wins)24475.80 (6)consecutive loss (count)-10623.20 (8)
Averageconsecutive wins2consecutive losses2

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TP-SL_Removing TP-SL_Removing

Immediately deletes the SL/TP of all positions.

Closed_TOTAL Closed_TOTAL

Total closure of all positions (winners/losers). You can also select which are of a single instrument.