
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, i'm trying to optimize the code by using "switch" function, but i can't seem to make it work.
can anyone advice what's went wrong on the coding?
portion of the codes
/////////////////////////////////////////////////////////////////////////////////////////////
int TradeMathod=0;
if("condition to look for open trade")
{
TradeMathod = 1;
{
if (TradeMathod <= 0)
return(0);
}
}
switch(TradeMathod)
{
case 1 : ticket=OrderSend(Symbol(),OP_BUY,lotMM,Ask,3,0,Ask+TakeProfit*Point,"sample",MagicNumber,0,Green);
break;
case 2 : ticket=OrderSend(Symbol(),OP_SELL,lotMM,Bid,3,0,Bid-TakeProfit*Point,"sample",MagicNumber,0,Red);
break;
return(TradeMathod);
}
/////////////////////////////////////////////////////////////////////////////////////////////