Errors, bugs, questions - page 139

 
stringo:

And then up to 256...

Send longer strings in several messages. You can pass the portion number in an integer parameter, the number of portions in a real parameter.

It is easier to trim text to 63. In several portions - in the tester at the moment and the standard variant glitches, and here also in several portions.... :)
 
is there such a thing as an ORDER MAGIC... or is it just a position?
 
maryan.dirtyn:
is there such a thing as an ORDER MAGIC ...or does it only relate to the position?

No, the magic number is a binding number set by the Expert Advisor. Since an order is an order to change/open a position and ends in either a trade or a rejection, the MAGIC for the order will also be assigned to the trade and the position.

Specifically by asking for an ORDER_MAGIC you will receive the magic number of the order you have chosen.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
Interesting:

As far as I understand, there are two models for trimming (partially closing) a losing position that was previously held:

1. Don't fix the loss on the partial close, but simply recalculate the opening price (if I'm not mistaken, that's what FC does);

2. leave the opening price unchanged, fixing the loss.

The same applies to reversing of losing positions.


I want to know the developers' opinion about what method will eventually be standardized in MT5, if possible why ...

Frankly speaking, I do not understand both options, because they do not fit the arithmetic. Please give us some examples so we can understand what we're talking about.
 
Rosh:
Honestly, I don't understand both, as they don't fit into the arithmetic. Please give me some examples so that I can understand what we are talking about.

A simple situation.

Introductions:

Terminals - R2 (Forex Club), MT4 and MT5;

Trade mode - manual;

Initial deposit - $10000;

Working lot - 0.10 (for MT) and 10000 for R2

TS - allowed placements, cuts and reversals

Currency pair - EURUSD.


Trade situation #1:

Opening a position on Buy signal at 1.2500, we put TP 200 pips (at 1.2700) + Limit Buy (share) below the position at 300 pips.


For R2 - opening Buy at 1.2500, intercompensating orders at 1.27 (Sell) and 1.22 (Buy).

For MT4 - opening Buy 1.2500 with TP at 1.27 + 1.22 (Buy).

For MT5 - we open a Buy 1.2500 with TP of 1.27 + we scale in at 1.22 (Buy).


Let's commit the entry and see what we have in the end

R2 - A position at 0.20 (20,000) at approximately 1.2355 (with a drawdown of 155 pips)

MT4 - position "a" at 0.10 for 1.25 + position "b" at 0.10 for 1.22 (with a CU at approximately 1.2355 and a loss on the first position of 300 pips)

MT5 - position at 0.20 at approximately 1.2355 (with a drawdown of 155 pips)


Let us now assume that the price moved up to 1.23 and went into a flat position at 1.23 - 1.2310. We decided to cut the total position at 1.2305, what we see as a result

R2 - the position is truncated, as a result of which the opening price is recalculated. As a result, the opening price changes and the position volume becomes 0.10 (10,000). Attention! AS FAR AS I REMEMBER, THE RESULT IS NOT FIXED!

MT4 - Profit is locked in on position "B" (105 pips). This leaves only position "A" open with a volume of 0.10 and a loss of 195 pips

MT5 (note: if I understand correctly, the position is abbreviated to the volume of 0.10. This fixes the loss on the closing portion. As far as I understand we shoulder a loss equal to 50 pips on 0.10 volume + approximately 50 pips before the remaining volume in the BU.

PS

Of course, 50 points of loss is not 300 (if we consider that there is a mere trifle - 50 points - before the remaining volume changes to profit).

Only the question is which of the three platforms I as a trader will choose for trading?

PPS

Of course, I can be wrong in details or in something more specific. So I would like to hear the opinion of the developers on the topic "A trader's life and the problem of choice in the current environment".

 
Urain:

No, the magic number is a binding number set by the Expert Advisor. Since an order is an order to change/open a position and ends in either a trade or a rejection, the MAGIC assigned to the order will also be assigned to the trade and the position.

Specifically by asking for ORDER_MAGIC you will get the magic number of the order you selected.

Have you tried it? I already asked you a question about it in another thread:

Hello! Here's a question: When I send a request to open a position, I set "Magic namber". I analyze the deal history after closing the position. If the position was closed by the opposite order ("Magic namber" is not set in this case), then the "Magic namber" of the deal is the one I have set when opening it. If the position was closed by TakeProfit or StopLoss, the "Magic namber" equals zero. Is it an error?

That is, the "Magic namber" is not always saved from opening until closing of the trade.

I had to work around it in other ways.

 
Keon:

If the position is closed by TakeProfit or StopLoss, then the "Magic namber" is zero. Is it a mistake?

I have made a request to the desk service about it. They promised to think about it.

Although, what is there to think about, we have to fix it...

 
I set the size and position of the charts, close MT5, open it, all the charts end up being stretched across the width of the window, how do I get rid of it?
 

Thanks, for the DLL's.

Now here's a silly question. I need about 500 last bars in the history for the EA to work. If we are testing on a certain time interval (from x1 to x2), we will never get these 500 bars and as a result we will not open any order. Then we will have to test on the interval from y1 to x1, where y1 is a point in time that occurred sometime before x1. Then at first trades will not be executed, and when the amount of hogs accumulates enough, they will start to be executed. And we cannot make y1 a constant. For example, if I want to test on September of the current year, I should start testing from January (in this case trades begin to be executed around June); if I start from March, then bars are not accumulated enough and nothing happens at all.

If I run the Expert Advisor in real time, nothing happens, because it does not have enough bars (even though the chart is plotted until I don't want it to, and it should have enough bars).

I have only one question from this rambling narrative: is there some way to deal with this?

ZS: everything works fine in 4.

 
Cherrr:

Thanks, for the DLL's.

Now here's a silly question. I need about 500 last bars in the history for the EA to work. If we are testing on a specific time interval (from x1 to x2), we will never get these 500 bars and as a result we will not open any order. Then we will have to test on the interval from y1 to x1, where y1 is a point in time that occurred sometime before x1. Then at first trades will not be executed, and when the amount of hogs accumulates enough, they will start to be executed. And we cannot make y1 a constant. For example, if I want to test on September of the current year, I should start testing from January (in this case trades begin to be executed around June); if I start from March, then bars are not accumulated enough and nothing happens at all.

If I run the EA in real time, nothing happens, because it does not have enough bars (even though the chart is plotted until I don't want it to, and it should have enough bars).

I have only one question from this rambling narrative: is there some way to deal with this?

ZS: everything works fine in 4.

You can select a monthly period when testing. Or write all the data to a file (I did so).
Reason: