Thread: How to code?
View Single Post
  #515 (permalink)  
Old 11-29-2007, 12:36 PM
antone antone is offline
Senior Member
 
Join Date: Oct 2006
Posts: 104
antone is on a distinguished road
i just change and added.. the red characters.. hope that helps..

Quote:
total = OrdersTotal();
if(total>=1)
{
if(MA11>MA21 && MA12<MA22)
{
ticket=OrderSend(Symbol(),OP_BUY,2*Lots,Ask,5,Ask-stoploss*Point,0,0,Magic_number,0,Green);
return (0);
}
if(MA11<MA21 && MA12>MA22)
{
ticket=OrderSend(Symbol(),OP_SELL,2*Lots,Bid,5,Bid +stoploss*Point,0,0,Magic_number,0,Red);
return (0);
}
}
if(total<1)
{
if(MA11>MA21 && MA12<MA22)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,5,Ask-stoploss*Point,0,0,Magic_number,0,Green);
}
if(MA11<MA21 && MA12>MA22)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,5,Bid+s toploss*Point,0,0,Magic_number,0,Red);
}
}
Reply With Quote