Questions from Beginners MQL5 MT5 MetaTrader 5 - page 739

 
I'm sorry in advance. It's been 7-8 years since I last programmed. I decided to write an EA. I use several timeframes in my trading. How can I insert data from another timeframe into one timeframe I'm trading, which provides a bigger picture?
 
vvu78:
My apologies in advance... my last time I programmed about 7-8 years ago, I decided to write an EA. In my trade I use several timeframes. How to insert data from another timeframe, which reports the overall picture, into one timeframe, on which I trade?


Use the Copyxxx functions:

Where you set the required timeframe. Also useful links:Organisation of dataaccess

 
Vladimir Karputov:


Use the Copyxxx functions:

Where you set the required timeframe. Also useful links:Organizing dataaccess


thanks)
 

Hello, dear forum members, I am facing the following problem in Metatrader 5. When inserting a resource with the command

#resource"<resource_file_path>".


The quality of BMP image is lost. All sorts of dots appear on the image when inserting it as an OBJ_BIYMAP_LABEL object.

Who has encountered such a problem, and more importantly, how has this problem been solved?

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

In mq4 PERIOD_H1 returns 60, what about in mq5 ?

SL=SL_Start*(PERIOD_H4/P);
 
Nikolay Gaylis:

In mq4 PERIOD_H1 returns 60, what about in mq5 ?


PeriodSeconds

PeriodSeconds Returns the number of seconds in a period. int PeriodSeconds ( ENUM_TIMEFRAMES period=PERIOD_CURRENT // chart period ); Parameters period=PERIOD_CURRENT [in] Value of the chart period from enumeration ENUM_TIMEFRAMES. If the parameter is not specified, the number of seconds of the current chart period, at which the program is running, is returned. Returned value Number of seconds in the specified period. See also _Period, Graph periods, Date and time, Object visibility https://www.mql5.com/ru/docs/common/periodseconds

 
Vladimir Karputov:


PeriodSeconds

PeriodSeconds Returns the number of seconds in a period. int PeriodSeconds ( ENUM_TIMEFRAMES period=PERIOD_CURRENT // graph period ); Parameters period=PERIOD_CURRENT [in] Value of graph period from ENUM_TIMEFRAMES enumeration. If the parameter is not specified, the number of seconds of the current chart period, at which the program is running, is returned. Returned value Number of seconds in the specified period. See also _Period, Graph periods, Date and time, Object visibility https://www.mql5.com/ru/docs/common/periodseconds


Thank you! And how to get back the value of period by received seconds?

ENUM_TIMEFRAMES P;
P_sec=PeriodSeconds(P);
if(NEWBAR(S,P_sec)==true)
  {
  }

bool NEWBAR(string Sy,int Pe)
  {
   if(progon==false && time_bar[s_s]<TimeCurrent()-Pe)
     {
      CopyTime(Sy,Pe,0,1,time_bar_x);
      time_bar[s_s]=time_bar_x[0];
      progon=true;
        }else {progon=false;
     }
   return(progon);
  }

Pe variable should be converted somehow toCopyTime

 

although okay...I'll use P straight away before sending to a function that

ENUM_TIMEFRAMES P;
P_sec=PeriodSeconds(P);
if(NEWBAR(S,P_sec)==true)
  {
  }

bool NEWBAR(string Sy,int Pe)
  {
   if(progon==false && time_bar[s_s]<TimeCurrent()-Pe)
     {
      CopyTime(Sy,P,0,1,time_bar_x);
      time_bar[s_s]=time_bar_x[0];
      progon=true;
        }else {progon=false;
     }
   return(progon);
 

Guys,remaking from mq4 to mq5- the results are completely different I don't understand- can you please compare the values of the indicator I get in the same way?

MQ4

         RSI1=iRSI(S,P,rsi_p,PRICE_MEDIAN,i_RSI);
         RSI2=iRSI(S,P,rsi_p,PRICE_MEDIAN,i_RSI+1);
         if(RSI2>50&&RSI1<50){}

MQ5

RSI_handle=iRSI(S,P,rsi_p,PRICE_CLOSE);
CopyBuffer(RSI_handle,0,0,100,RSI);
ArraySetAsSeries(RSI,true);
if(RSI[1+i_RSI]>50&&RSI[i_RSI]<50){}
As I was writing I sawPRICE_MEDIAN andPRICE_CLOSE, but apart from that?
Reason: