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
Good evening! Pretty sure this function will produce exactly what I wanted, well almost. But the machine won't compile, it swears like this
'}' - not all control paths return a value htghtgfhthf.mq5 61 10 It's telling her I have something wrong with logic, not all returns are specified there. Yes, they are! On the contrary, if we put them after each opirator of if, it will be nonsense, the program will immediately produce the wrong result. It's short and to the point. If you can, how can you make it accept it?
Good evening! Pretty sure this function will produce exactly what I wanted, well almost. But the machine won't compile, it swears like this
'}' - not all control paths return a value htghtgfhthf.mq5 61 10 It's telling me I have something wrong with logic, not all returns are specified there. Yes, they are! On the contrary, if we put them after each opirator of if, it will be nonsense, the program will immediately produce the wrong result. It's short and to the point. If you can, how can you make it accept?
A word of advice: learn some technical English. Let me have a look at the code.
As for the subject: the function must return a value of the string type. Inside the function we use the if statement, which contains the return statements. Question: if the if statement detects that Bull == false, what should the function return?
Aha!!! Thank you!!!
Thanks!!!!
Good evening! Pretty sure this function will produce exactly what I wanted, well almost. But the machine won't compile, it swears like this
'}' - not all control paths return a value htghtgfhthf.mq5 61 10 It's telling her I have something wrong with my logic, not all returns are specified there. Yes, they are! On the contrary, if we put them after each opirator of if, it will be nonsense, the program will immediately produce the wrong result. It's short and to the point. If it can, how to make it accept?
not all control paths return a value - there is no full control over value return.
It means that in string OrderType(), which must have a return value since the type is different from void, there is no guaranteed output with a return value.
Although you have set as many as 2 operators return, both of them are protected by the if condition. What will happen if both conditions are false?
Then the machine can jump out the window at will.
By the way, in this function it makes more sense to use switch counter, instead of a bunch of if's, which essentially do the same job as switch.
ZZZY Plus, we should not forget that the position must be preselected, as well as the order. And there is a standard function EnumToString for translation of enumerations into strings, so no need to re-invent the wheel.
I don't understand why OnTick is called although the price does not change?????
2012.09.10 11:52:11 Sample_Tick (EURUSD,M5) 493 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:10 Sample_Tick (EURUSD,M5) 492 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:09 Sample_Tick (EURUSD,M5) 491 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:07 Sample_Tick (EURUSD,M5) 490 1.2787 1.2789 1.2788 300000
I do not understand why OnTick is triggered although price does not change?????
2012.09.10 11:52:11 Sample_Tick (EURUSD,M5) 493 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:10 Sample_Tick (EURUSD,M5) 492 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:09 Sample_Tick (EURUSD,M5) 491 1.2787 1.2789 1.2788 300000
2012.09.10 11:52:07 Sample_Tick (EURUSD,M5) 490 1.2787 1.2789 1.2788 300000
the time of the last price update does not change either?
2012.09.10 15:37:20 Sample_Tick (EURUSD.m,M5) 20 1.27841 1.27852 1.27841 2000000 2012.09.10 14:37:19
2012.09.10 15:37:20 Sample_Tick (EURUSD.m,M5) 19 1.27841 1.27852 1.27841 2000000 2012.09.10 14:37:19
2012.09.10 15:37:20 Sample_Tick (EURUSD.m,M5) 18 1.27841 1.27852 1.27841 2000000 2012.09.10 14:37:18
or
2012.09.10 15:37:12 Sample_Tick (EURUSD.m,M5) 6 1.27835 1.27845 1.27835 1000000 2012.09.10 14:37:11
2012.09.10 15:37:12 Sample_Tick (EURUSD.m,M5) 5 1.27835 1.27845 1.27835 1000000 2012.09.10 14:37:11
2012.09.10 15:37:12 Sample_Tick (EURUSD.m,M5) 4 1.27835 1.27845 1.27835 1000000 2012.09.10 14:37:10
2012.09.10 15:37:20 Sample_Tick (EURUSD.m,M5) 20 1.27841 1.27852 1.27841 2000000 2012.09.10 14:37:19