Questions from Beginners MQL5 MT5 MetaTrader 5 - page 165

 

Hello all.

In the EA program you need to perform calculations: Subtraction, division and comparison of numbers by value of type > and <. The numbers are integers from 0 to 300. Apparently they are large for this arithmetic device,

as these operations are not performed. Thearithmetic operations with prices are executed normally. By the way, the compiler doesn't generate errors. If you have encountered such a problem, please suggest a way to fix it.

I really need it.

Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
  • www.mql5.com
Основы языка / Операции и выражения / Арифметические операции - Документация по MQL5
 
Boris.45:

Hello all.

In the EA program you need to perform calculations: Subtraction, division and comparison of numbers by value of type > and <. The numbers are integers from 0 to 300. Apparently they are too big for this arithmetic device,

as these operations are not performed. Thearithmetic operations with prices are executed normally. By the way, the compiler doesn't generate errors. If you have encountered such a problem, please suggest a way to fix it.

I really need it.

Give a concrete example of a failed operation, it's not clear from what's written.
 
Boris.45:

Hello all.

In the EA program you need to perform calculations: Subtraction, division and comparison of numbers by value of type > and <. The numbers are integers from 0 to 300. Apparently they are large for this arithmetic device,

as these operations are not performed. Thearithmetic operations with prices are executed normally. By the way, the compiler doesn't generate errors. If you have encountered such a problem, please suggest a way to fix it.

I really need it.

Rounding?

 

Make it so:

MqlTradeRequest request;
ZeroMemory(request);
request.action=TRADE_ACTION_DEAL;
request.magic=0;
request.symbol=Symbol();
request.volume=Lots;
request.price=last_tick.ask;
request.sl=0.0;
request.tp=0.0;
request.deviation=slip;
request.type=ORDER_TYPE_BUY;
request.type_filling=ORDER_FILLING_FOK;
request.comment="";
MqlTradeResult result;
ZeroMemory(result);
OrderSend(request,result);
 
sandex:

Do this:

a bunch of errors are coming up...

'last_tick' - undeclared identifier

'ask' - struct or class type expected

'slip' - undeclared identifier

There was also an error on Lots, but I replaced it with Lot and one less.

 
should we just try removing the SL and TP first? Or is it not about them?
 
I gave you an example, set your own variables.
 

only added...

ZeroMemory(mrequest);

and it worked! Thank you!

 
paladin800:
Give me a concrete example of a failed operation, it is not clear from what is written.
Thank you for your attention and sorry for the inconvenience. I have found a mistake in the formation of the processing algorithm.
 

How do I connect the signal in MT5? The signal is subscribed in MQL5, but is not displayed in MT5...

Reason: