Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 577

 
Evgeniy Oshurkevich:

Greetings all! I'm having a problem creating my first indicator. I have only ever created Expert Advisors before. I have never learned how to use textbook, someone sent me a simple Expert Advisor and I started poking around, and then I got hooked. This was 5-7 years ago. Now I was eager to create an indicator. Again, I went to the tutorial and documentation. I'm so dumb there, it's like it's not in my language.

The problem is to create an indicator that will show the maximum number of bullish and bearish candles. Tell me at least where to start. Or give me some indicator similar to this one.

https://www.mql5.com/ru/code/19416

https://www.mql5.com/ru/code/19418

Candle_row
Candle_row
  • votes: 15
  • 2017.11.22
  • Vitaly Muzichenko
  • www.mql5.com
Индикатор отслеживает непрерывную последовательность баров одного направления и ставит на них метки. В индикаторе есть Alert для оповещения при последовательном направлении N-свечей. mCandle_row - только в главном окне. sCandle_row - с графиком в подокне. Входные параметры Font size arrow - размер шрифта; Bull arrow candle - цвет Bull...
 

OHHHHHHHHH! Thank you!!!

 

can't find a clean (non-brokered) MT4, please give me a link

 
PAzar:

I can't find clean (not brokerage) MT4, please give me the link

Forum on trading, automated trading systems & strategy testing

New version of MetaTrader 4 build 1090

Alexey Viktorov, 2017.07.17 08:51

Send him two files from your mt4

1. terminal.exe

2. metaeditor.exe

Further actions

1. Create a directory at the desired location on the desired drive.

2. Put these 2 files there.

3. Create a shortcut to terminal.exe with the /portable switch if desired.

4. Run the terminal using the created shortcut and in the box. All necessary files and folders are created and all EAs, indicators and scripts are loaded.

5. Login to the account or register a new demo account.

ALL...


Or in this message.
Помогите!!! MT4 при установке требует прокси сервер
Помогите!!! MT4 при установке требует прокси сервер
  • 2018.05.31
  • www.mql5.com
Помогите узнать решение этой вечной долбанной проблемы о которой уже писано переписано, но ни одного реально внятного ответа я так нигде и не нашел...
 
Good afternoon, please help to write a function with the selection of the symbol "open no more than two signals on an m5 candle"
 
Alexey Viktorov:

Second option.

Thank you.

Taras Slobodyanik:

If rounding down, then you have to do +1 for the calculation to be correct.

Thank you.

Aim for no tick, alert. No alert, what is wrong?

#property strict
//--- input parameters
input int s_clo=2;
input int Period_=13,
Shift_=0;
input     ENUM_MA_METHOD Method_MA_=MODE_SMA;
input ENUM_APPLIED_PRICE Apply_to_=PRICE_CLOSE;
double ma_fast;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(60);

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
ma_fast=0;
   if(SecondsToCandleClose(Symbol(),0)<=s_clo){ ma_fast=ma(Period_,Shift_,Method_MA_,Apply_to_,0); Alert("a",ma_fast);}
   Comment("ma_fast ",ma_fast);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
long SecondsToCandleClose(const string symbol_name,const ENUM_TIMEFRAMES timeframe)
  {
   datetime array[];
   return(CopyTime(symbol_name,timeframe,0,1,array)==1 ? PeriodSeconds(timeframe)+array[0]-TimeCurrent() : 0);
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   RefreshRates();
   OnTick();
  }
//+------------------------------------------------------------------+
double ma(int period,int ma_shift,ENUM_MA_METHOD ma_method,ENUM_APPLIED_PRICE ap_price,int shift)
  {
   return(ND(iMA(NULL,(int)0,period,ma_shift,ma_method,ap_price,shift)));
  }
  //
  double ND(double A)
  {
   return(NormalizeDouble(A,Digits));
  }
  //
 
PolarSeaman:

Thank you.

Thank you.

No tick, no alert. No alert, what's wrong?

//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   RefreshRates();
   OnTick();
  }

What's the point of all this? What's the purpose of the timer running OnTick(), which is already running with every new tick? Why would it needlessly update the data all the time? They are updated with every new tick. And their forced update is required for long calculations - then the ticks can be skipped. And data should be updated only just before execution of operations, where they are needed, and not unthinkingly in timer.

 
Artyom Trishkin:

What's all this for? What's the purpose of the timer triggering OnTick(), which is already triggered with every new tick?

So without a tick I need an alert two seconds before the bar closes.

https://www.mql5.com/ru/forum/213937#comment_5633888
Как работать в режиме OnTimer() ?
Как работать в режиме OnTimer() ?
  • 2017.08.20
  • www.mql5.com
Здравствуйте, уважаемые! Как правильно запустить советник с функцией OnTimer...
 
PolarSeaman:

So I need an alert two seconds before the bar closes without a tick.

https://www.mql5.com/ru/forum/213937#comment_5633888

So? Why would I want to run OnTick() in a timer? And why should I do a data update there?

 
Artyom Trishkin:

Why should you update the data there?

Didn't come up with it myself"Just make sure you update the data in OnTimer() to make your code work. "

How is it necessary?

Reason: