Experts: ZigZag EA - page 4

 
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. После срабатывания отложенного ордера...
 
👍
 
Vladimir Karputov :

Everything is correct. If the adviser uses indicators, then these indicators:

  • in the strategy tester: these indicators will be visible
  • in the terminal: these indicators will not be visible.
To display indicators used by the Expert Advisor in the terminal, you need to use the ChartIndicatorAdd command .

Please, I really need help to know how and where to place the ChartIndicatorAdd to see the indicators in the Expert Advisor.

 
Jackery:

Please, I really need help to know how and where to place ChartIndicatorAdd to see the indicators in the EA.

Here is where to place it:

      HLineCreate(0,"low",0,0.0,clrRed);
     }
//---
   ChartIndicatorAdd(0,0,handle_iCustom);
//---
   return(INIT_SUCCEEDED);
  }

and here:

      HLineDelete(0,"low");
     }
//---
   long  id=ChartID();
   int   indicators_total=ChartIndicatorsTotal(id,0);
//---
   for(int m=indicators_total-1; m>=0; m--)
     {
      Print(ChartIndicatorName(id,0,m));
      if(ChartIndicatorName(id,0,m)=="ZigZag")
         ChartIndicatorDelete(id,0,"ZigZag");
     }
  }
//+------------------------------------------------------------------+
//| Expert tick function|
//+------------------------------------------------------------------+
void OnTick()
 
Automated-Trading:

ZigZag EA:

Author: Vladimir Karputov

Why buying at the top? It should be the other way round - buy at the bottom and sell at the top :)
 
Igor Yeremenko:
Why buy at the top? It should be the other way round - buy at the bottom and sell at the top.)

Judging by the balance sheet, the opposite would be worse.

 
Vladimir Karputov :

Here you need to place:

and here:

Thank you. It's working now.

 
Hi
I would like to test this ea but Compiler gave errors. What is wrong?
I'm really interested in this idea, I think it's good.
 
askoxxx Elomaa :
Hi
I would like to test this ea but Compiler gave errors. What is wrong?
I'm really interested in this idea, I think it's good.

Download version 1.006 from the Russian part of CodeBase.

 

Compiler gave the same error with the Russian version of this EA!

What is wrong?