Questions from Beginners MQL4 MT4 MetaTrader 4 - page 104

 

Why does the tester always stop at one date when testing, but in the log it writes this:

2017.11.11 10:08:50.058 2017.07.11 00:00:00 mslTorg20 OnTester returns 0.000000000000000000


 
msl271170:

Hi all.

How do I get rid of the following comment when compiling:

possible use of uninitialized variable 'SL1'

SL1=0;

 
Nauris Zukas:

SL1=0;


Thank you, that helps.

Also, can you tell me please,

which sign means either

if (a or b)

 
msl271170:

Thank you, that helps.

Also, can you tell me please,

what sign means either

if (a or b)


if (a || b)
 
Alekseu Fedotov:


I thought it was an "E."

what's the "E" sign then?

 

already found it, thank you.

 

Is there any way to set up a chart to open with the correct timeframe on the open button? Thank you

 

We have the simplest code

#import "stdlib.ex4"
string DoubleToStrMorePrecision(double number, int precision);
#import

double a = 1.15, b=100.0;
double e = a * b;
Alert(" e="+DoubleToStrMorePrecision(e,16)+","+DoubleToStr(e,8));

Alert outputs

Alert: e=114.9999999999999858,115.00000000

How come?

 

Greetings!

Can you tell me how to delete a pending order on a previous candlestick if I need to reopen the pending order on a new one?

A new bar is defined as

 static datetime New_Time=0;                  // Время текущего бара
 New_Bar=false;                               // Нового бара нет
  if(New_Time!=Time[0])                        // Сравниваем время
     {
    
      New_Time=Time[0];                         // Теперь время такое
      New_Bar=true;                             // Поймался новый бар
     }

I set the pending order in this way

if ( New_Bar )

{
  

OrderSend(Symbol(),OP_BUYSTOP,NormalizeDouble(Lotpers,5),Ask+OrderStep*Point,100,0,0,NULL,MagicNumber,0,clrNavy);
mql4
Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Andrei: We have the simplest code. Alert outputs

Alert: e=114.9999999999999858,115.000000 How so?

Numbers in computer memory are represented in binary code, in which we are used to exactly decimal numbers in general case it is difficult to represent them. If you round the left number to 8 decimal places, you will get the right number. Get used to it...
Reason: