I don't really understand the order execution modes, alpari broker, i think everything is standard. Damn, it's not working, I just don't want to do it. I looked at the order sl and tp, it showed the current price + sl. I do not know what is the norm!
Even in this form on the server MQ errors in the tester does not occur:
inputint StopLoss =499; // Stop Lossinputint TakeProfit =999; // Take Profitinputint EA_Magic =12345; // Magic Number советникаinputdouble Lot =0.1; // Количество лотов для торговли//---MqlTick latest_price; // Будет использоваться для текущих котировокMqlTradeRequest mrequest; // Будет использоваться для отсылки торговых запросовMqlTradeResult mresult; // Будет использоваться для получения результатов выполнения торговых запросов//---int STP = StopLoss;
int TKP = TakeProfit;
//+------------------------------------------------------------------+//| ИНИЦИАЛИЗАЦИЯ |//+------------------------------------------------------------------+intOnInit()
{
//--- Для работы с брокерами, использующими 5-ти значные котировки,// умножаем на 10 значения SL и TP
STP = StopLoss;
TKP = TakeProfit;
if(_Digits==5 || _Digits==3)
{
STP = STP*10;
TKP = TKP*10;
}
return(0);
}
//+------------------------------------------------------------------+//| ДЕИНИЦИАЛИЗАЦИЯ |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
}
//+------------------------------------------------------------------+//| СОБЫТИЕ ТИК ТЕКУЩЕГО СИМВОЛА |//+------------------------------------------------------------------+voidOnTick()
{
SymbolInfoTick(Symbol(),latest_price); // Получаем текущие цены//---
mrequest.action = TRADE_ACTION_DEAL; // немедленное исполнение
mrequest.price = NormalizeDouble(latest_price.ask,_Digits); // последняя цена ask
mrequest.sl = NormalizeDouble(latest_price.ask - STP*_Point,_Digits); // Stop Loss
mrequest.tp = NormalizeDouble(latest_price.ask + TKP*_Point,_Digits); // Take Profit
mrequest.symbol = _Symbol; // символ
mrequest.volume = Lot; // количество лотов для торговли
mrequest.magic = EA_Magic; // Magic Number
mrequest.type = ORDER_TYPE_BUY; // ордер на покупку
mrequest.type_filling = ORDER_FILLING_FOK; // тип исполнения ордера - все или ничего
mrequest.deviation=100; // проскальзывание от текущей цены//--- отсылаем ордерOrderSend(mrequest,mresult);
}
//---
If it turns out that the matter is in the execution modes, then approximately so should be done:
// В режиме Instant Execution позицию можно открыть// сразу с установленными уровнями Stop Loss и Take Profitif(smb.trade_exec==SYMBOL_TRADE_EXECUTION_INSTANT)
{
// Если позиция не открылась, вывести сообщение об этомif(!trd.PositionOpen(_Symbol,type_ord,lot,oprice,sl,tp,comment))
{ Print("Ошибка при открытии позиции: ",GetLastError()," - ",ErrorDesc(GetLastError())); }
}
//---// В режиме Market Execution сначала нужно открыть позицию и// только после этого можно установить уровни Stop Loss и Take Profitif(smb.trade_exec==SYMBOL_TRADE_EXECUTION_MARKET)
{
// Если позиции нет, то сначала откроем позицию// а затем установим Stop Loss и Take Profitif(!pos.exist)
{
// Если позиция не открылась, вывести сообщение об этомif(!trd.PositionOpen(_Symbol,type_ord,lot,oprice,0,0,comment))
{ Print("Ошибка при открытии позиции: ",GetLastError()," - ",ErrorDesc(GetLastError())); }
else
{// Если позиция открылась, то сначала выберем её и...if((pos.exist=PositionSelect(_Symbol))) // ...если позиция есть, то...
{
// ...установим Stop Loss и Take Profitif(!trd.PositionModify(_Symbol,sl,tp))
{ Print("Ошибка при модификации позиции: ",GetLastError()," - ",ErrorDesc(GetLastError())); }
}
}
}
else
{// Если позиция есть, то увеличим её объём и// оставим Stop Loss и Take Profit на их прежнем уровне// Если позиция не открылась, вывести сообщение об этомif(!trd.PositionOpen(_Symbol,type_ord,lot,oprice,sl,tp,comment))
{ Print("Ошибка при открытии позиции: ",GetLastError()," - ",ErrorDesc(GetLastError())); }
}
}
Данная статья, построенная в форме справочника по функциям MQL4, призвана помочь переходу с MQL4 на MQL5. Для каждой функции языка MQL4 приведено описание и представлен способ ее реализации на MQL5, что позволит вам значительно ускорить перевод своих программ с MQL4 на MQL5. Для удобства функции разбиты на группы, как в документации по MQL4.
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Первое, что следует отметить и принять как должное, это отсутствие локов - встречных позиций. Пожалуй, это основное, что вызывает у части трейдеров недоумение и, возможно, разочарование, в то время как для тех, кто торгует без локов, это изменение вполне закономерно и логично. Если мы обратимся к другим профессиональным платформам, то увидим...
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I zeroed out via ZeroMemory(mrequest);
I don't really understand the order execution modes, alpari broker, i think everything is standard. Damn, it's not working, I just don't want to do it. I looked at the order sl and tp, it showed the current price + sl. I do not know what is the norm!
Even in this form on the server MQ errors in the tester does not occur:
//---
If it turns out that the matter is in the execution modes, then approximately so should be done:
how to write it shorter in MQL5?
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Thanks.
http://www.profi-forex.org/journal/number17/page8.html#prettyPhoto
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Thanks.
http://www.profi-forex.org/journal/number17/page8.html#prettyPhoto
The news that comes in is the mail tab.
The calendar is also there.
You can only see them if you connect to a real mt5 account
mzk_3om6u:
Can you please tell me where is the economic calendar in MT5? I can't find it in mine (there is news that comes non-stop every 1 to 5 minutes exactly, all different).
Thanks.
From the Terminal Help(F1):
This tab may be missing if the economic calendar is disabled on the trade server.
>>> Calendar
Can you please tell me where is the economic calendar in MT5...?
A broker may not provide a calendar, accordingly, a particular broker may not have one. It seems like this.
Good afternoon.
Where can I ask a question in relation to schedule changes.
An example of this.I have already checked the schedule for manual control by the company on several occasions and it is often confirmed.
Write a link to this question! Thank you.
Good afternoon.
Where can I ask a question in relation to schedule changes.
An example of this.I have already checked the schedule for manual control by the company on several occasions and it is often confirmed.
Please send me a link to this question.
Please decipher. What do you mean? History, trades, charting...?
To start with, in any case - to the technical support of the company. With proof (screenshots, logs).
Greetings.
Can you tell me if it is possible in principle to write a script to transfer candlestick chart data to an Excel file?