Experts: ZigZag EA - page 2

 

The Fibo calculation is not wrong, its just a bug.

Change the lines in OnTick() for TakeProfit to add GetFibo

from 

StopLoss=(int)((size_corridor/100.0*GetFibo(Fibo_StopLoss))/m_symbol.Point());//  ???
TakeProfit=(int)(((size_corridor/100.0*Fibo_TakeProfit)-size_corridor)/m_symbol.Point());//  ???

 to

StopLoss=(int)((size_corridor/100.0*GetFibo(Fibo_StopLoss))/m_symbol.Point());//  ???
TakeProfit=(int)(((size_corridor/100.0*GetFibo(Fibo_TakeProfit))-size_corridor)/m_symbol.Point());//  ???


Nice Code :-)

 
deanheslington :

The Fibo calculation is not wrong, its just a bug.

Change the lines in OnTick() for TakeProfit to add GetFibo

from 

StopLoss=( int)((size_corridor/ 100.0*GetFibo(Fibo_StopLoss))/m_symbol. Point()); //  ???
TakeProfit=( int)(((size_corridor/ 100.0*Fibo_TakeProfit)-size_corridor)/m_symbol. Point ());//  ???

 to

StopLoss=( int)((size_corridor/ 100.0*GetFibo(Fibo_StopLoss))/m_symbol. Point()); //  ???
TakeProfit=( int)(((size_corridor/ 100.0*GetFibo(Fibo_TakeProfit))-size_corridor)/m_symbol. Point()); //  ???


Nice Code :-)

What is it?

 

I am getting these errors when loading this EA


'INIT_FAILED' - expression not boolean ZigZag EA.mq5 Line 427 Comment 20

'INIT_FAILED' - expression not boolean ZigZag EA.mq5 Line 433 Comment 17


Also don't see the Fibo fix stated above..


can you add the Fibo fix and fix these errors and upload again?


 
Brian Sinclair :

I am getting these errors when loading this EA


'INIT_FAILED' - expression not boolean ZigZag EA.mq5 Line 427 Comment 20

'INIT_FAILED' - expression not boolean ZigZag EA.mq5 Line 433 Comment 17


Also don't see the Fibo fix stated above..


can you add the Fibo fix and fix these errors and upload again?


Please download version 1.003 from the Russian part of the forum: https://www.mql5.com/ru/code/21452

ZigZag EA
ZigZag EA
  • www.mql5.com
Опубликовал: Vladimir Karputov Просмотров: 1102 Рейтинг: Опубликован: 2018.07.17 14:49 Обновлен: 2019.11.23 07:13 Советник использует данные с пользовательского индикатора "ZigZag". По данному индикатору определяется канал, и по границам канала выставляются отложенные ордера Buy Stop и Sell Stop. После срабатывания отложенного ордера...
 
Vladimir Karputov:

Please download version 1.003 from the Russian part of the forum: https://www.mql5.com/ru/code/21452

This line of code is still not fixed:

   TakeProfit=(int)(((size_corridor/100.0*Fibo_TakeProfit)-size_corridor)/m_symbol.Point());

The Fibo_TakeProfit is an enum, and supposed to be translated into a percentage value by the function GetFibo(), which is missing here.

Fixed line should read like this:

   TakeProfit=(int)(((size_corridor/100.0*GetFibo(Fibo_TakeProfit))-size_corridor)/m_symbol.Point());
 
lippmaje :

This line of code is still not fixed:

The Fibo_TakeProfit is an enum, and supposed to be translated into a percentage value by the function GetFibo(), which is missing here.

Fixed line should read like this:

Thanks.

But you can always fix the code yourself or download version 1.005 from the Russian part of the forum: https://www.mql5.com/ru/code/21452

ZigZag EA
ZigZag EA
  • www.mql5.com
Опубликовал: Vladimir Karputov Просмотров: 1106 Рейтинг: Опубликован: 2018.07.17 14:49 Обновлен: 2019.11.23 07:13 Советник использует данные с пользовательского индикатора "ZigZag". По данному индикатору определяется канал, и по границам канала выставляются отложенные ордера Buy Stop и Sell Stop. После срабатывания отложенного ордера...
 
Vladimir Karputov:

Thanks.

But you can always fix the code yourself or download version 1.005 from the Russian part of the forum: https://www.mql5.com/ru/code/21452

Of course, thanks for your work.
 
lippmaje :
Of course. Thanks for your work. Of course, thanks for your work.

In version 1.005, I also added insurance: checking the current price and the price of a pending order.

 

The inputs ExtDepth, ExtDeviation, ExtBackstep are not evaluated. This line should be changed:

   handle_iCustom=iCustom(m_symbol.Name(),Period(),"Examples\\ZigZag");

to

   handle_iCustom=iCustom(m_symbol.Name(),Period(),"Examples\\ZigZag",ExtDepth,ExtDeviation,ExtBackstep);


Furthermore, the start/stop time inputs are not evaluated, except for a validity check in OnInit(). So the user has no control over trading time although the inputs suggest otherwise.

 
lippmaje :

The inputs ExtDepth, ExtDeviation, ExtBackstep are not evaluated. This line should be changed:

to


Furthermore, the start/stop time inputs are not evaluated, except for a validity check in OnInit(). So the user has no control over trading time although the inputs suggest otherwise.

1.006 Now the time settings work

input string      ____2___          = "Время работы советника";
input bool        InpTimeControl    = true;           // Use time control
input uchar       InpStartHour      = 10;             // Start Hour
input uchar       InpStartMinute    = 01;             // Start Minute
input uchar       InpEndHour        = 15;             // End Hour
input uchar       InpEndMinute      = 02;             // End Minute


And work:

handle_iCustom=iCustom(m_symbol.Name(),Period(),"Examples\\ZigZag",ExtDepth,ExtDeviation,ExtBackstep);

In addition, you can set the time inside the day and the time with the transition to another day (Russian part of the forum: https://www.mql5.com/ru/code/21452).

ZigZag EA
ZigZag EA
  • www.mql5.com
Опубликовал: Vladimir Karputov Просмотров: 1112 Рейтинг: Опубликован: 2018.07.17 14:49 Обновлен: 2020.02.01 10:24 Советник использует данные с пользовательского индикатора "ZigZag". По данному индикатору определяется канал, и по границам канала выставляются отложенные ордера Buy Stop и Sell Stop. После срабатывания отложенного ордера...