Try something like this?
int start() { if (Volume[0] < 5000) return (0); if (OrdersTotal() > 0) return (0); if(Close[0]>Open[0]) { OrderSend(Symbol(), OP_BUY, lots,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Blue); return (0); } if(Close[0]<Open[0]) { OrderSend(Symbol(), OP_SELL, lots,Bid, 3, Bid + stop_loss * Point, Ask - take_profit * Point, IDENT, MAGIC, 0, Red); return (0); } return(0); }
-BB-

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
Buy with volumes > 5000
daily when bar is high
int start(){
if (last_bar == Bars) return(0);last_bar = Bars;
double Volumes;
if (OrdersTotal() == 0 && Volumes >5000){
{
// if(Close[0]>Open[0])return(0);
}
OrderSend(Symbol(), OP_BUY, lots,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Blue);
{
// if(Close[0]<Open[0])return(0);
OrderSend(Symbol(), OP_SELL, lots,Bid, 3, Bid + stop_loss * Point, Ask - take_profit * Point, IDENT, MAGIC, 0, Red);
}
}
return(0);
}