Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1525

 

What can be the error if I have this code:

void SendBuy(double lot)
{
    MqlTradeRequest request = {};
    MqlTradeResult result = {};
    double priceAsk = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits);
    request.action = TRADE_ACTION_DEAL;
    request.symbol = _Symbol;
    request.volume = lot;
    request.type = ORDER_TYPE_BUY;
    request.price = priceAsk;
    double tp = priceAsk + TakeProfit* _Point;
    if(EnableTakeProfit)
        request.tp = tp;
    else 
        request.tp = 0;
    double sl = priceAsk - StopLoss* _Point;
    if(EnableStopLoss)
        request.sl = sl;
    else 
        request.sl = 0;
    request.deviation = OrderDeviation;
    request.magic = MagicNumber;
    request.comment = "BidAskProfitEA";

    if(OrderSend(request, result)) {
    } else {
        PrintFormat("Ошибка открытия ордера Buy: GetLastError=%d, priceAsk=%g, lot=%g, tp=%g, sl=%g", GetLastError(), priceAsk, lot, tp, sl);
    }
}

2024.04.22 04:02:36.906	BidAskProfitBollEAv5.5(CounterTrend and Scalping) (XAUUSD,M1)	Buy Error: GetLastError=4752, priceAsk=2381.01, lot=0.1, tp=2391.01, sl=2371.01

if I have no other orders, MagicNumber=222222222 , OrderDeviation=500 , lot=1 on account 96 thousand USD, StopLoss==500 , TakeProfit=500 , EnableStopLoss=true , EnableTakeProfit=true


 
AkaEdie #:

what could be the error if I have this code:

https://www.mql5.com/ru/docs/constants/errorswarnings/errorcodes

ERR_TRADE_DISABLED

4752

Trading for Expert Advisor is prohibited

Документация по MQL5: Константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки времени выполнения
Документация по MQL5: Константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки времени выполнения
  • www.mql5.com
GetLastError() – функция, возвращающая код последней ошибки, которая хранится в предопределенной переменной _LastError . Значение этой переменной...
 
Oh, shit, I've been through all the code. I knew the code was OK, I forgot, sorry.
 
AkaEdie #:
Oh shit, I've already gone through all the code, I knew the code was normal, I forgot, sorry.

This is the second time I gave you a link to the documentation. The error code is in the log in the Expert Advisor messages and you wrote it here. Looking at the error and opening the help to understand the cause is faster than waiting for an answer on the forum.

 

Dear experts, a question - what are the ways to separate the so-called noise.

I have made something like a shifter. It turns on the price difference check by timer. On M1. But it makes money only on relatively long candles. If volatility is low, it reacts to all this noise and the wavelength is not enough to get out of the loss. I've been trying to find information on volatility. But don't come up with an idea on how to separate noise from long candles.

 
maxvoronin74 #:

Dear experts, the question is what are the ways to separate the so-called noise.

I have made something like a shifter. It turns on the price difference check by timer. On M1. But it makes money only on relatively long candles. If volatility is low, it reacts to all this noise and the wavelength is not enough to get out of the loss. I have been trying to find information on volatility. But don't come up with an idea on how to separate noise from long candles.

In some Vladimir Karputov's EA there was a check of price movement of X points for N number of ticks. Look in CodeBase, it may be what you are looking for.

Regards, Vladimir.

 

Good morning, I need help.

I withdrew from my Metatrader5 account directly to my personal account. Can you tell me how many days it takes to receive the money? I can't find a metatrader 5 customer support email.

Thank you

 
Marco #:

Good morning, I need help.

I withdrew from my Metatrader5 account directly to my personal account. Can you tell me how many days it takes to receive the money? I can't find a metatrader 5 customer support email.

Thank you

There is no Metatrader 5 support, MT5 is a piece of software, your trading account money is with your broker, so contact them.

MQL5.com and Metaquotes are not a broker, nor have anything to do with your trading account money.

 
Eleni Anna Branou # :

There is no support for Metatrader 5, MT5 is software, your trading account money is with your broker, so contact them.

MQL5.com and Metaquotes are not a broker, nor do they have anything to do with the money in your trading account.


Yes, that's clear thanks :-). I made the withdrawal directly from MT5 without having paid to the broker.

 
Marco #:

Yes, that's clear thanks :-). I made the withdrawal directly from MT5 without having paid to the broker.

You've made the withdrawal through the MT5 platform, but was still made through the broker, the MT5 platform is just the tool you used, is not the broker.

Contact your broker about your withdrawal please, we can't help you here.

Reason: