Help finding unbalanced left parenthesis - page 4

 

Not that is matters but a discussion about coding under the title 'help find missing pernthsis' seems a little odd and offf the topic of the title - but that happens a lot.

kudos or ennui for helping ericman:

 
IMO What you did was start talking about your own interests which may or may not have been of interest to the OP. Such posts would be considered off topic and as far as I know (AFAIK) condered bad forum maners. Best to not respond to bad maners and simply get on and prove your value to the regular members.
 

Ah but your code is so much prettier than mine - besides I'm not always here.

 

//マジックナンバーの定義
#define MAGIC  4649        

// parameter
extern double Lots = 1.0;     //取引ロット数
extern int Slip = 10;         //許容スリッページ数
extern string Comments =  ""; //コメント

extern int FastMA1_p = 34;
extern int SlowMA1_p = 34;
extern int modeMA1 = MODE_SMA;
extern int modeMA2 = MODE_EMA;
extern int MA1Cross_Timeframe = PERIOD_M15;
extern int FastMA2_p = 68;
extern int SlowMA2_p = 68;
extern int CCI_p = 20;
extern int CCI_Buy_Point = 100;
extern int CCI_Sell_Point = -100;
extern int CCI_Timeframe = PERIOD_M30;
extern int Band_p = 6;
extern int Band_Timeframe = PERIOD_M15;



//variables//
int Ticket_L = 0; 
int Ticket_S = 0; 
int Exit_L = 0;   
int Exit_S = 0;   




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;

     

   //Long position entry 
   

if(MAFast1>MASlow1 && MAFast3>MASlow3 && cci3<100 && cci2>=100 && cci1>100) flag=1;

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

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

if(flag==1)  {  
      Ticket_L = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slip,0,0,Comments,MAGIC,0,Red);
    }
    

    
     
   return(0);
  }

This is what i did for to enter Long i did not add any take profit or stop loss. I just wanted to see if it enters . It enters but not where i want .... I dont know why....it is actually entering even if the MAFast3<MASlow4 and it should not.... well i check again

tell me if you gotta advice. Thanks!!!!!!!!!!!!!!!!

 
ericman:

This is what i did for to enter Long i did not add any take profit or stop loss. I just wanted to see if it enters . It enters but not where i want .... I dont know why....it is actually entering even if the MAFast3<MASlow4 and it should not.... well i check again

tell me if you gotta advice. Thanks!!!!!!!!!!!!!!!!


and Is this flag variable correctly used.... Woooo....
 

ericman,

i hope that you dont mind, but i am gonna kill all of that chinese comment nonsense..

z/.

 
ericman:

and Is this flag variable correctly used.... Woooo....


are you serious?

is it working for you?

 

that is just fantastic!!!!!!!!!!!!

you managed to insert the ordersend function call!!!!!

fantabulous!!!!!!!!1

i am assuming that you have the code running right now?

if so, why dont you just handle the closing of said trades manually for the time being and then we will add that code in the morning?

or maybe later tonight?

do me a favor and kill those chinese comments?

i dont read chinese, and i like to be able to read everything in my code.

zero/.

 
smoknfx:


are you serious?

is it working for you?


I mean it takes trades and actually makes profit.... It takes profits where i nearly want but not exactly ... But i want it exactly. Well in order to make each of if(....) what do i need to add. I can read that

if flag==1 then take long postion. But how... is it takeing position. I do not have any idea.

Sorry for the chinese letters . I will erase them the next time.... So How does the ordersend fucntion should be written in order to corralate with the if ( flag=1); It s kind a cloudy ....

 
smoknfx:

that is just fantastic!!!!!!!!!!!!

you managed to insert the ordersend function call!!!!!

fantabulous!!!!!!!!1

i am assuming that you have the code running right now?

if so, why dont you just handle the closing of said trades manually for the time being and then we will add that code in the morning?

or maybe later tonight?

do me a favor and kill those chinese comments?

i dont read chinese, and i like to be able to read everything in my code.

zero/.


I mean it is taking position. I swear lol. Well i will try to change it thanks. See you soon!
Reason: