My Line Order

0
(0)
Name:
My Line Order
Author: heelflip43 (2011.09.30 10:14)
Downloaded: 3816
Download:
My Line Order 1
 MyLineOrder.mq4 (20.4 Kb) View

Introduction:

This EA uses horizontal lines to have quick and easy order management. It uses the description to store variables such as Stop Losses and lot sizes.

External variables:

  • LO_PREFIX = The starter string which EA to look out for. Default = "#"
  • LO_ORDER_CLR = Colour of the open price of the trade
  • LO_ORDER_STYLE = The number for the style of the line ( 0 = Solid, 1 = Dash, 2 = Dash Dot)
  • LO_STOPLOSS_CLR, LO_TAKEPROFIT_CLR = The colour of the Stop loss line and Take profit line respectively
  • LO_STOPLOSS_STYLE, LO_TAKEPROFIT_STYLE = The style of the Stop loss line and Take profit line respectively
  • LO_LOTS = The default size of trade, if no value entered in line's description then this is used
  • LO_STOPLOSS, LO_PIPPROFIT = The default pip values for stop loss and take profit. 5th point brokers can have a decimal here eg. 20.5
  • LO_PIPTRAIL = The default trailing stop. If set to 0 no trailing stop
  • LO_ALARM = When a trade isn't open then an alert will be activated. (Not sure if it works need to test it first)
  • MAGIC_NUMBER = The magic number sent along with the order
  • LO_ECN = If trading with an ECN set to 1. Will send the order without Stop Loss or Take Profit then modify it straight away.

Line variables:

Use the following in the object name box(i'm using 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 your line's current value. Pending order type is sorted by EA
  4. #sellpend = creates a sell pending order at your line's current value. Pending order type is sorted by EA

Use the following in the object description box(without quotes):

  • "sl=" = stop loss in pips
  • "sq=" = stop loss as quote
  • "tp=" = take profit in pips
  • "tq=" = take profit as quote
  • "lo=" = lots in order. (Todo: When changing after order open close correct amount of lots)
  • "ts=" = trailing stop as pips
  • "alarm=" = set alarm

After the order is open 3 horizontal lines will created. One for the open price, one for the stop loss level and one for the take profit level. When you move these around it will modify the stop loss, take profit and (for pending orders) the open price. After you have modified your order the EA will update the description of the main line which will have the name of "#"+TicketNumber to the new values of stop loss and take profit. You can also modify the values straight from the description and it will update at the next tick.

To do list:

  • Test out alarms
  • Add OCO orders
  • Add send email at price
  • Multiple lines for Take Profit and Stop Loss
  • Set exit orders at indicator values e.g. SMA's

Thanks I wrote this EA loosely based on a similar one on this forum called Line Order by Erich Pribitzer mainly because I've wanted to do for a while couldn't think on how to do it.

I hope this helps you in your trading, please post if any problems occur or you can think of any features which might be good.

7 comments  To post a new comment, please log in or register

Hi. This is good system. How can I download One-Click EA?. Can you post the web site or EA for one-click ?
25.01.2012 22:53 5101942

I am working on a similar idea, I found that the horizontal line has three built in variables which are easier to use than putting in the description.

OBJPROP_PRICE1 to 3 which I used for SL and TP

06.12.2011 10:47 Guiri

where to download mt oneclick.exe?
20.10.2011 00:02 kelly

heelflip43:
wllrd:
you are so kind of sharing it,thanks

The EA may have some problems

1,"delete line" can not close a position or cancel a pending order

2, Is take profit a must,how to do if i dont want to set a tp.

3,After cancel a pending order or close a position,the original lines are still there

This is only the first version and I was only going on what I needed at the time. I should have the new version ready soon, I'll try include an option to leave out Take Profit's and Stop losses. Yes at the moment the EA will just create a new line instead of close an order. The lines should be deleted the next time the EA runs, all I can say is that they do when I run it.

thanks again

13.10.2011 18:19 wllrd

wllrd:
you are so kind of sharing it,thanks

The EA may have some problems

1,"delete line" can not close a position or cancel a pending order

2, Is take profit a must,how to do if i dont want to set a tp.

3,After cancel a pending order or close a position,the original lines are still there

This is only the first version and I was only going on what I needed at the time. I should have the new version ready soon, I'll try include an option to leave out Take Profit's and Stop losses. Yes at the moment the EA will just create a new line instead of close an order. The lines should be deleted the next time the EA runs, all I can say is that they do when I run it.

12.10.2011 15:45 heelflip43

you are so kind of sharing it,thanks

The EA may have some problems

1,"delete line" can not close a position or cancel a pending order

2, Is take profit a must,how to do if i dont want to set a tp.

3,After cancel a pending order or close a position,the original lines are still there

12.10.2011 03:13 wllrd

My Line Order 2

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?



Author: Forex Wiki Team
We are a team of highly experienced Forex Traders [2000-2023] who are dedicated to living life on our own terms. Our primary objective is to attain financial independence and freedom, and we have pursued self-education and gained extensive experience in the Forex market as our means to achieve a self-sustainable lifestyle.