Adviser Ivan - the best of ilan - page 8

 

I decided to make such an experiment: starting from 2012.01.01 on USDJPY M15 conduct optimization for half a year and trade with the best optimization result for half a year. Then optimize and trade again

Optimization parameter: "Balance + max Sharp Ratio". Mode of ticks generation: "OHLC".

Next it will be ...

 

version "1.008".

Input parameters:



Use averagingpermission/prohibition to averaging (in pips)
Stop Loss (in pips) ma_periodaveraging period (Moving Average, MA) - the values of this indicator are Stop Loss level for a position/positions
% risk (from 1 to 90)Risk per trade in percent of Margin
Zero bar or first barpermission/denial to receive data indicators (Commodity Channel Index, CCI) from a zero bar
Reverse Level CCI(100) (absolute values from 0 to 150)CCI(100) level above which the "Reverse" signal is generated - closing the current positions and allowing to open opposite positions
Global Signal Level CCI(100) (absolute values from 0 to 150)CCI(100) level, above which a signal to open a position is generated
Minimum distance from the price to stop loss (in pips)Minimum distance between Stop Loss (indicator (Moving Average, MA) and the current price
Trailing Step (in pips)trailing step
Coefficient of protection Profitcalculated as Equity/Balance - if this coefficient is exceeded, we close all positions, therefore taking profit.
magic numbermagic number

Also we have changed the logics for scale in: for example to open a Buy position we are not looking for the LOWEST position, we just check the opening price of the OLDEST position in the same direction. If this CURRENT POSITION has an opening price lower than the current Ask price, in which case we do not want to fill the BUY position.

And, as always, recommendations: optimize in tick generation mode "OHLC", and perform single passes in "All ticks" or "Every tick based on real ticks".

Files:
Ivan.mq5  48 kb
 

Here is an idea: I want to run genetics on many symbols and many timeframes (optimally from M5 up to and including H4). Then post the results of genetics here (how to save the test results: after genetics in the tab "Optimization" right click and "Export to XML").

Source data:

Settings

MetaQuotes-Demo server.

Parameters to be optimized:

Parameters

Run on such symbols (character set "forex.all"):

Symbol

Periods

User

EURUSD

M5, M10

Vladimir Karputov

GBPUSD

USDCHF

USDJPY

USDCAD

AUDUSD

AUDNZD

AUDCAD

M5

Vladimir Karputov

AUDCHF

AUDJPY

CHFJPY

EURGBP

EURAUD

EURCHF

EURJPY

EURNZD

EURCAD

GBPCHF

GBPJPY

CADCHF


need help - I can't do that many tests on my own. The prerequisite is that the genetics test must pass FULLY - until it stops completely.

 

Ivan 1.008 EURUSD M5:

Ivan 1.008 EURUSD M5 TesterOptgraphReport

Single pass with the best result (Every tick based on real ticks mode):

Ivan 1.008 EURUSD M5 TesterGraphReport

As you can see, the main profit is made on good one-way movements.

 

Ivan 1.008 EURUSD M10:

Ivan 1.008 EURUSD M10 TesterOptgraphReport

Single pass with the best result (Every tick based on real ticks mode):

Ivan 1.008 EURUSD M10 TesterGraphReport

Seems to me - unsuccessful parameters - profit only at the expense of ONE good share.

 

version "1.009".

When a position cannot be opened ( minimum Stop Loss condition is not met) the message is now more informative - prices have been added to it:

cci(100): "Global Sell Signal"
OpenSell, sl(110.597)-m_symbol.Ask()(110.420)<min_stops_level(0.250) -> error sl
Files:
Ivan.mq5  49 kb
 
Vladimir Karputov: I have the opposite: now there is no connection in the stock exchange. It's like in the song:
You're a sailor I'm a sailor,
You're a fisherman I'm a fisherman
You on land I'm on sea
We will not meet at all.

Added: Stock trading is netting and my EA is only for hedging (as indicated by the error printout when trying to connect to a stock account:

2017.02.26 14:04:05.291 2016.04.22 00:00:00   Hedging only!

). Therefore, the exchange is flying by with a whistle of plywood on Paris.

You're wrong about the plywood over Paris. I've looked, your code is quite acceptable for exchange trading, at least on FORTS. I ran it in the strategy tester on @Si Splice M15 instrument from 2013 to 2017, and the result is given below. Since you do not hold opposite positions at the same time (the EA trades in Stop And Reverse mode), I suspect that the EA will also work in the stock market, just can't check it now.

Ivan @Si Splice M15 advisor backtest from 2013-2017
 
Eugene Myzrov:
But you're wrong - about the plywood over Paris! I looked, your code is quite acceptable for trading on the exchange, at least on the FORTS market. I ran it in the strategy tester on @Si Splice M15 instrument from 2013-2017, and the result is given below. Since you do not hold opposite positions simultaneously (EA trades in Stop And Reverse mode), then I suspect that the EA will also work on the stock market, I just can't check it now.


Put parameter "Use averaging" == false and the Expert Advisor "Ivan" will not add a position.


Although... Even if it adds a position, it will still (when the signal is reversed) close completely. You may try it.

 
And here is Ivan @Si Splice M15 backtest chart from 2013-2017
Ivan @Si Splice M15 advisor backtest from 2013-2017
 
Vladimir Karputov: Set "Use averaging" == false and the Expert Advisor "Ivan" will not add a position. Although... Even if it adds a position, it will (in case of a reversed signal) close it in full. You may try it.

So let him add a position, as long as the EA closes the position in one direction first, before it opens in the opposite direction.