Questions from a "dummy" - page 182

 

Folks, who's oriented on the question: inclusion of header files in a C++ project (all classes are embedded, i.e. have no cpp file)?

Ideally, make the inclusion so that everything is visible from everywhere.

 

How can I programmatically determine that stops cannot be placed on the market only when an order is modified?

 
solandr:

I can't figure out why the Print function outputs 0 instead of 40?

The attentive reader of the documentation will notice that:

SetDeviationInPoints - Sets the allowable slippage.

RequestDeviation - Gets the maximum deviation from the requested price used in the last request.

 
muallch:

Help, I can't find any information anywhere.

How can I find out the weighted average opening price of a position after several trades? PriceOpen() from CPositionInfo shows the price of the first trade, but I need the current price, obtained after several trades.

The weighted average is what it shows. And what could be the opening price of a position?
 
When compiling the EA, there is a warning:
possible loss of data due to type conversion
int DIGITS=SymbolInfoInteger(SymbolInfoInteger(_Symbol,SYMBOL_DIGITS);что не так? По идее SYMBOL_DIGITS есть переменная типа int


Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - Документация по MQL5
 
Ukagir:

When you compile the Expert Advisor, you get a warning:
possible loss of data due to type conversion

1. why SymbolInfoInteger(SymbolInfoInteger twice ?

2. What type of value does SymbolInfoInteger() return according to the Reference Manual?

 

3. See type listing

(int)SymbolInfoInteger(_Symbol,SYMBOL_DIGITS)
 

Why does the Print function print 0?

//+------------------------------------------------------------------+
//|                                               test_deviation.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"

#include <Trade\SymbolInfo.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   CSymbolInfo symbol_info;
   symbol_info.Name("EURUSD");
   Print("MarginMaintenance=",symbol_info.MarginMaintenance());
  
  }
//+------------------------------------------------------------------+
Документация по MQL5: Общие функции / Print
Документация по MQL5: Общие функции / Print
  • www.mql5.com
Общие функции / Print - Документация по MQL5
 
solandr:

Why does the Print function print 0?

https://www.mql5.com/ru/forum/1111/14665#comment_14665 The MarginMaintenance() method just returns the value SYMBOL_MARGIN_MAINTENANCE.
 
This is a characteristic of futures contracts and does not apply to forex instruments.
Reason: