[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 62

 
md4RM:
guys ... I searched the net... and couldn't find it ...

I need an idea how to make mql4 give me the price of a particular bar for a particular currency ... while on a different currency pair ...

help ... thanks in advance ...
i searched the site i had an idea look in the help on the site i gave an answer to the question in the help who needs more ideas look in the help you can look in the editor all the ideas there please on any other currency pair
 

There is a code:

double PERIOD=1.0;  
double result=1.0;    
int i=0;             
 
while(result!=0.0)   
{                
   if (iMA(NULL,0,PERIOD,0,MODE_SMA,PRICE_CLOSE,0) < A)
   result=1;                                                
   if (iMA(NULL,0,PERIOD,0,MODE_SMA,PRICE_CLOSE,0) > A)
   result=0;                                                 
   
   PERIOD+=1;                                               
   i++;                                                       
}
   res=OrderSend(Symbol(),OP_SELL,LotsOptimized(),Bid,3,0,0,"",MAGICMA,0,Red);
   return;
Here PERIOD, as I understand it, will be searched starting from 1, but the upper limit is not specified. So, how can I specify that, for example, it will only search up to 20?
 
men ... Thank you ... Blessings from God
 

double iClose( string symbol, int timeframe, int shift)



How to make it so that instead of "int timeframe" ... is the current period ...

 

How do you make the "int timeframe" ... is the current period ...

just put 0
 
md4RM:

double iClose( string symbol, int timeframe, int shift)



How to make it so that instead of ""int timeframe" ... is the current period ...


Read to the end of the links you've been given (I repeat):

https://docs.mql4.com/ru/series/iopen

timeframe - Period. Can be one of the periods of a graph. 0 means the period of the current graph.
 
lottamer:


How about more complicated?

....


You already figured it out yourself)) The operators nested in the while loop end in parentheses, i.e. only the print operator works in the loop

Try it this way:

if ( ...)    {My_buy (); return;}

else while (a>0)

  { Print("no BUY entry");  

 if ( a<0) {My_buy ();} 
} 
 

Hello!

Could you tell me how to convert int to string?

The main thing from string to int can be done, but they forgot to think of a way back.

 
SvSerg:

Hello!

Could you tell me how to convert int to string?

The main thing from string to int can be done, but they forgot to think of a way back.


Good day!

"... but they forgot to make it back."

Of course, everything is always the WORLD'S FIRST fault - the PLANNERS!

Who did they make this for?

string DoubleToStr( double value, int digits) 
Преобразование числового значения в текстовую строку, содержащую символьное представление числа в указанном формате точности. 
Параметры:
value   -   Величина с плавающей точкой. 
digits   -   Формат точности, число цифр после десятичной точки (0-8). 

Пример:
  string value=DoubleToStr(1.28473418, 5);
  // содержимое строки value - "1.28473"



 
Usual_Trader:


You've already figured it out yourself)) You have operators nested in the while loop ending with a parenthesis, i.e. only the print operator works in the loop

Try it this way:


a>0 will not work, because the a<0 condition inside the operator will NOT be fulfilled. And when"a" becomes below zero, the loop will be terminated at all and the action I need in the operator will not be executed...
Reason: