Вычисляет размер маржи, необходимой для указанного типа ордера на текущем счете и при текущем рыночном окружении без учета текущих отложенных ордеров и открытых позиций. Позволяет оценить размер маржи для планируемой торговой операции. Значение возвращается в валюте счета. [out] Переменная, в которую...
Why is it so: Help for theCTrade trade class, e.g. openingBuy position
Successful termination of Buy(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request execution (trade serverreturn code) by callingResultRetcode() method as well as value returned byResultDeal() method.
BUT! Even this check will not be enough since only OnTradeTransaction() allows to get transactionTRADE_TRANSACTION_DEAL_ADD - adding a trade to history.
In general, a set is required - send trade request via CTrade, check for success at once and wait for theTRADE_TRANSACTION_DEAL_ADD transaction in OnTradeTransaction().
I tried different variants of SymbolInfoDouble(symbol, ...) function in MQL5, I can't find the right variant, it returns 0 everywhere.
boolOrderCalcMargin(
ENUM_ORDER_TYPE action, // тип ордера string symbol, // имя символа double volume, // объем double price, // цена открытия double& margin // переменная для получения значения маржи
);
Why so: Read theCTrade reference, e.g. opening aBuy position
BUT! Even this check will not be enough since only in OnTradeTransaction() we can get transactionTRADE_TRANSACTION_DEAL_ADD - adding a trade to history.
In general, we need a set - send trade request via CTrade, immediately check for success and then wait for transactionTRADE_TRANSACTION_DEAL_ADD in OnTradeTransaction().
Can you tell me if there is an indicator that would make a mark on candles that have passed 10 pips in a very short time? Well, let's say, to identify impulses. Preferably, it should be drawn directly on the chart on this very candle, and not in a basement indicator
Данная библиотека является несколько переработанной версией замечательного скрипта 2006 года с учетом современных реалий MQL. Некоторые возможности убраны, некоторые - добавлены. В обеих платформах (MetaTrader 4/5) для сохранения отчета (в виде MetaTrader 4) можно запустить такой скрипт: и увидеть в соответствующем файле сформированный...
Use OnTradeTransaction().
I trade through the CTrade bible
Please suggest an analog of MQL4 function MarketInfo(asymbol, MODE_MARGIN_REQUIRED) in MQL5.
I need to getthe amount of free funds needed to open 1 lot to buy.
I tried different variants of SymbolInfoDouble(symbol, ...) function in MQL5, I can't find the right variant, it returns 0 everywhere.
Here, but I use fxsaber function like this
I trade through the CTrade bible
Correct answer:
Forum on trading, automated trading systems and trading strategy testing
FAQ from Beginners MQL5 MT5 MetaTrader 5
Alexey Kozitsyn, 2020.03.03 17:28
Use OnTradeTransaction().
Why is it so: Help for theCTrade trade class, e.g. openingBuy position
BUT! Even this check will not be enough since only OnTradeTransaction() allows to get transactionTRADE_TRANSACTION_DEAL_ADD - adding a trade to history.
In general, a set is required - send trade request via CTrade, check for success at once and wait for theTRADE_TRANSACTION_DEAL_ADD transaction in OnTradeTransaction().
Please suggest an analog of MQL4 function MarketInfo(asymbol, MODE_MARGIN_REQUIRED) in MQL5.
I need to getthe amount of free funds needed to open 1 lot to buy.
I tried different variants of SymbolInfoDouble(symbol, ...) function in MQL5, I can't find the right variant, it returns 0 everywhere.
Correct answer:
Why so: Read theCTrade reference, e.g. opening aBuy position
BUT! Even this check will not be enough since only in OnTradeTransaction() we can get transactionTRADE_TRANSACTION_DEAL_ADD - adding a trade to history.
In general, we need a set - send trade request via CTrade, immediately check for success and then wait for transactionTRADE_TRANSACTION_DEAL_ADD in OnTradeTransaction().
thanks
In what format should the time for StringToTime() be?
Suppose I run genetic optimisation - how do I see the transaction log for each pass?
Pass through frames. Ready-made solution here.