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

2012.11.20 12:19
Experts

up3x1 - expert for MetaTrader 5

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

Views:
2760
Rating:
votes: 18
up3x1.mq5 (9.57 KB)view

This Expert Advisor is rewritten from MQL4 and was originally published here https://www.mql5.com/en/code/8097 by its author izhutov.

How It Works

Three MA's are used. When the fast MA crosses the middle MA, while the middle MA and the fast MA are below the slow MA, a buy position opens. It is quite the opposite for a sell position - the fast MA crosses the middle MA downward, while the middle MA and the fast MA are above the slow MA.

The lot size for positions to be opened can be fixed or proportional to free margin. There is an additional function to reduce the lot size at losses - the more consecutive losing trades, the smaller the lot size. A trailing stop can be set for an open position.

The image below shows the performance of the Expert Advisor in the strategy tester's visual mode.

 

Parameters

  • MaximumRisk - Risk (it is used if Lots=0).
  • Lots - Lot.
  • DecreaseFactor - Lot reduction factor after losing trades. 0 - reduction disabled. The smaller the value, the greater the reduction. Where it is impossible to reduce the lot size, the minimum lot position is opened.
  • TakeProfit - Take Profit in points.
  • StopLoss - Stop Loss in points.
  • TrailingStop - Trailing Stop in points. If the value is 0, the Trailing stop function is disabled.
  • FastPeriod - Fast MA period.
  • FastShift - Fast MA shift.
  • MiddlePeriod - Middle MA period.
  • MiddleShift - Middle MA shift.
  • SlowPeriod - Slow MA period.
  • SlowShift - Slow MA shift

Note

It is not recommended to set FastShift, MiddleShift and SlowShift values at less than 1. The Expert Advisor checks the indicators on the zero bar only when the new bar opens (it is not supposed to work on the zero (forming) bar). The original version does not have any external parameters of moving averages whatsoever.

Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/1077

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.

Auto Fibonacci Retracement Auto Fibonacci Retracement

Automatically draws Fibonacci retracements on chart.

Example of A Simple Breakout Trading Robot Example of A Simple Breakout Trading Robot

Example of a simple breakout trading robot. There are a lot of breakout methods, but this is the simplest one as I think. Please see the attached images to visualize what is the breakout trading...