Errors, bugs, questions - page 410

 
papaklass:
You can track pending orders using function OrdersTotal(). Compare its current value with the previous one. If you want to avoid multiple pending orders, use the flag for setting an order. If this flag == true, it means that an order has already been set. Reset this flag when the order is triggered, i.e., OrdersTotal() will change.

Fortunately, I went through these basics a year ago. I learned these basics a year ago from the articles dedicated to the initial MQL5 skills. The Championship confirmed - this scheme is good for training, but not for everyday trading. Roche's articles have dot all the i's and cross all the t's.

And this is not the question of how to check the order status. The point is that the trade parameters I described above can greatly simplify working with orders as well as positions. From the viewpoint of an individual user (i.e. me), the question"What should I do? Unknown", as well as working with orders point-by-point rather than through the "symbol - OrdersTotal()" bunch.

papaklass:
All you need to know is the symbol on which this event occurred.

The point is that if we put aside training paradigms, it is more important to know the order ticket, and not the symbol, to work with pending orders. To be more precise, working with a symbol is acceptable, but a lot of extra work.

P.S. This is the first time I have heard about "subscription". It is a nice variant.

 
papaklass:
I am not claiming to be the truth in the first instance, but your statement about kindergarten reeks of arrogance.

Don't take it personally. I corrected that phrase before your message. You know, sometimes you write, send it, - and then when you read it you correct possible ambiguities in secondary phrases.

On the subject. We have exactly opposite approaches to trading: I don't care when and how a position opens/closes, because EA handles these moments by itself (shifts TP, trailing stop, etc.). It is important to me that pending orders should always cover the situation on the market. That is why I stress that a statement like "only one symbol-parameter is enough for OnTrade()" does not reflect all common/typical strategies.

 
Interesting:

To the developers of

Is Win 2003 SP2 (in terminal mode) constantly losing information about my trading account is a bug or it was designed to improve security?

More precisely, if I alternately use the same program copy in normal and terminal mode with different accounts the account data disappears from time to time. Apparently, if you just work in terminal mode with different accounts, the situation will be similar (I haven't checked that yet).


Yes, that's right.

When another Windows user (even on the same computer) tries to access terminal, that has saved passwords from another Windows user, the passwords are forcedly reset. This is done to prevent anyone from stealing passwords.

 
Virty:

Yes, it seems like a simple question, and already the gurus are arguing. It's a pain in the ass to get the tester to work correctly. In order to buy 1 lot of EURUSD at the current price, you have to perform 3-4 checks. If you don't do it, the tester will work, but not properly and, what's important, quietly. Only a negative balance or some other nonsense will result. And it is good if the checks are successful. But if SymbolInfoTick returns false, we don't know what to do. Should I hang the error code on the wall instead of prizes in the Championship?

I tried "equity<0.55*balance" and "free_margin<100". It did not work. I don't know why it didn't work. I'm really confused by these margins.

I left it if(AccountInfoDouble(ACCOUNT_MARGIN_LEVEL)<55.0). It seems to work.

The Championship rules are written in brief, in the developers' jargon, while they need details for dummies.

What is there to argue about ? The margin level = Funds/Securities*100%, or in terms of MQL5:

AccountInfoDouble(ACCOUNT_MARGIN_LEVEL)=AccountInfoDouble(ACCOUNT_EQUITY)/AccountInfoDouble(ACCOUNT_MARGIN)*100=
AccountInfoDouble(ACCOUNT_EQUITY)/(AccountInfoDouble(ACCOUNT_EQUITY)-AccountInfoDouble(ACCOUNT_FREEMARGIN))*100

These parameters are displayed in your terminal on the 'Trade' tab, you can check them. As for the stop out, check out a similar discussion in 2007.

Установка Stop Out - MQL4 форум
  • www.mql5.com
Установка Stop Out - MQL4 форум
 
papaklass:

Vyacheslav, your answer is encouraging. Someone on the forum suggested, in my opinion, an acceptable solution - subscription. Implement this subscription similar to the iCustom() function that has mandatory and non-mandatory parameters. When initializing the Expert Advisor, each trader must subscribe to the events that he/she requires. Not for the total number of events, but only for those that are critical to their trade. This approach (subscription) will greatly facilitate development of multicurrency EAs and really reduce the code. Do an experiment with at least two functions OnTrade() and OnTick(). Make the minimum - a symbol. Then you can increase the number of events (parameters). Practice is the criterion of truth. Until you try, you will not understand what difficulties may arise.

PS The analogy with function GetLastError(), which returns the value of system variable LastError, is probably more appropriate than the analogy with function iCustom(). Type the TradeEvent system variable and, when OnTrade() triggers, print the value of this variable.

It's the first time I've heard about subscription, but it's a very good idea as a basis for an idea (like subscription to tamer events or Depth of Market).

Also, the idea of a constant based on _Error type is quite interesting.

In my opinion, the symbol should be transferred necessarily, in principle, we can start to move in this direction now, so that before the championship to introduce at least some innovation in this area.

Yedelkin:

The point is that if we put aside training paradigms, it is more important to know the order ticket rather than the symbol when dealing with pending orders. To be exact, working with a symbol is acceptable but it is a lot of extra work.

At first we must implement only symbol, then we'll have time to think over what and how to pass additionally. It would be nice to handle OnTrade() and OnTick() in the same way.

Developing the subscription theme, it is possible to organize subscription to ticks of a certain pair.

 
Yedelkin:

Don't take it personally. I corrected that phrase before your message. You know, sometimes you write, send it, - and then when you read it you correct possible ambiguities in secondary phrases.

On the subject. We have exactly opposite approaches to trading: I don't care when and how a position opens/closes, because EA handles those moments by itself (shifts TP, trailing stop, etc.). It is important to me that pending orders should always cover the situation on the market. That is why I emphasize that a statement like "only one symbol-parameter is enough for OnTrade()" does not reflect all common/typical strategies.

I agree, it does not. But nevertheless, we must start from the symbol, and the order/trade ticket or something else will be added to it later.

Renat:

Yes, that's right.

When another Windows user (even on the same computer) tries to access a terminal with passwords stored by another Windows user, the passwords are forcefully reset. This is done to prevent anyone from stealing passwords.

I see, thank you (that's what I thought, I thought I'd make sure).
 
Interesting:

First of all, only the symbol should be implemented, and then there will be time to think about what and how to pass additionally.

...It's the symbol that should be started, and the order/trade ticket or something else will be added to it later on is a different question.

In general, the accents are already set, I would just like to point out that if you act according to the principle "everyone pulls the blanket over himself" (such as "give me only symbol-parameter" or "only ticket-parameter"), then you can achieve nothing. That's why my question was originally formulated with a minimum configuration of parameters in mind. Exactly "minimum configuration", as I expected that more advanced users would have their own wishes about expanding/clarifying their list.

So it was a bit surprising that suggestions to limit to only one parameter (symbol-parameter) arose, especially surprising against the background of stringo's response, which said nothing about developers having problems with the number of parameters for OnTrade() at all. The problem was that "one and the same ticket may result in a heap of messages". And they will come regardless of how many parameters are entered for the function.

...Last year I couldn't understand for a long time what "crutches" the pros were periodically talking about. Now, on the basis of discussion of the topic about parameters for OnTrade() I got a strong association: "crutches" == half-measures when solving this or that issue. I think the issue of parameters for OnTrade() will be solved without them. Praise, as they say, to developers for their complex approach to problem solving! :)

 

What does the message "pump result 0" mean at the end of the test?

 
MoneyJinn:

build 466: The results of the single test differ from the results of the optimization performed a minute before.

What is the reason? What updated parameters does the tester take from the market during the new test?

Can you attach the results?
 
Ashes:

What does the message "pump result 0" mean at the end of the test?

A randomly slipped debugging message. The number after pump result corresponds to the number at startup
Reason: