I want to creat an expert adviser which opens buy and sell at the same time in the current price and close the operation for 15 pip sell and 15 pip buy, and when the first operation reaches the 15pip it opens at that price another buy and sell operation... thanx
- Can anybody help me with a new code?
- How can I create a script that create both buy and sell order at 10 pips apart from the current price?
- open buy and sell order at the same price
Good for you.
Is there a question hidden in there?
CB
webroller:
I want to creat an expert adviser which opens buy and sell at the same time in the current price and close the operation for 15 pip sell and 15 pip buy, and when the first operation reaches the 15pip it opens at that price another buy and sell operation... thanx
I want to creat an expert adviser which opens buy and sell at the same time in the current price and close the operation for 15 pip sell and 15 pip buy, and when the first operation reaches the 15pip it opens at that price another buy and sell operation... thanx
This is pointless.. you will always lose as you pay double spread. Even if you set your stop at 10 pips sometimes both stop losses will be hit. You're wasting your time...
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (OrdersTotal()==0)
{
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-15*Point,Ask+15*Point);
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Bid+15*Point,Ask-15*Point);
}
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
if (OrdersTotal()==0)
{
OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-15*Point,Ask+15*Point);
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Bid+15*Point,Ask-15*Point);
}
return(0);
}
//+------------------------------------------------------------------+
THANX A LOT TRYING IT
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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