Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

My Line Order Version 2.1 - MetaTrader 4 Expert - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

There are a lot of new features in this version, the most notable being multi-orders.

In this version it is only possible to close orders completely, but in future versions I hope to add the ability to add positions and close partial positions at set levels. Another feature I'm looking forward to adding is the ability to set levels at certain metric values ​​(hopefully in version 3).

Outer string LO_prefix = "#" ; // Line name = LO_PREFIX+TicketNumber()+Specialty
External double LO_LOTS= 0.1 ; External double LO_PIPPROFIT= 30 ; External double LO_PIPSTOPLOSS= 20 ; External double LO_PIPTRAIL= 0 ; // This tracking is just like the default MT4 tracking, which starts once you make this much profit
External Boolean value LO_AUTO_INCLUDE_SL_TP = 1 ; // If no value is entered, use the default value
External Boolean value LO_CLOSE_ORDER_ON_DELETE = 1 ; // Close the order after deleting the main line, otherwise the line will be re-created next time
external integer low alarm = 0 ; // 0 = no alarm, 1 = alarm, 2 = email (not implemented yet), 3 = send file (not implemented yet)
External boolean LO_ECN= 0 ; // Is the broker ECN?
External integer MAGIC_NUMBER = - 1 ; // Set to -1 to apply to all currently open trades
External color LO_ORDER_CLR= gray ; // Color of the opening price line
External integer LO_ORDER_STYLE= style_DASH ; // style of opening price line
External color LO_STOPLOSS_CLR= red ; // order stop loss color
External integer LO_STOPLOSS_STYLE= STYLE_DASHDOT ; // Order stop loss style
Outer color LO_MOVE_STOPLOSS_CLR= cyan ; // Color of the line that will move the stop to the specified stop when hit
External integer LO_MOVE_STOPLOSS_STYLE= STYLE_DASHDOT ; // Move the stop to the specified stop's line style when hit
External color LO_STOPLOSS_MOVE_CLR= orange ; // color of stop loss line
External integer LO_STOPLOSS_MOVE_STYLE= STYLE_DASHDOT ; // Stop loss line style
External color LO_STOPLOSS_CLOSE_CLR= red ; // Color of stop loss closing line
External integer LO_STOPLOSS_CLOSE_STYLE= STYLE_DASHDOT ; // Line type to close with stop loss
External color LO_TAKEPROFIT_CLR= green ; // Final profit color
External integer LO_TAKEPROFIT_STYLE= STYLE_DASHDOT ; // The style of the final profit line
External color LO_TAKEPROFIT_MOVE_CLR= green ; // Color of take profit trend
External integer LO_TAKEPROFIT_MOVE_STYLE= STYLE_DASHDOT ; // The style of the take profit trend
External color LO_TAKEPROFIT_CLOSE_CLR= green ; // Closing take profit color
External integer LO_TAKEPROFIT_CLOSE_STYLE= STYLE_DASHDOT ; // Style of closing position and taking profit
 Initial Row Name Variable #buy = Open Buy Market Transaction
#sell = Open sell market trade
#buypend = Open a buy pending order at this price
#sellpend = Open a pending sell order at this pricen> To-dos: #buytp = Open a buy market trade with a line as stop-loss To-do: #buysl = Open a buy market trade with a line as a stop-loss To-do: #selltp = Open a sell market trade with a line as a take-profit To-do: #sellsl = Open a sell market trade with a line as a stop-loss Post-trade variable (without quotes) “sl=" = Stop loss points. There can be multiple orders. Use "N" when there is no stop loss "tp=" = stop loss pips. There can be multiple orders. No take profit usage "N" "ts=" = trailing stop loss pips. There can be multiple orders "Lo=" = open lots. (TODO: Modify batches in sequence if changed) "alert" = for value, see comment on LO_ALARM

How to use instructions

The EA will automatically fill in the description with the main order properties based on your current settings. If you move the horizontal line, it will update the description with the new value. To make multiple orders you need to separate them using "," and to set a setting level it needs to be in the following format "The point at which you want to change the value @ the value in the level" without any spaces in it. You can create as many rows as you need.

clear update

Batch modification functionality from description and settings levels

Stop Loss/Take Profit at indicator value and be able to add or remove other indicators (I think I know how to do that)

Line alarms (alarms not related to actual transactions)

Possible future updates

Order Cancel Other Orders

Stop loss and take profit based on account size and trading profit

If you have any questions or ideas I could put in version 3, please comment here or PM me,

P.S. This release is by no means the last, I'll be fixing bugs and adding new features every week (if not every day). I will only frequently release the latest version to the code base, so if you would like to have the latest version or find a bug that may have been fixed in a later version, please message me and I will send you the latest version. To me, all feedback is good and tells me what went wrong. I will try to make this EA as inclusive and bug-free as possible.


Attachment download

📎 LineOrderLibrary.mqh (41.64 KB)

📎 MyLineOrder_version_2_1.mq4 (2.47 KB)

Source: MQL5 #10484

Verification code Refresh