Usefulness (or not) of the magic number with MQL5. - page 3

 

graziani: you have a system/algorithm/EA which has input  (it's mathematical domain) from price action feed (which needs to be treated as non-stationary stochastic process). So by modelling this system and describing it with parameters, you are hoping that the price action feed will be stationary process long enough for you to make profit out of it.

But if you share this price action feed with another system, your input feed has changed. So the results you will be getting are different, and this system will not function as expected.

I hope it's clear now. At least more clear. 

This would not be the case if both systems decided to buy_only. Therefore I'm confused as-to-why you decided to focus on magic# in this context. Imo, magic# does_not lose her purpose here. The one you should be blaming is the mt5 position centric architecture.

If you said position centric architecture makes such strategies (simultaneously running buys/sells ) different/difficult I'll agree. But if this become that position centric architecture makes magic numbers useless, then I dis-agree (to the extend I mentioned earlier).

 
Ubzen:
  • What if I want to differentiate a Manual_Trades from the Expert_Trades?
  • I've been using this Account for Years with different Experts. I want to make a Report of the total_profit from Expert_A, how do I differentiate Expert_A trades vs Expert_B trades in history.
  • I want to trade two different Experts which only Buys_EurUsd. I want them to have different money_management how do I differentiate?

In the above examples, I believe magic numbers would be useful. I agree with graziani that the use of magic# with simultaneous experts is now limited. I agree with angevoyageur that the purpose of the magic# remains un_changed. I agree with raptorUK that having the option with magic# is good.

i am glad that you agree with everyone ;)

actually i started this thread in hope that someone will give a useful way to use, but it looks that there isn't one, at least yet.

i guess that magic can be used in some obscure ways, but i am not interested in some esoteric problems, i would just like to run two different algorithms on same instrument. and here this fails as a solution. 

 
Ubzen:

This would not be the case if both systems decided to buy_only. Therefore I'm confused as-to-why you decided to focus on magic# in this context. Imo, magic# does_not lose her purpose here. The one you should be blaming is the mt5 position centric architecture.

If you said position centric architecture makes such strategies (simultaneously running buys/sells ) different/difficult I'll agree. But if this become that position centric architecture makes magic numbers useless, then I dis-agree (to the extend I mentioned earlier).

OK, you can have concurrent systems which trade in only one direction on same instrument .... maybe.

You need to now the size of your position, you can get that by marking the opening deal with magic. but if one part of position is closed by TP/SL, you need to know if that was your part, so again it's getting too complicated.

 
Ubzen:

The one you should be blaming is the mt5 position centric architecture.

Yes, that is the point.

 

I think we toured all the "theory" about using magic number with mql5. I am trying to resume :

  • Magic number can be used to distinguish trades from different EA also with MT5. Ubzen gives some good examples of that.
  • Position centric architecture of MT5 makes things more difficult that MT4, but remains certainly possible.
  • We have to check that it is useful to solve this issue (running several EA on the same symbol/account) than running each EA on a separate account.

(if graziani agree, I can edit the first post to add this conclusion to it.)

 
graziani: Yes, that is the point.
Yes, most of us here have been saying the same thing for years now ;). Mt5 uni-directional structure makes some things (compared to mt4) difficult to implement for a programmer/trader. I remember going hard on MQ for not leaving the structure optional. Anyways on a brighter note, at-least we still have mt4 around ;) Cheers.
Reason: