Add Pending Stop depending on the last trade to enter the market. HELP

To add comments, please log in or register
YThi MJ
116
YThi MJ  

Hi, 

Please, I need your help in code for adding Pending Stop Orders to an EA in MQL4. How can I open a stop order depending on the last trade that entered the market?

Let's say I open a trade 0.01 BUY but and I want the the EA to take that trade and place a new order in the opposite direction with a multiplier. So the EA must open a 0.02 SELL Pending Stop Order at X pips. One it gets in the market, a 0.04 BUY Pending Stop Order is sent.

Basic Principles - Trading Operations - MetaTrader 5 Help
Basic Principles - Trading Operations - MetaTrader 5 Help
  • www.metatrader5.com
is an instruction given to a broker to buy or sell a financial instrument. There are two main types of orders: Market and Pending. In addition, there are special Take Profit and Stop Loss levels. is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the...
YThi MJ
116
YThi MJ  

Okay, I made it. Now the problem it is opening unlimited number of Stop Orders.... This is CRAZY, hahaha

To add comments, please log in or register