could you point me reference for the first statement..
didnt get this question... sorry
bool foundPosition = TotalOpenPosition != 0;
Bool can be "true" or "false".
In your Prgramm you have the possibility to set to true or false.
But also you can use the result of something like here....
TotalOpenPositions != 0
!= is for NOT EQUAL or IS NOT
In your case for Example:
if TotalOpenPositions=3 then TotalOpenPositions IS NOT EQUAL to 0 means the result is true (because TotalOpenPositions is not 0) and your foundPosition is set to true
Do you know which had more priority to execute, regarding this style code:
int validPosition = tradetimeRange + 60 * TimeFrameMinutes < 0;
Hope there will be type mismatch feature in mq5.. since this style of coding seem "very dirty" to me...
anyone can help me intepret above code ?
OMG! Where did you find such a coder :-0 ?
Arithmetical operations have higher priority than logical. So validPosition will be 0 or 1
my friend hire a mql coder, and the project didn't finish.. he ask me for a help.. and guess what.. i'm totally confuse about this coding style.. hope fully there will be variable types comparison feature... this style of code is really weird ( but funny... it works though)...
so Garfield, regarding the code above, i believe it could be something like :
if((tradetimeRange+(60*TimeFrameMinutes)<0){
validPosition=1;
}else{
validPosition=0;
}
is that correct ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello MQL Programmer,
my friend shows me some code that i don't really familiar.. here's the chunk of code:
bool foundPosition = TotalOpenPosition != 0;
bool check = foundPosition * (TotalOpenPosition == 0);
Anybody have idea how to intepret/understand this code correctly ?? it's kinda weird for me