Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1666

 
MakarFX #:

That's right, just fix it in the comments

It's not clear why...

Makar it is not clear how it can be correct if the profit in currency and the profit in pips in the zero point do not coincide

 
EVGENII SHELIPOV #:

Makar it is not clear how it can be correct if the profit in currency and the profit in pips at zero point do not coincide

You're taking into account swap and commission, maybe that's the problem... I haven't looked that deeply
 
MakarFX #:
If you are calculating profit including swap and commission, maybe that's the problem... I did not look that deeply

Makar I feel I'm doing something wrong.

I had a different question how to add some points like take profit but in a virtual point to the calculated result of min and max orders to the breakeven point.

 
EVGENII SHELIPOV #:

Makar I feel I'm doing something wrong.

I had a different question how to add some points to the calculated result of profit min and max orders to the breakeven point like takeprofit but in a virtual point.

//-------------------------------------------------------------------+  Команда на закрытие мин и макс ордеров в сетке
   if(CalculiteProfitMinMaxOrder() >= 0 && Drawdown > DrawdownClosingMinMaxOrders)
      ClosseMinMaxOrders();

In this place you should set the amount at which you want to close

 
MakarFX #:

At this point put the amount at which to close

Yes Makar, I would like to have a "figure" like a take profit in pips which can be optimised.

 
EVGENII SHELIPOV #:

Yes Makar, I would like to have a "figure" like a take profit in pips which can be optimized.

Then find the open prices min/mac, add them and divide by 2. If you buy, add points*Point to the obtained result,

and if selling subtract

 
SanAlex #:

Here - something needs to be reviewed, the stop profit and stop loss on the bit is not set correctly

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

No, stops are fine - so the lot function is not counting the lots correctly

This one showed up today. No errors.

Screenshot 2021-10-10 212320

Files:
 
Taras Slobodyanik #:

If there is no error check when modifying, how can we be sure that the order has changed?

And if there is an error check, what is the point of the array?

There is a check:
bool order = OrderModify( ... );
          if(order) {
          ...
}
>) And if there is an error check, what is the point of an array?

to know which order has changed :)))
 
Nerd Trader #:

By the way, do you happen to know why the following error occurs periodically? For 100 successfully opened orders, there are about 10 of these.

order.sl_price: 2.813499706815862e-262 - stop price, clearly this number should not be.
4051 - "Invalid value of function parameter"
- is this the order type? Shouldn't be a problem with that either.

Don't you want to get rid of the classes?
 
MakarFX #:
Don't you want to get rid of the classes?

+100500