Home System Trading Post

My Line Order 2.1: The Ultimate MetaTrader 4 Tool for Traders

Attachments
10484.zip (8.47 KB, Download 2 times)

Introduction

Hey traders! I'm excited to share the latest update of My Line Order, now in version 2.1. This version is packed with new features, the standout being the ability to manage multiple orders more effectively.

As it stands, you can fully close orders, but I'm actively working on adding features to allow partial closures and the option to scale into positions at specific levels. One of the features I'm particularly looking forward to is the ability to set levels based on indicator values—stay tuned for version 3!

Default Settings

extern string LO_PREFIX="#"; // Name of lines = LO_PREFIX+TicketNumber()+Specialty
extern double LO_LOTS=0.1;
extern double LO_PIPPROFIT=30;
extern double LO_PIPSTOPLOSS=20;
extern double LO_PIPTRAIL=0; // This trail acts like the default MT4 trail, once you are in profit by this much then the trail will start
extern bool  LO_AUTO_INCLUDE_SL_TP = 1; // If no values entered then default values used
extern bool  LO_CLOSE_ORDER_ON_DELETE = 1// Close order on deleting the main line else will re-create line next time
extern int  LO_ALARM=0; // 0 = No alarm, 1 = Alert, 2 = Email(Not implemented yet), 3 = Send file(Not implemented)
extern bool  LO_ECN=0; // Is the broker a ECN?
extern int  MAGIC_NUMBER = -1// Set at -1 to apply to all currently open trades
extern color  LO_ORDER_CLR=Gray; // Colour of open price line
extern int  LO_ORDER_STYLE=STYLE_DASH; // Style of open price line
extern color  LO_STOPLOSS_CLR=Red; // Colour of order's stop loss
extern int  LO_STOPLOSS_STYLE=STYLE_DASHDOT; // Style of order's stop loss
extern color  LO_MOVE_STOPLOSS_CLR=Teal; // Colour of line which moves stoploss a specified stoploss when hit
extern int  LO_MOVE_STOPLOSS_STYLE=STYLE_DASHDOT; // Style of line which moves stoploss a specified stoploss when hit
extern color  LO_STOPLOSS_MOVE_CLR=Orange; // Colour of line to which to move stop loss to
extern int  LO_STOPLOSS_MOVE_STYLE=STYLE_DASHDOT; // Style of line to which to move stop loss to
extern color  LO_STOPLOSS_CLOSE_CLR=Red; // The colour of line which closes at a stop loss
extern int  LO_STOPLOSS_CLOSE_STYLE=STYLE_DASHDOT; // The style of line which closes at a stop loss
extern color  LO_TAKEPROFIT_CLR=Green; // Colour of the final take profit
extern int  LO_TAKEPROFIT_STYLE=STYLE_DASHDOT; // Style of line of final take profit
extern color  LO_TAKEPROFIT_MOVE_CLR=Green; // Colour of the move take profit
extern int  LO_TAKEPROFIT_MOVE_STYLE=STYLE_DASHDOT; // Style of the move take profit
extern color  LO_TAKEPROFIT_CLOSE_CLR=Green; // Colour of the close take profit 
extern int  LO_TAKEPROFIT_CLOSE_STYLE=STYLE_DASHDOT; // Style of the close take profit

Initial Line Naming

#buy = Open a buy market trade
#sell = Open a sell market trade
#buypend = Open a buy pending order at that price
#sellpend = Open a sell pending order at that price
// ToDo: #buytp = Open a buy market trade with the line as take profit
// ToDo: #buysl = Open a buy market trade with line as stop loss
// ToDo: #selltp = Open a sell market trade with the line as take profit
// ToDo: #sellsl = Open a sell market trade with line as stop loss

// After trade variables (without quotes)
"sl=" = Stop loss in pips. Can have multiple orders. To have no stop loss use "N"
"tp=" = Take profit in pips. Can have multiple orders. To have no take profit use "N"
"ts=" = Trailing stop in pips. Can have multiple orders
"lo=" = The lots which are open. ToDo: If changed then order modify the lots in order
"alarm" = For values view the comment on LO_ALARM

Usage Instructions

The EA will automatically populate the description with the main order properties based on your current settings. If you adjust the horizontal lines, the description will update to reflect the new values. For multiple orders, separate them with a comma and for set levels, use the format "value in pips@level" with no spaces. You can create as many lines as you need!

Upcoming Features

  • Lot modification based on description and set levels
  • Stop loss/take profit at indicator values with the option to add or remove other indicators (I think I have a handle on this)
  • Line alarms (independent of actual trades)

Future Possibilities

  • Order cancellation for other orders
  • Stop loss and take profit based on account size and trade profit

If you run into any issues or have suggestions for version 3, feel free to drop a comment or PM me. Your feedback is invaluable!

Thanks for reading!

P.S. This isn’t the final version! I’m actively working on bug fixes and adding new features almost daily. I’ll update the codebase periodically, but if you want the latest version or think you’ve found a bug that’s been fixed, just reach out and I’ll send it your way. All feedback is welcome—let’s make this EA the best it can be!

Related Posts

Comments (0)