Streamline Your Trading with My Line Order System for MetaTrader 4

Mike 2011.09.30 17:14 23 0 0
Attachments

Introduction:

Are you looking for a simpler way to manage your trades? My Line Order EA is here to help! This handy tool uses horizontal lines for quick order management, making it easier than ever to keep track of your trades. Plus, it stores essential variables like Stop Losses and lot sizes right in the description, so you can focus on what really matters—trading!

External Variables:
  • LO_PREFIX: The starter string the EA looks out for (Default = "#")
  • LO_ORDER_CLR: Color of the open price of the trade
  • LO_ORDER_STYLE: Style of the line (0 = Solid, 1 = Dash, 2 = Dash Dot)
  • LO_STOPLOSS_CLR, LO_TAKEPROFIT_CLR: Colors for Stop Loss and Take Profit lines
  • LO_STOPLOSS_STYLE, LO_TAKEPROFIT_STYLE: Styles for Stop Loss and Take Profit lines
  • LO_LOTS: Default trade size if no value is entered in the line's description
  • LO_STOPLOSS, LO_PIPPROFIT: Default pip values for Stop Loss and Take Profit (can include decimals for certain brokers)
  • LO_PIPTRAIL: Default trailing stop; set to 0 for no trailing stop
  • LO_ALARM: Alerts when no trade is open (still needs testing)
  • MAGIC_NUMBER: Unique identifier sent with the order
  • LO_ECN: Set to 1 for ECN trading; sends orders without Stop Loss or Take Profit, then modifies immediately

Line Variables:

To utilize this EA effectively, use the following in the object name box (I’m sticking with the current default LO_PREFIX of "#"):

  1. #buy: Creates a market buy order using defined Stop Loss and Take Profit levels
  2. #sell: Creates a market sell order using defined Stop Loss and Take Profit levels
  3. #buypend: Creates a buy pending order at the current line value; order type sorted by EA
  4. #sellpend: Creates a sell pending order at the current line value; order type sorted by EA

In the object description box (without quotes), use:

  • "sl=" = Stop Loss in pips
  • "sq=" = Stop Loss as quote
  • "tp=" = Take Profit in pips
  • "tq=" = Take Profit as quote
  • "lo=" = Lots in order
  • "ts=" = Trailing stop in pips
  • "alarm=" = Set alarm

Once your order is open, three horizontal lines will appear—one for the open price, one for the Stop Loss level, and one for the Take Profit level. You can adjust these lines to modify your Stop Loss and Take Profit, and for pending orders, even the open price. After making changes, the EA will update the main line's description to reflect the new Stop Loss and Take Profit values. You can also adjust the values directly from the description, and it will refresh at the next tick.

To-Do List:

  • Test the alarm feature
  • Add OCO (One Cancels Other) orders
  • Implement email notifications at price levels
  • Support multiple lines for Take Profit and Stop Loss
  • Set exit orders based on indicator values (e.g., SMA)

Thanks for reading! I crafted this EA based on a similar tool called Line Order by Erich Pribitzer. I’ve been wanting to create something like this for a while, and I finally figured out how to make it happen.

I hope this helps you in your trading journey. If you encounter any issues or have feature suggestions, please don’t hesitate to share!

List
Comments 0