Questions from a "dummy" - page 191

 
Desead:
advise, mqt4 has mqt files of initial templates, and where are similar templates in 5?
no
 

who knows - what effect or return property is used to distinguish ChartID of a real chart from a chart-object?

 
Can you tell me if MetaEditor 5 has a function for comparing 2 codes so that you can see the differences in their code? Sort of like comparing two Word files in Office.
 
paladin800:
Can you tell me if MetaEditor 5 has a function for comparing 2 codes so that you can see the differences in their code? Sort of like comparing two Word files in Office.
dream id.... i dream about it too.
 

I drew up an indicator that should count the number of day's opening price crossovers:

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
//--- plot open
#property indicator_label1  "open"
#property indicator_type1   DRAW_HISTOGRAM
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2

//--- indicator buffers
double         Buffer[];
int lastday,countcross;
double opendayprice;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit(){
   SetIndexBuffer(0,Buffer,INDICATOR_DATA);
   lastday = -1;
   countcross = 0;
return(0);
}
//+------------------------------------------------------------------+
//| 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 i,start;
      MqlDateTime nowtime;
      if(prev_calculated==0) start=0; else start=prev_calculated-1;
      for(i=start;i<rates_total;i++){
            TimeToStruct(time[i],nowtime);
            if(nowtime.day != lastday){
                  lastday = nowtime.day;
                  countcross = 0;
                  opendayprice = open[i];
                  continue;
            }
            if(opendayprice<=high[i]&&opendayprice>low[i]) countcross++;
            Buffer[i] = countcross;
      }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
seems to count correctly on M1, but doubts about the correct calculation of zero and the first bar
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
 

In quadruple is

OrderType()==6

How can I find out the amount of withdrawals and deposits here?

Thank you.

 
G001:

In quadruple is

How can I find out the amount of withdrawals and deposits here?

Thank you.

Similar. there is also a transaction type for withdrawal.

Read the manual.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок - Документация по MQL5
 
sergeev:

similar. there is also a deal type for withdrawal.

read the manual.

Thank you.
 
//+------------------------------------------------------------------+
double MaxAllowedLot()
{
//-----
  double MaxLotAllowed;
//-----
  double MinLot      = MarketInfo(Symbol(),MODE_MINLOT);
  double MaxLot      = MarketInfo(Symbol(),MODE_MAXLOT);
  double MeansOneLot = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
  double MeansFree   = AccountFreeMargin();
//----- Lots Digits
  int LotsDigits;
  if(MinLot==0.0001) LotsDigits = 4;
  if(MinLot==0.001)  LotsDigits = 3;
  if(MinLot==0.01)   LotsDigits = 2;
  if(MinLot==0.1)    LotsDigits = 1;
//----- Maximum Allowed Lot Size
  MaxLotAllowed = NormalizeDouble((MathFloor((MeansFree/MeansOneLot)*100)/100),LotsDigits);
  if(MaxLotAllowed >= MinLot && MeansOneLot > 0) {MaxLotAllowed = MaxLotAllowed;}
  else MaxLotAllowed = 0;
//-----
  return(MaxLotAllowed);
}

How to transfer for a fiver if there is no

MarketInfo(Symbol(),MODE_MARGINREQUIRED)

Thank you.

 
G001:

How to transfer for a fiver if there is no

Thank you.

forum search works.

for example here https://www.mql5.com/ru/forum/1111/page4