Help finding unbalanced left parenthesis - page 2

 

OK, FINE, I AM GONNA SHOW YOU HOW TO PUT THIS THING TOGETHER...

#1, LETS ASSEMBLE THE "BASICS" OF YOUR CODE... AND THEN WE WILL ADD THINGS TO IT AS WE GO...

int init()
{

return(0);
}//end of init function

int deinit()
{

return(0);
}//end of deinit function


int start()
{
double MAFast1 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast2 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow1 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow2 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 1);
    
double MAFast3 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast4 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow3 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow4 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 1);
    
     
double cci1 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 0);
double cci2 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 1);
double cci3 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 2);
   
double bands_upper1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 1);
double bands_upper2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 2);
double bands_lower1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 1);
double bands_lower2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 2);



return(0);
}//END OF START FUNCTION

now, we have your moving averages and your bands in place...

now, explain to me (in plain english) when and why you want a trade to kick in..and i will code it for you.

ie, tell me something like this:

I WANT TO GO LONG IF MA WHATEVER IS GREATER THAN SUCH AND SUCH, ETC...

zero/.

 

//okay thanks... Try to write it in plain english...

I want to go Long if ( MAFast1 is Greater than MASlow1 and MAFast3 is Greater then MASlow3 and CCI3 was Inferior to 100 and CCI2 is equal or Greater then 100 and CCI1 is greater than 100)

OR if ( MAFast1 is Greater than MASlow1 and MaFast4 was Inferior to MASlow4 and MAFast3 is Greater than MASlow3 and CCI is Greater than 100 )

OR if ( MAFast2 was Inferior to MASlow2 and now MAFast1 is greater than MASlow1 and MAFast3 is Greater than MASlow3 and CCI is Greater than 100 )

I want to Exit my Long position if (the Close [2] is Greater then the bands_upper2 and Close[0] is Inferior to bands_upper1.)

//Does these make sense to you ... Thanks . that is the first time i wrote like in this way and infact it s good to arrange your brain... Ericman.

 
int init()
{

return(0);
}//end of init function

int deinit()
{

return(0);
}//end of deinit function


int start()
{
double MAFast1 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast2 = iMA(NULL, MA1Cross_Timeframe, FastMA1_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow1 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow2 = iMA(NULL, MA1Cross_Timeframe, SlowMA1_p, 0, modeMA1, PRICE_CLOSE, 1);
    
double MAFast3 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 0);
double MAFast4 = iMA(NULL, MA1Cross_Timeframe, FastMA2_p, 0, modeMA2, PRICE_CLOSE, 1);
double MASlow3 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 0);
double MASlow4 = iMA(NULL, MA1Cross_Timeframe, SlowMA2_p, 0, modeMA1, PRICE_CLOSE, 1);
    
     
double cci1 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 0);
double cci2 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 1);
double cci3 = iCCI(NULL, CCI_Timeframe, CCI_p, PRICE_CLOSE, 2);
   
double bands_upper1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 1);
double bands_upper2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_UPPER, 2);
double bands_lower1 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 1);
double bands_lower2 = iBands(NULL, Band_Timeframe, Band_p,1, 0, PRICE_CLOSE, MODE_LOWER, 2);

int flag=0;

if(MAFast1>MASlow1 && MAFast3>MASlow3 && CCI3<100 && CCI2>=100 && CCI1>100) flag=1;

if(MAFast1>MASlow1 && MAFast4<MASlow4 && MAFast3>MASlow3 && CCI>100) flag=1;

if(MAFast2<MASlow2 && MAFast1>MASlow1 && MAFast3>MASlow3 && CCI>100) flag=1;

if(flag==1) go_long();

return(0);
}//END OF START FUNCTION

 

i still need to check that for typos and syntax errors, but take a look at that and see if that looks like what you are talking about...

do not be scared to just come out and admit that you are confused, if you dont i cant help you..

do not ever be afraid to admit that you are lost, otherwise you will remain lost.

let me know how that looks.

zero/.

i already see a problem...

i see where you (when you wrote out that plain english stuff above) where you use a CCI variable, but we did not define any CCI variable.

if(MAFast2<MASlow2 && MAFast1>MASlow1 && MAFast3>MASlow3 && CCI>100) flag=1;

just let me know.

BTW, WE WILL DEAL WITH THE CLOSE TRADE ISSUES LATER.

ALSO, IF I SOMEHOW LOSE TRACK OF THIS THREAD AND YOU WANT TO SHOUT AT ME, whatever, do it at: mql4@hush.com

let me know.

 
smoknfx:

i still need to check that for typos and syntax errors, but take a look at that and see if that looks like what you are talking about...

do not be scared to just come out and admit that you are confused, if you dont i cant help you..

do not ever be afraid to admit that you are lost, otherwise you will remain lost.

let me know how that looks.

zero/.

i already see a problem...

i see where you (when you wrote out that plain english stuff above) where you use a CCI variable, but we did not define any CCI variable.

just let me know.

BTW, WE WILL DEAL WITH THE CLOSE TRADE ISSUES LATER.

ALSO, IF I SOMEHOW LOSE TRACK OF THIS THREAD AND YOU WANT TO SHOUT AT ME, whatever, do it at: mql4@hush.com

let me know.


Thanks a lot. I try to learn from what you wrote and anylize. It was CCI1 i forgot to put the 1. Thanks i will chek oup mql4@hush.com I dont take your help for granted! Try to learn from you. Thanks.
 
By the way what is flag.... it is the first time i see this.
 
The complicated definition in wiki or simply varibles that mark the path of execution for use at a later point in the program.
 
ericman:

what is flag?

flag is a variable.

simple as that.

i could have called it :

int ready2golong=0;

see what i mean?


first, i set it to zero.

then i do a couple of comparisons that might set it to one.

and then, if it is one, go_long();

 
ericman:

Thanks a lot. I try to learn from what you wrote and anylize. It was CCI1 i forgot to put the 1. Thanks i will chek oup mql4@hush.com I dont take your help for granted! Try to learn from you. Thanks.

i enjoy doing this kinda @#$.

this is what i do for fun.

do me a favor?

try loading that code up and compiling it..

adjust any CCI variables that need to be fixed due to typos.

let me know how it goes.

zero/.

 
Ickyrus:
The complicated definition in wiki or simply varibles that mark the path of execution for use at a later point in the program.

wrong.

let me explain something to you:

do you see how i am getting things simplified for this person?

what makes you think that we need to give him a complicated anything?

that is right.

regards,

zero,

Reason: