Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1324
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
Thank you, such implementation has occurred to me, but it is not quite the same due to absence of Value1 itself. That is, the example I created is, of course, extremely simplified, but it is implied that this is not the main value of the class, that there can be a number of such values and that for each such a construct can be described.
Or for such an implementation, is it possible to describe only a separate class or structure in which to implement the overloading, and in this class to describe variables of the created type? But, if other variables of the class are involved in the assignment operation, then again, it does not add up.
Actually, I wanted to implement something similar to Let/Set/Get methods in vbs.
I don't quite understand the question but C++ / MQL doesn't have a key property Property
maybe you need a template classhttps://www.mql5.com/ru/docs/basis/oop/class_templates
UPD: Here's an article on Habra about the same thinghttps://habr.com/ru/post/121799/ , but I doubt it applies "directly" to MQL
Thank you very much!
This is a bit beyond my knowledge, because I've never studied C++, but it seems to be exactly what I wanted. I'll try to figure it out.
Thank you very much!
It's a bit beyond my knowledge, because I've never studied C++, but it seems to be exactly what I wanted. I'll try to figure it out.
Try formulating your question briefly in this thread:https://www.mql5.com/ru/forum/85652
there are some really cool programmers there and they do stuff like this... well, maybe this will help you figure it out faster
Yes, thank you.
I, remembering I had used one, had forgotten it was called Property, and was being obtuse in explaining what I wanted.
It was mentioned in the comments to the article that you can use macro substitution, it got me thinking that perhaps by adopting a strict syntax agreement with myself, you can implement a not so common case much easier.
This is the kind of crutch you can make)
Thank you, this crutch is obviously much simpler, although even with this one I still don't understand everything.
Is it impossible to put any set of characters into a macro substitution? Something like this:
simply overload DoubleToString, if it returns the string "EMPTY_VALUE" otherwise call ::DoubleToString
I don't get it here.
I don't get it here.
but otherwise
but otherwise
in a rare case, make and delete the source so you don't see it again)
if the buffer was an indicator buffer, you could replace it with EMPTY_VALUE
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,EMPTY_VALUE);
Afternoon. I am trying to attach a stop loss read from atr indicator to my EA. The input variables are as follows.
I am adding the atr values to a variable for a stop loss.
Then I try to open orders like this.
But nothing works. I print the value of Stop Loss variable but report that its value is 0. What am I doing wrong? Where do I need to fix it and tweak it to make it work?