Watch how to download trading robots for free
Find us on Twitter!
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
Views:
13821
Rating:
(39)
Published:
2014.08.01 13:43
Updated:
2016.11.22 07:32
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

CoensioTrader1 is an open, free, community-supported, automatic trading system (ATS), that is mainly based on only two basic, but very powerful market principles: market trends and market price action.

This system rests on a "trend hunting" principle and enters a trade only when several market conditions are met. The trend detection is based on daily double exponential moving average (DEMA) indicator.

The extended statistical investigation showed that, market can be considered as "trending" if only three successive daily DEMA values point in the same direction. In case when a trending condition is detected, system tries to find the best entry point in the direction of the current trend. The entry points are based on the Bollinger Bands indicator and swing-low/swing-high price action, as described below.

Buy Signals

The system enters a BUY trade every time when:

  1. Market is in "bullish" up trending condition;
  2. Price comes from below the lower Bollinger Band;
  3. A "swing low" price action is detected: Low -> Lower Low -> Higher Low.

Fig.1: Example of BUY entry.

Fig.1. Example of BUY entry

Sell signals

The system enters a SELL trade every time when:

  1. Market is in "bearish " down trending condition;
  2. Price comes from above the upper Bollinger Band;
  3. A "swing high" price action is detected: High -> Higher High -> Lower High.

Fig.2: Example of SELL entry.

Fig.2. Example of SELL entry

The system is written in MQL5 programming language, that provides a possibility of performing an accurate and realistic back-test analysis of a multi-currency based trading systems.

The key to successful back test of a multi-currency system is to abandon the "tick based" EA flow control and use a "timer based" one. This prevents from stagnation in case the EA's base currency does not receives price ticks any more e.g.: during the "quiet" market hours. Moreover the systems has a healthy risk/reward ratio and uses a trailing "stoploss" mechanism with configurable trailing step (using TrailingStopLossStep parameter).

The lot size can be set to a fixed size (using LotSize parameter), a proportional lot size (using RiskMax, which is based on stoploss level and equity risk in %), or a dynamic lot size (using LotBalanceDivider parameter, which resizes the lot size according to change of account balance). Besides that, the system incorporates two different "takeprofit" actions: a standard level based "takeprofit" and additionally an equity based "takeprofit" action. In multi-currency trading systems the account equity can significantly rise above the account balance, this fact gives an opportunity to close all trades and take the current profit as it is. This smart behavior dramatically increases the system's profitability.

As already stated above, CoensioTrader1 is a free and open project, however all CoensioTrader1 project members should actively contribute to the future system improvement.

To make this possible, the system is designed in such way that it is capable of harnessing the computing power of all project members. So every time a project member performs a system optimization, the results are validated and in case of interesting outcome, the optimization parameters are automatically uploaded to the Coensio server database and directly shared with other project members.

The most gainful results are selected using "CoensioIndex" which is defined by:

CoensioIndex = ProfitFactor * BalanceGrowth[%] / EquityDrawDown[%]2
where BalanceGrowth[%] = 100 * Profit / InitialDeposit

The results:

Rank:CoensioIndex:InitialDeposit:Profit:Growth:ProfitFactor:LotSize:EquityDrawdown:BalanceDrawdown:Trades:MT5 Report:Risk Level:User:
167.44$100000$1538710615387.11%1.49Proportional18.46%$21245691714N/AN/Acoensio
247.313$100000$1394941713949.42%1.50Proportional21.01%$21245691705N/AN/Acoensio
334.784$100000$1497481114974.81%1.46Proportional25.11%$25954231772N/AN/Acoensio
434.599$100000$63941016394.10%1.55Proportional16.90%$9556911666N/AN/Acoensio
529.316$100000$1429549914295.50%1.46Proportional26.67%$25954231776N/AN/Acoensio
627.997$100000$1448246514482.47%1.45Proportional27.37%$26949471746N/AN/Acoensio
724.631$100000$1128109211281.09%1.48Proportional26.06%$20500791691N/AN/Acoensio
823.092$100000$1376537213765.37%1.44Proportional29.31%$26949471749N/AN/Acoensio
922.436$100000$1368455113684.55%1.43Proportional29.54%$26949471768N/AN/Acoensio
1019.079$100000$10108461010.85%1.50Fixed8.91%$808481588N/AHighcoensio

Fig.3: Example of a backtest result (Rank=10)

Fig.3. Example of a backtest result (Rank=10)

More trading parameters are available on: http://www.coensio.com/sts/CoensioTrader1V06TOP.php?table=0&ranklength=100

Mercado Aberto Mercado Aberto

Simple indicator that shows when market is open.

Maximum Percentage of Equity Risk Maximum Percentage of Equity Risk

This code allows you to set a maximum percentage of equity risk.

BnB BnB

The indicator shows the power of bulls and bears.

SimpleBars SimpleBars

The indicator colors candlesticks based on the highs and lows of previous bars.