
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
Well yes, that's a better solution! so that there is one less method
1. There is nothing wrong with calling this function twice.
2. Don't you mind that those who are against using static functions don't give the slightest argument?
You'd better not watch videos from just anybody but read books.
I wish the author of the videos https://youtu.be/lfdAwl3-X_c and https://youtu.be/zME4SOCHT0I many good things..... knocked out the whole week, everything I sit down to do I start thinking, not doing as before .... you cannot use statics, it's not OOP!
I want to finish the code, I have a question:
- I want to save fields of objects, good thing, the fields were immediately placed in the structures, and you can save them with a single click via FileWriteStruct()
- there are N objects of one class, all of them inherited from one base class
- because i have watched the video, i was hoping that some method would help me not to interrogate each object if it needed to save the file.... In general, fiasco, it was decided not to be foolish and create a method that will statically assign a flag to write to the file
It works as planned
And the question itself, what will happen if you write it this way:
what will happen if you write it this way:
tried different ways to modify the test script, I can't see any difference, show me the correct modifiers for the post above: (protected / private ) and call M::x or just x
tried different ways to modify the test script, I see no difference, show me the correct modifiers for the post above: (protected / private ) and call M::x or just x
Inside class methods you call x, in all other places M::x, if protected, then the access is possible only in methods of the class in which the field is defined, here the logic is common.
Right! I made a wrong example in my sleep, so I got 'M::main' - cannot access private member function:
got 'M::main' - cannot access private member function tst.mq5 25 32
If I write it down
everything works as planned!
Happy holiday, by the way. Another byte happened.
Thank you, it's sorted!
Happy Holidays!
I wish the author of the videos https://youtu.be/lfdAwl3-X_c and https://youtu.be/zME4SOCHT0I a lot of good things..... knocked out all week, everything I sit down to do I start thinking rather than doing as before .... you cannot use statics, it's not OOP!
I want to finish the code, I have a question:
- I want to save fields of objects, good thing, the fields were immediately placed in the structures, and you can save them with a single click via FileWriteStruct()
- there are N objects of one class, all of them inherited from one base class
- because i have watched the video, i was hoping that some method would allow me to avoid asking each object if it should save the file.... In general, fiasco, it was decided not to be foolish and create a method that will statically assign a flag to write to the file
It works as planned
And the question itself, what will happen if you write it this way:
what happens if you write it this way:
What does it depend on whether an object needs to be saved to a file?
Is this flag common for all objects?
What does it depend on to save the object to a file?
Is this a feature common to all objects?
Well the question is dialectical, of course, here
- It is better to have 10 strategies and write 10 files with change of state of TC (1 TC = 1 structure)
- or it is more logical to pass one handle from the class, where there is a call ( search) of strategies per tick, so they all write to one file
I think the 2nd variant is more logical
it turns out that after the start of all TCs you need to write 10 structures once - the state has changed
then in random order they need to write when needed ( triggering of SL or TP) - here it is also faster to open the file and write 10 structures in one go, strategies are not pipswise, not every second, from a minute to an hour in each TS
So far I have implemented a description of a static variable and access to it through a get - set, set protected, get public - it also resets to false the static variable after the call
Well, the question is dialectical, of course, here
- You have either 10 strategies and write 10 files with change of state of TC (1 TC = 1 structure)
- or it is more logical to pass one handle from the class, where there is a call ( search) of strategies on a tick, so they write all into one file
I think the 2nd variant is more logical
it turns out that after the start of all TCs you need to write 10 structures once - the state has changed
then in random order they need to write when needed ( triggering of SL or TP) - here it is also faster to open the file and write 10 structures in one go, strategies are not pipswise, not every second, from a minute to an hour in each TS
For now I have implemented by describing a static variable access to it through a Get, Set Protected, Get public - it also resets to false the static variable after it has been called
This is all clear. It is not clear whySetSaveRequired() andGetSaveRequired() are non-static but write to a static variable.