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

 

I've been coming to you a lot!

Colleagues, I'm looking for some kind of quick analysis, a plug-in, an Internet resource, a utility, anything, where it would be possible to quickly (time is most important) analyse all the issuers on the exchange, because there are about 200-400 of them. But to choose from an array of 5-10 instruments to trade on the day in addition to popular currency pairs - stocks, indices, cryptocurrency, etc. For example, I attach three charts and the program needs to select similar charts for the last week, such as the one with a green check mark, sorted and does not offer those that are similar with a red cross mark.

Files:
zuq.png  40 kb
p51a6.png  54 kb
30i0i2.png  51 kb
 
Порт-моне тв:

I've been coming to you guys a lot!

Colleagues, I'm looking for some kind of quick analysis, a plug-in, an Internet resource, a utility, anything, where it would be possible to quickly (time is most important) analyse all the issuers on the exchange, because there are about 200-400 of them. But to choose from an array of 5-10 instruments to trade on the day in addition to popular currency pairs - stocks, indices, cryptocurrency, etc. For example, I attach three charts and I need the program to select similar charts for the last week, for example, the one with green tick, sort them and not offer those that are similar to them with a red cross.

They say corporations have powerful AI. You have incentive to check it out, ask Alice)

But seriously, there are a lot of screeners, but they do not filter chart pattern, but simpler and more formalized indicators - above/below EMA14 on D1. The week is green or red, etc.

 

Hello.

Can you please tell me how to link the indicator readings (each bar of the histogram) to the opening of an hour candle on the minute charts.

#property strict
#property indicator_separate_window
//---
#property indicator_buffers 1
#property indicator_level1     0
#property indicator_levelcolor clrSilver
#property indicator_levelstyle STYLE_DOT
#property indicator_color1 clrLightSkyBlue
//---
input int        countHour     = 5;

datetime openHour = 0;

double buffer_1[];
double prop;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID);
   SetIndexBuffer(0, buffer_1);

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   for(int i=5000; i>=0; i--)
     {
      double dfa = 0;
              for(int j=0; j<countHour; j++)
                       dfa +=(iHigh(NULL, PERIOD_H1, i+j) - iLow(NULL, PERIOD_H1, i+j));
              buffer_1[i] = dfa/countHour;
     }

   return(rates_total);
  }
//+------------------------------------------------------------------+

I don't seem to be able to do it))) What am I doing wrong? It draws a histogram bar (average volatility per hour) under each candle on M1, M5, etc.

Документация по MQL5: Общие функции / TesterHideIndicators
Документация по MQL5: Общие функции / TesterHideIndicators
  • www.mql5.com
Задает режим показа/сокрытия индикаторов, которые используются в эксперте. Функция предназначена для управления видимостью используемых индикаторов только при тестировании. По умолчанию на графике визуального тестирования показываются все индикаторы, которые создаются в тестируемом эксперте.  Также эти индикаторы показываются на графике...
 
Madmas:

Hello.

Can you please tell me how to link the indicator readings (each bar of the histogram) to the opening of an hour candle on the minute charts.

I don't seem to be able to do it))) What am I doing wrong? It draws a histogram bar (average volatility per hour) under each candle on M1, M5, etc.

I'm not sure I understand your speech correctly...

Is that what you want?


 
Порт-моне тв:
Who else can help? How to make a pause in ticks or candlesticks (bars), not to fall asleep (Sleep), namely, for example, after closing a deal 100 bars do not trade, do nothing, so that the function works in the tester and on the real.
Is the question still relevant?
 
MakarFX:

I'm not sure I understood your speech correctly...

is that what you want?


Yeah. Can I see the code? ))))
 
Madmas:
Yeah. Can I see the code? ))))

Except it doesn't work in the tester...and I don't know why(

#property strict
#property indicator_separate_window
//---
#property indicator_buffers 1
#property indicator_level1     0
#property indicator_levelcolor clrSilver
#property indicator_levelstyle STYLE_DOT
#property indicator_color1 clrTeal
//---
input int        countHour     = 5;

datetime openHour = 0;

double buffer_1[];
int index1=-1;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID);
   SetIndexBuffer(0, buffer_1);

   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int limit=rates_total-prev_calculated-countHour-1;
  
   for(int i=limit;i>=0;i--)
     {
      if(TimeSeconds(time[i])==0)
      index1=iBarShift(Symbol(), PERIOD_H1, time[i], false);
      double dfa = 0;
      for(int j=0; j<countHour; j++)
      dfa +=(iHigh(NULL, PERIOD_H1, index1+j) - iLow(NULL, PERIOD_H1, index1+j)); 
      
              buffer_1[i] = dfa/countHour;
     }

   return(rates_total);
  }
//+------------------------------------------------------------------+
 
MakarFX:
Is the question still relevant?
Yes.
 
Порт-моне тв:
Yes.
show your order closing code
 
MakarFX:

Only in the tester it doesn't work...and I don't know why(

Thank you very much
Reason: