Wrong parameters count error.

 
int init(){}
int deinit(){}

int BarsCount=0;


bool openlong()
   {//Write open LONG TRADE conditions here.
      
   }
   
bool openshort()
   {//Write open SHORT TRADE conditions here.
   
   }

bool closelong()
   {//Write close LONG TRADE conditions here.
   
   }

bool closeshort()
   {//Write close SHORT TRADE conditions here.
   
   }   

bool xopenlong()
   {// Actual order execution here for OPEN LONG TRADE.
   
   }
   
bool xopenshort()
   {//Actual order execution here for OPEN SHORT TRADE.
   
   }

bool xcloselong()
   {//Actual order execution for CLOSE LONG TRADE.
   
   }
   
bool xcloseshort()
   {//Actual order execution for CLOSE SHORT TRADE.
   
   }

int start()
  {
   if (Bars > BarsCount)
   {
      BarsCount=Bars;
      
      {//All indicators go in here...
      
      
      }
            
      if (openlong(true))   xopenlong();
      if (openshort(true))  xopenshort();
      if (closelong(true))  xcloselong();
      if (closeshort(true)) xcloseshort();
   }
  }




Can anyone please point out the error ? It says wrong parameters count error.
 

You are attempting to pass a single parameter (true) to each of four functions which you have declared not to expect any parameters to be passed to them when they are called.


CB

 
cloudbreaker:

You are attempting to pass a single parameter (true) to each of four functions which you have declared not to expect any parameters to be passed to them when they are called.


CB

cloudbreaker,


Got that corrected. Thank you. :-)


Corrected Version:

if (openlong()==1) xopenlong();
if (openshort()==1) xopenshort();
if (closelong()==1) xcloselong();
if (closeshort()==1) xcloseshort();

 
username1:

cloudbreaker,


Got that corrected. Thank you. :-)


Corrected Version:

if (openlong()==1) xopenlong();
if (openshort()==1) xopenshort();
if (closelong()==1) xcloselong();
if (closeshort()==1) xcloseshort();


Or just:

if openlong() xopenlong();


CB

Reason: