zzdream:
ok I understand this make no sense to an experienced 'eye' . I understand 'age is younger than 30 AND my age is older than 30...' is not clear. But doing the below evaluates true:
2 bband settting : bb_b3=20 bb_b4=10
So in essence I am still saying ie 'age is younger than 30 AND my age is older than 30...' for bb_b4. Why is this the case ? The way the code is split? How would you guys split up the code for all 4 conditions to evaluate true ? Sorry for the ignorance... went over the mq4 doc for conditional tests + google search . Not getting this.
We don't know what the value of btrend or buysig before the first condition.
Try this
btrend=0; buysig=false;
if (bb_b3>0 && bb_b4<0) {
btrend=1;
}
if (btrend>0 && bb_b4>0) {
buysig=true;
}
zzdream:
Come on you are totally neglecting the fact that there must AT LEAST one mind rereader among these brilliant minds :) jk.
I gave the values for the variables, chk my posts .
When you don't understand why something does what it does in MQL4 always, experiment with a script. Like the one below, change the test values, change the conditions and see what happens. You will learn a lot from it.
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
//---test values
int var1 = 10;
int var2 = 50;
//--test1if(var1 <100 && var2 <100)
Alert("Test1 is true");
elseAlert("Test1 is false");
//--test2if(var1 <100 && var2 <100 && var1 >100)
Alert("Test2 is true");
elseAlert("Test2 is false");
}
//+------------------------------------------------------------------+
When you don't understand why something does what it does in MQL4 always, experiment with a script. Like the one below, change the test values, change the conditions and see what happens. You will learn a lot from it.
Yup, standard practice which I usually do and it helps a lot.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
@ zzdream
I think you need to do some more research about using bbands and see how the condition works.
I bet once you realized what is going on, you will be laughing hard. Seriously...
We here already see where are you going though .. XD
I gave the values for the variables, chk my posts .
ok I understand this make no sense to an experienced 'eye' . I understand 'age is younger than 30 AND my age is older than 30...' is not clear. But doing the below evaluates true:
2 bband settting : bb_b3=20 bb_b4=10
So in essence I am still saying ie 'age is younger than 30 AND my age is older than 30...' for bb_b4. Why is this the case ? The way the code is split? How would you guys split up the code for all 4 conditions to evaluate true ? Sorry for the ignorance... went over the mq4 doc for conditional tests + google search . Not getting this.
We don't know what the value of btrend or buysig before the first condition.
Try this
Come on you are totally neglecting the fact that there must AT LEAST one mind rereader among these brilliant minds :) jk.
I gave the values for the variables, chk my posts .
When you don't understand why something does what it does in MQL4 always, experiment with a script. Like the one below, change the test values, change the conditions and see what happens. You will learn a lot from it.
When you don't understand why something does what it does in MQL4 always, experiment with a script. Like the one below, change the test values, change the conditions and see what happens. You will learn a lot from it.
Yup, standard practice which I usually do and it helps a lot.