Hi everyone Can some one help me with this code

Back to topics list To post a new topic, please log in or register
avatar
2
hardnoice 2015.02.08 23:05
 
/*
   RDN compatibility by Jack Dowsun
*/

//+---------------------------+
//| Expert Cross Framework    |
//+---------------------------+
#property copyright "Jack Dowson"
#property link      "http:0123456789.com"

// User Input
extern double Lots = 0.1;
extern int    Interval=1;
extern int       myCCIs=30;   //  5 days
extern int       myCCIl=150;  // 25 days


// Global scope
double barmove0 = 0;
double barmove1 = 0;
int         itv = 0;

double Poin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {
   //Checking for unconvetional Point digits number
   if (Point == 0.00001) Poin = 0.0001; //5 digits
   else if (Point == 0.001) Poin = 0.01; //3 digits
   else Poin = Point; //Normal
   itv=Interval;
   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
           {

   bool      found=false;
   bool     rising=true;
   bool    falling=true;
   bool      cross=true;
   double cCIs;
   double cCIm;
   double cCIf;
   
   int      cnt=;
    
   // Error checking
   if(AccountFreeMargin()<(1000*Lots))        {Print("-----NO MONEY"); return(0);}
   if(Bars<100)                               {Print("-----NO BARS "); return(0);}
   if(barmove0==Open[0] && barmove1==Open[1]) {                        return(0);}

   // bars moved, update current position
   barmove0=Open[0];
   barmove1=Open[1];

   // interval (bar) counter 
   itv+;

   // get CCI based on OPEN
   cCIs=iCCI(Symbol(),0,125,PRICE_OPEN,0);
   cCIm=iCCI(Symbol(),0, 25,PRICE_OPEN,0);
   cCIf=iCCI(Symbol(),0,  5,PRICE_OPEN,0);

   // is it crossing zero up or down
   if (cCIm<=0 && cCIs>=0 && cCIf>0) { rising=true; cross=true; Print("Rising  Cross");}
   if (cCIm>=0 && cCIs<=0 && cCIf<0) {falling=true; cross=true; Print("Falling Cross");}
   
   // open orders based on cross
   if (cross) 0 ;
   
                         
    {                 
    return;()    
    }                  

//---------------------------------------------------+

 

Its make two errors when im compile it

'}' - unexpected end of program RDN EXPERT 105.mq4 92 5

'{' - unbalanced parentheses RDN EXPERT 105.mq4 53 12


 

 

 

 

 

 


avatar
736
honest_knave 2015.02.08 23:58 #
 

Quite a few issues in there. Here is some stuff to get you started:

/*
   RDN compatibility by Jack Dowsun
*/

//+---------------------------+
//| Expert Cross Framework    |
//+---------------------------+
#property copyright "Jack Dowson"
#property link      "http:0123456789.com"

// User Input
extern double Lots = 0.1;
extern int    Interval=1;
extern int       myCCIs=30;   //  5 days
extern int       myCCIl=150;  // 25 days


// Global scope
double barmove0 = 0;
double barmove1 = 0;
int         itv = 0;

double Poin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {
   //Checking for unconvetional Point digits number
   if (Point == 0.00001) Poin = 0.0001; //5 digits
   else if (Point == 0.001) Poin = 0.01; //3 digits
   else Poin = Point; //Normal
   itv=Interval;
   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
           {

   bool      found=false;
   bool     rising=true;
   bool    falling=true;
   bool      cross=true;
   double cCIs;
   double cCIm;
   double cCIf;
   
   int      cnt=; // give it a value or remove the = sign... but you don't use this variable anyway?
    
   // Error checking
   if(AccountFreeMargin()<(1000*Lots))        {Print("-----NO MONEY"); return(0);}
   if(Bars<100)                               {Print("-----NO BARS "); return(0);}
   if(barmove0==Open[0] && barmove1==Open[1]) {                        return(0);}

   // bars moved, update current position
   barmove0=Open[0];
   barmove1=Open[1];

   // interval (bar) counter 
   itv+; // do you want to add 1 to the value of itv? If so, the correct syntax is itv++

   // get CCI based on OPEN
   cCIs=iCCI(Symbol(),0,125,PRICE_OPEN,0);
   cCIm=iCCI(Symbol(),0, 25,PRICE_OPEN,0);
   cCIf=iCCI(Symbol(),0,  5,PRICE_OPEN,0);

   // is it crossing zero up or down
   if (cCIm<=0 && cCIs>=0 && cCIf>0) { rising=true; cross=true; Print("Rising  Cross");}
   if (cCIm>=0 && cCIs<=0 && cCIf<0) {falling=true; cross=true; Print("Falling Cross");}
   
   // open orders based on cross
   if (cross) 0 ; // this does nothing
   
                         
    { // this probably shouldn't be here, and is causing your compile issues
    return;() // this should read return(0);   
    }                  
//---------------------------------------------------+

 

avatar
2
hardnoice 2015.02.09 13:51 #
 
/*
   RDN compatibility by Jack Dowsun
*/

//+---------------------------+
//| Expert Cross Framework    |
//+---------------------------+
#property copyright "Jack Dowsun"
#property link      "http:123456789.com"

// User Input
extern double Lots = 0.1;
extern int    Interval=1;
extern int       myCCIs=30;   //  5 days
extern int       myCCIl=150;  // 25 days


// Global scope
double barmove0 = 0;
double barmove1 = 0;
int         itv = 0;

double Poin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {
   //Checking for unconvetional Point digits number
   if (Point == 0.00001) Poin = 0.0001; //5 digits
   else if (Point == 0.001) Poin = 0.01; //3 digits
   else Poin = Point; //Normal
   itv=Interval;
   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
           {

   bool      found=false;
   bool     rising=true;
   bool    falling=true;
   bool      cross=true;
   double cCIs;
   double cCIm;
   double cCIf;
   
   
    
   // Error checking
   if(AccountFreeMargin()<(1000*Lots))        {Print("-----NO MONEY"); return(0);}
   if(Bars<100)                               {Print("-----NO BARS "); return(0);}
   if(barmove0==Open[0] && barmove1==Open[1]) {                        return(0);}

   // bars moved, update current position
   barmove0=Open[0];
   barmove1=Open[1];

   // interval (bar) counter 
   itv++;

   // get CCI based on OPEN
   cCIs=iCCI(Symbol(),0,125,PRICE_OPEN,0);
   cCIm=iCCI(Symbol(),0, 25,PRICE_OPEN,0);
   cCIf=iCCI(Symbol(),0,  5,PRICE_OPEN,0);

   // is it crossing zero up or down
   if (cCIm<=0 && cCIs>=0 && cCIf>0) { rising=true; cross=true; Print("Rising  Cross");}
   if (cCIm>=0 && cCIs<=0 && cCIf<0) {falling=true; cross=true; Print("Falling Cross");}
   
   // open orders based on cross
   if (cross) 0 ;
      {
      // Open new order based on trend direction of cross
      
       ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,cCIm<=0 && cCIs>=0 && cCIf>0,16384,0,Green);
         if(ticket>0)
                   
                   
       ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,cCIm>=0 && cCIs<=0 && cCIf<0,16384,0,Red);
         if(ticket>0)            
                   
                         
        
       
                   
        
                   
                                                      
                                                       
                                                                     
//---------------------------------------------------+

 

 

I make a few changes but its make the same mistake when i compile it 

 

 

 

 


avatar
736
honest_knave 2015.02.09 14:02 #
 

You're posting incomplete code, so I'm not entirely sure what you expect.

Also, please use the SRC button on the toolbar when you post code.

You also might find this link and this link useful. 

 

/*
   RDN compatibility by Jack Dowsun
*/

//+---------------------------+
//| Expert Cross Framework    |
//+---------------------------+
#property copyright "Jack Dowsun"
#property link      "http:123456789.com"

// User Input
extern double Lots = 0.1;
extern int    Interval=1;
extern int       myCCIs=30;   //  5 days
extern int       myCCIl=150;  // 25 days


// Global scope
double barmove0 = 0;
double barmove1 = 0;
int         itv = 0;

double Poin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {
   //Checking for unconvetional Point digits number
   if (Point == 0.00001) Poin = 0.0001; //5 digits
   else if (Point == 0.001) Poin = 0.01; //3 digits
   else Poin = Point; //Normal
   itv=Interval;
   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

int start()
           {

   bool      found=false;
   bool     rising=true;
   bool    falling=true;
   bool      cross=true;
   double cCIs;
   double cCIm;
   double cCIf;
   
   
    
   // Error checking
   if(AccountFreeMargin()<(1000*Lots))        {Print("-----NO MONEY"); return(0);}
   if(Bars<100)                               {Print("-----NO BARS "); return(0);}
   if(barmove0==Open[0] && barmove1==Open[1]) {                        return(0);}

   // bars moved, update current position
   barmove0=Open[0];
   barmove1=Open[1];

   // interval (bar) counter 
   itv++;

   // get CCI based on OPEN
   cCIs=iCCI(Symbol(),0,125,PRICE_OPEN,0);
   cCIm=iCCI(Symbol(),0, 25,PRICE_OPEN,0);
   cCIf=iCCI(Symbol(),0,  5,PRICE_OPEN,0);

   // is it crossing zero up or down
   if (cCIm<=0 && cCIs>=0 && cCIf>0) { rising=true; cross=true; Print("Rising  Cross");}
   if (cCIm>=0 && cCIs<=0 && cCIf<0) {falling=true; cross=true; Print("Falling Cross");}
   
   // open orders based on cross
   if (cross) 0 ; // what are you trying to do here?
      {
      // Open new order based on trend direction of cross
      
       ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,cCIm<=0 && cCIs>=0 && cCIf>0,16384,0,Green); // you haven't declared what ticket is
         if(ticket>0) // what are you trying to do here?
                   
                   
       ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,cCIm>=0 && cCIs<=0 && cCIf<0,16384,0,Red);
         if(ticket>0) // and again here            
                   
         // where does this if statement finish?
	 // where does start() finish?        
       
                   
        
                   
                                                      
                                                       
                                                                     
//---------------------------------------------------+
avatar
Moderator
3419
GumRai 2015.02.09 14:03 #
 
int start()
           {   //WHERE IS THE CLOSING BRACKET FOR THIS

   bool      found=false;
   bool     rising=true;
   bool    falling=true;
   bool      cross=true;
   double cCIs;
   double cCIm;
   double cCIf;
   
   
    
   // Error checking
   if(AccountFreeMargin()<(1000*Lots))        {Print("-----NO MONEY"); return(0);}
   if(Bars<100)                               {Print("-----NO BARS "); return(0);}
   if(barmove0==Open[0] && barmove1==Open[1]) {                        return(0);}

   // bars moved, update current position
   barmove0=Open[0];
   barmove1=Open[1];

   // interval (bar) counter 
   itv++;

   // get CCI based on OPEN
   cCIs=iCCI(Symbol(),0,125,PRICE_OPEN,0);
   cCIm=iCCI(Symbol(),0, 25,PRICE_OPEN,0);
   cCIf=iCCI(Symbol(),0,  5,PRICE_OPEN,0);

   // is it crossing zero up or down
   if (cCIm<=0 && cCIs>=0 && cCIf>0) { rising=true; cross=true; Print("Rising  Cross");}
   if (cCIm>=0 && cCIs<=0 && cCIf<0) {falling=true; cross=true; Print("Falling Cross");}
   
   // open orders based on cross
   if (cross) 0 ;
      {   //WHERE IS THE CLOSING BRACKET FOR THIS
      // Open new order based on trend direction of cross
      
       ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,cCIm<=0 && cCIs>=0 && cCIf>0,16384,0,Green);
         if(ticket>0)
                   
                   
       ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,cCIm>=0 && cCIs<=0 && cCIf<0,16384,0,Red);
         if(ticket>0)            
        //   if(ticket>0) what??????        
                   


avatar
13006
WHRoeder 2015.02.09 23:35 #
 

Don't paste code
Play video
Please edit your post.
For large amounts of code, attach it.
Back to topics list  

To add comments, please log in or register