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
if in my example:
copy the asc and bid values in the onTick() method and use _Ask, _Bid (virtual trade) in the rest of the methods
will it be like working with global variables?
ZS: as an option, I can of course pass by reference &tick to all methods, but again questions which is more efficient
Once asked a question about two ways to initialise variables in a class. This one:
And this one:
I asked what is the advantage of the second way and was told that you can initialize static members with it. But static members are not initialized that way.
So the question is the same - what is the difference in principle and what is the advantage of the second way?
Quote
Once asked a question about two ways to initialise variables in a class. Here's one like this:
https://www.mql5.com/ru/forum/85652/page45#comment_15975127
I asked what is the advantage of the second way and was told that static members can be initialized by it. But static members are not initialized that way.
They are constant fields, not static ones.
So the question is still the same - what is the difference in principle and what is the advantage of the second way?
If we discard the "it's considered bad form" statement, then whatever is more convenient, that's what we'll use, imho.
I'll start the topic again, I deleted the previous post, I thought I figured it out on my own....
here is the code:
I want to fill 3 enums and 2 int from privat section of CSetting with one int in which bit by bit I will store this data, sketched the code:
in theory, it should work, I take the lower 2 + 3 +3 bits from the data for enum , and the remaining 24 bits from the int to fill param1 and param2, keeping the 12th bit as the character of the number
how do i check if there is an error ? )))
or would be thankful for someone else's ideas how to save this data to int
how do you check if there are errors? )))
or t+d*10+v*100
this will not work,
you either have to shift bit by bit or multiply/split by 2, which is equivalent to shifting
well, as usual - pack it, unpack it, check the identity. preferably check all borderline cases.
So, yes... logically
but i wasn't planning to do packing - i'm decreasing number of input variables for optimizer and i need many GA passes on top of them, so that GA does not converge quickly
boundary cases have already been checked, but from experience.... bugs are so crafty!!! )))
HH: I can of course reset the loop from 0...MAX_UINT into a file and look at it visually, but not the best option, imho.
it won't work,
...
Why wouldn't it work? Three enumerations, none of them more than 10. Second grade primary schools arithmetic.