There is an interesting trading idea. Help me find errors in the code (mql4). - page 6

 
khorosh:

And I have finalised the expert, which is on the bottom of page 1 of the thread. Haven't gotten around to your versions yet. On the chart testing H1 EURUSD from 28/01/2015 to date. Optimisation since 15/05/2015. this is around the 93rd trade. April is a failed month. The falling area to the left of the middle is summer(low volatility). It is better to rest in summer. From the second decade of September it starts to go up again. There is still a decent dip at the junction of November and December. The task is to determine the optimal length of the optimization period. I think we should not take more than 3 months. We should check it out.

Will you post the code of the Expert Advisor? And I have another system on 2 indicators)
 
Fixed a bug with the setting of stops.
Files:
exp_cci_mt4.ex4  55 kb
 
Sergey Gritsay:
the bug with setting stops has been fixed.
How many bugs are still uncorrected?
 
Alexey Viktorov:
How many more bugs are left uncorrected?
Hopefully the last one, only improvements from now on. But as new functions are added, new bugs may appear. It is not always possible to write an Expert Advisor without bugs at the first time.
 
Sergey Gritsay:
I have created a little version for MT5, it is too crude, of course, but it works in a demo, unfortunately I am not so good at OOP. If someone would be able to make it work, I would be grateful to you. The strategy_cci.mqh file should be placed in folder Include. I wonder how it will work on futures and stocks.

I get errors on MT5

'exp_cci_mt5.mq5'       exp_cci_mt5.mq5 1       1
'strategy_cci.mqh'      strategy_cci.mqh        1       1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\CloseDisable.bmp' (2)    exp_cci_mt5.mq5 11      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\RestoreDisable.bmp' (2)  exp_cci_mt5.mq5 13      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\ExpandDisable.bmp' (2)   exp_cci_mt5.mq5 14      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\TurnOn.bmp' (2)  exp_cci_mt5.mq5 15      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\TurnOff.bmp' (2) exp_cci_mt5.mq5 16      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\down_smoll.bmp' (2)      exp_cci_mt5.mq5 17      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\up_smoll.bmp' (2)        exp_cci_mt5.mq5 18      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\DownSmall.bmp' (2)       exp_cci_mt5.mq5 19      1
cannot open resource file 'C:\Program Files\MetaTrader 5-МТ5\MQL5\Include\Controls\res\UpSmall.bmp' (2) exp_cci_mt5.mq5 20      1
9 error(s), 0 warning(s)                10      1
 
Сергей Криушин:

There are some errors on MT5

Here are the missing files, unzip the archive and paste into the\MQL5\Include\Controls folder of the terminal
Files:
res.zip  17 kb
 
Sergey Gritsay:
Here are the missing files, unzip the archive and paste them into the\MQL5\Include\Controls folder of the terminal
I unpacked and pasted them - the tester can barely move, it takes so long for the drawings to count and draw
 

added handel opening and classes to it init, you can also plug in the parabolic trawl from the article

#include <strategy_cci.mqh>
#include <Trade/Trade.mqh>
#include <Trade/SymbolInfo.mqh>
#include <Trade/DealInfo.mqh>
#include <Trade/PositionInfo.mqh>
#include <Sample_TrailingStop.mqh> // подключение класса трейлинг стопа

CParabolicStop Trailing; // создание экземпляра класса 
CTrade Trade;
CDealInfo Deal;
CSymbolInfo Sym;
CPositionInfo Pos;
int OnInit()
  {
   cciHandle=iCCI(NULL,0,Period_CCI_S,PRICE_CLOSE);
   cciHandle=iCCI(NULL,0,Period_CCI_F,PRICE_CLOSE);
   if(!Sym.Name(_Symbol))
     {
      Alert("Ошибка инициализации CSymbolInfo, поворите попытку");
      return(-1);
     }
 
Сергей Криушин:

added handel opening and classes to it init, you can also plug in the parabolic trawl from the article

This approach is suitable if the EA is single currency, if we want to create multicurrency EAs, then we should create indicators for all pairs in the init.
 
All multiplied by 2 to lot =10 first in the right direction profit =800, the second plummeted, although the SL was increased by 20, moved the opening to another day the same thing