You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
And if you don't use classes, you get tired of constantly writing something like SymbolInfoDouble(_Symbol,MODE_BID). Such dances every time - both brackets and underscore, and you don't know whether to press the capslock (and then somewhere else without looking, type an entire capitalized string and retype it) or keep the shifter pressed. At least that's where OOP is useful. If at least make classes for all these functions, then yes - they are huge. If you write it for yourself, it's not a problem. As for working with orders, there are not so many frequently used functions, we can simply put a few functions into a library. But in general, an ideal approach has not yet been found.
Here is my vision of the class which can open/close/set stop loss and later displayorder status
and note the use on one symbol - specially a static class to use
all in all, everything works as intended.... but i don't like it, as i wrote above it is cumbersome and superfluous
And if you don't use classes, you'll get tired of constantly writing something like SymbolInfoDouble(_Symbol,SYMBOL_BID). This dances every time ...
You could make more convenient and concise wrappers for these functions, while keeping them in procedural style. Especially taking into account the fact that in recent builds they finally added namespace, everything is great. Before you had to implement them as static methods, but now everything is much easier:
You can make more convenient and concise wrappers for these functions, while still staying within the procedural style. Especially since they finally added namespace in the latest builds, that's great. Before, you had to implement them as static methods, but now everything is much simpler:
Is it really important to stay within limits? If it is important to stay within boundaries, you can write functions, too.
well, not much, i would say quite a lot of actions to set an order, here's my vision for a class that knows how to open/close/set stoploss/and further output order status
and note the use on one symbol - specially a static class to use
all in all, everything works as intended.... but i do not like it, as i wrote above it is cumbersome and superfluous
Yes, here's another question that keeps coming up and doesn't have an unambiguous answer. When you need to inherit your own class - what's better to do, inherit it or write a new extended version of your class.
It is possible to make more convenient and concise wrappers for these functions, while still staying within the procedural style. Especially since they finally added namespace in the latest builds, that's great. Before, you had to implement them as static methods, now things are much simpler:
You don't have a succinct notation, if there are no checks, it's easier to write as is:
and note that to be used on a single character - specifically a static class used
Your entry is not succinct, if there are no checks, it's easier to write as is:
There are a lot of functions like SymbolInfoDouble. It's a hassle to come up with short names for all of them. By assembling them into classes, you don't have to worry about uniqueness of names at all.
I have the following circuit where I have had no problems.
your entry is not succinct, if there are no checks, it is easier to write it as it is:
What prevents you from passing the name of the symbol to the constructor, making the class flexible and versatile? Do you fundamentally not consider the possibility of portfolio trading?
What hinders this is that mostly one-character EAs are written, and passing a symbol would be an unnecessary (and exhausting))) action in most cases. Another thing is to make it so that the chart symbol is automatically selected by default, and if necessary, you can override the symbol for a while. But again the question arises, which is better - to use one instance of the class and override the symbol as needed, or to create a separate instance for each symbol.