E
Buy Stops and Sell Limits have to be placed above current price, you have them placing below
See this EA for counting & managing orders
Good Luck
-BB-
![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
Hi, I'm new with MQL4 Community
Please help me why this scripts doesn't work only for Sell Limit and Buy Stop...
//+------------------------------------------------------------------+
#include <stdlib.mqh>
#include <WinUser32.mqh>
extern double LotEUB = 0.23;
extern double PipEUB = 39;
extern double LotEUS = 0.12;
extern double PipEUS = 59;
//+------------------------------------------------------------------+
int start()
{
double bid =MarketInfo("EURUSD",MODE_BID);
double ask =MarketInfo("EURUSD",MODE_ASK);
double point =MarketInfo("EURUSD",MODE_POINT);
OrderSend("EURUSD",OP_BUY,LotEUB,Ask,3,0,0,"EUB1",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYLIMIT,LotEUB * 2,NormalizeDouble(Ask - PipEUB*1*Point,Digits),3,0,0,"EUB2",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYLIMIT,LotEUB * 3,NormalizeDouble(Ask - PipEUB*2*Point,Digits),3,0,0,"EUB3",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYLIMIT,LotEUB * 4,NormalizeDouble(Ask - PipEUB*3*Point,Digits),3,0,0,"EUB4",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLSTOP,0.1,NormalizeDouble(Ask - PipEUB*1*Point - 2*Point,Digits),3,0,0,"EUSS1",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLSTOP,0.1,NormalizeDouble(Ask - PipEUB*2*Point - 2*Point,Digits),3,0,0,"EUSS2",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLSTOP,0.1,NormalizeDouble(Ask - PipEUB*3*Point - 2*Point,Digits),3,0,0,"EUSS3",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLLIMIT,LotEUS * 2,NormalizeDouble(Bid - PipEUS*1*Point,Digits),3,0,0,"EUS2",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLLIMIT,LotEUS * 3,NormalizeDouble(Bid - PipEUS*2*Point,Digits),3,0,0,"EUS3",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELLLIMIT,LotEUS * 4,NormalizeDouble(Bid - PipEUS*3*Point,Digits),3,0,0,"EUS4",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYSTOP,0.1,NormalizeDouble(Bid - PipEUS*1*Point + 2*Point,Digits),3,0,0,"EUBS1",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYSTOP,0.1,NormalizeDouble(Bid - PipEUS*2*Point + 2*Point,Digits),3,0,0,"EUBS2",0,0,CLR_NONE);
OrderSend("EURUSD",OP_BUYSTOP,0.1,NormalizeDouble(Bid - PipEUS*3*Point + 2*Point,Digits),3,0,0,"EUBS3",0,0,CLR_NONE);
OrderSend("EURUSD",OP_SELL,LotEUS,Bid,3,0,0,"EUS1",0,0,CLR_NONE);
return;
}
//+------------------------------------------------------------------+
and how to stop EA automatically when all order reached..
Thx