MQL4 - automated forex trading   /  

Code Base

Read Financial Magazines in MetaTrader 4 and MetaTrader 5!

Code Base  Scripts  Script opening orders To post a new code, please log in or register

Download MetaTrader 5 and visit MQL5.community Code Base
and Trade on the Go!
and Trade on the Go!
Couldn't find the right code? Order it in the Jobs section

This script is for
MetaTrader 4
Download MT 4 - 455 Kb

and Trade on the Go!

and Trade on the Go!

Name:
Script opening orders [ ru ]
Author: cmillion (2010.05.17 10:14)
Rating: 8
Downloaded: 6227
Download:
 OpenOrder_EN.mq4 (1.8 Kb) View
 Open_1_Order_1.0.mq4 (1.6 Kb) View
 Open_2_Order_0.5.mq4 (1.8 Kb) View
 Open_3_Order_0.3.mq4 (2.0 Kb) View
 Open_4_Order_0.25.mq4 (2.1 Kb) View

Sometimes you want to help the advisor and add the order, but that Advisor has its own Magic number needed to be placed orders with its number.

Variables:
  • stoploss - level exhibiting SL, if 0, then SL is not exposed
  • takeprofit - level exhibiting TP, if 0, then TP is not exposed
  • Magic - a unique order number
  • SELL - open SELL order
  • BUY - open BUY order
  • Lot - Order Quantity
  • slippage - the maximum deviation of the price for market orders

The simultaneous installation of different directions of orders for this variable SELL BUY and set to true.

When failures of connection or a sharp price movement will be exhibiting 10 attempts to place an order, after that the script stops.

To run the script, drop it on the chart window and the menu will appear, select the options and type of the opened orders.


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

I was looking for something like this for some time. But sadly every time i'm trying to lunch the script i get error message 4109. I would be very grateful if can help me to solve the problem. Especially i'm interesting in the opening orders in different directions at the same time.

Best regards

Yegor

01.05.2011 14:43 Gerion

Thank you

I search that for long time.

30.09.2010 22:31 crystal7
mrozali1 wrote:
THIS IS GREAT...THANK YOU !!!!!

Glad to help! Ask! cmillion@narod.ru
26.05.2010 23:59 cmillion
THIS IS GREAT...THANK YOU !!!!!
26.05.2010 12:47 mrozali1
mrozali1 wrote:

Hi,

Your script is good. I have been trying to write a script like this but it doesn't work.

Maybe you can help!!

When I open order, I will open 1, 2, 3 or 4 orders.

1 Order: Ord1, Lot=1, SL=70, TP=25

2 Orders: Ord1, Lot =0.5, SL=70, TP=25; Ord2, Lot =0.5, SL=70, TP=50

3 Orders: Ord1, Lot =0.3, SL=70, TP=25; Ord2, Lot =0.3, SL=70, TP=50; Ord3, Lot =0.3, SL=70, TP=75

4 Orders : Ord1, Lot =0.25, SL=70, TP=25; Ord2, Lot =0.25, SL=70, TP=50; Ord3, Lot =0.25, SL=70, TP=75; Ord4, Lot =0.25, SL=70, TP=0

Can the above script be modified to do the above steps. Variables are, Orders, Lot, SL and TP.

TQ



26.05.2010 12:46 mrozali1

Hi,

Your script is good. I have been trying to write a script like this but it doesn't work.

Maybe you can help!!

When I open order, I will open 1, 2, 3 or 4 orders.

1 Order: Ord1, Lot=1, SL=70, TP=25

2 Orders: Ord1, Lot =0.5, SL=70, TP=25; Ord2, Lot =0.5, SL=70, TP=50

3 Orders: Ord1, Lot =0.3, SL=70, TP=25; Ord2, Lot =0.3, SL=70, TP=50; Ord3, Lot =0.3, SL=70, TP=75

4 Orders : Ord1, Lot =0.25, SL=70, TP=25; Ord2, Lot =0.25, SL=70, TP=50; Ord3, Lot =0.25, SL=70, TP=75; Ord4, Lot =0.25, SL=70, TP=0

Can the above script be modified to do the above steps. Variables are, Orders, Lot, SL and TP.

TQ

25.05.2010 03:53 mrozali1