Errors, bugs, questions - page 1695
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
What does ORDER_TYPE_BUY mean? Just print it out and make sure that it is 0. So, there is no order there.
I.e. after opening a position in MqlTradeTransaction structure order_type is just not available? Or is it just 0 regardless?
Rashid, if you don't mind, could you give me an easier answer? Well, I'll print it out and it will be 0, but how should I understand it?
Here we go... While I was typing, Vladimir gave me a comprehensive answer. Thank you, I got it. As always, I didn't read the documentation...
For different types of transactions different fields of MqlTradeTransaction structure are filled in:
as you can see, for TRADE_TRANSACTION_DEAL_ADD the .order_type is not filled in.
Rashid, if it's not too much trouble, can you give me a simpler answer? So I'll print it out, it will be 0, but how do I understand it?
By the way, this is sometimes misleading... Why can't it be specified as WRONG_VALUE, for example, if the value is not filled in?
I've stepped on this rake myself. I can't tell )
No need to look at the order type in this case - it's just not there
How slow I am at typing... While editing my post...
Alexey Viktorov:
Added.
Well... While typing, Vladimir gave me a comprehensive answer. Thanks a lot. As always I haven't read the documentation...
Thank you.
How do I know my handle on a chart in an indicator?ChartIndicatorName is not suitable, because it returns a short name. And with the same name may be already running the same indicator with different input parameters.
I need it to be able to remove the indicator from the chart and its calculations.
How do I know my handle on a chart in an indicator?ChartIndicatorName is not suitable, because it returns a short name. And with the same name may be already running the same indicator with different input parameters.
I need it to be able to remove the indicator from the chart and its calculations.
Shouldn't my example inherit / take a method from a parent class??? How to get a method of parent in derived classes to use it later.
So the parent class has methods "one, two, three" I want to use only method "two and three" in descendant and not to see method "one" and also that "two and three" will be available later
Shouldn't my example inherit / take a method from a parent class??? How to get a method of parent in derived classes to use it later.
So the parent class has methods "one, two, three" I want to use only method "two and three" in descendant and not to see method "one" and also that "two and three" will be available further
Firstly, it is not clear whether an attempt was made to declare a method as virtual or not. If it must be virtual, then write virtual in a base class, not in a derived one (because otherwise base pointers will be resold to the base method even if you put a derived class instance into it).
If you don't want to override a method in a derived class, don't mention it at all, and if you do, it should be overridden with a body.
Finally, to hide the method from the derived class, you need to introduce an intermediate class where this method should be moved to the priivate area or made private in the base class (but why is it virtual then?).