Download MetaTrader 5
To add comments, please log in or register
Publish your articles and improve your rating!
MetaQuotes Software Corp.
Moderator
180340
MetaQuotes Software Corp. 2011.04.01 08:31 

Place OCO Order, One pip Limit Order and One Pip Stop Order:

Places OCO Order, One pip Limit Order and One Pip Stop Order on Metatrader 4 platform.

Author: Raymond

jonus
221
jonus 2011.04.02 07:34  

Sorry, 2 questions:

1. OCO? whats this EA supposed to do?

2. what does // InitGlobalVar = (InitGlobalVar || true) // do?

Raymond
8
Raymond 2011.04.02 19:25  
hkjonus:

Sorry, 2 questions:

1. OCO? whats this EA supposed to do?

2. what does // InitGlobalVar = (InitGlobalVar || true) // do?


1. i) OCO (One Cancels the Others Order).

ii) All Broker limit the pending order price which differ to market price 2-3 pips.

Market Price Bid: 1.40000 Ask : 1.40020
You can not place Limit Buy Pending Order at 1.40010.
Use this OCO_EA, you can set to limit Buy at 1.40010 or 1.40016 (No limit).

2. Sorry, InitGlobalVar = (InitGlobalVar || true) is used for debuging, they are redundant !

End of reply

------------------------------------------------------------------------------------------------------------

A Expert Advisor MonitorScreen.mq4 will be release on 8-15 April 2011

After open a trade,
i) take a screen shot in METATRADER/expert/files .
ii) notice to you via email.

MQL4 Comments
16319
MQL4 Comments 2011.06.14 08:37  

thanks but in fact i have some question

how could this EA place pending order about 1 pip from current price while the broker doesn't accept below 5 pips ( descibe the idea )

i put it on chart and it didn't place any orders how does it work

i need such expert but to place only sellstop and buystop from 1 or 2 pips from the current price

Raymond
8
Raymond 2011.06.15 07:45  
somaare:

thanks but in fact i have some question

how could this EA place pending order about 1 pip from current price while the broker doesn't accept below 5 pips ( descibe the idea )

i put it on chart and it didn't place any orders how does it work

i need such expert but to place only sellstop and buystop from 1 or 2 pips from the current price


No conern the broker doesn't accept below 5 pips

Market Price Bid 1.44226 Ask 1.44250

OCO_BUY_STOP - Buy Stop Price set to "1.44260"

OCO_SELL_STOP - Sell Stop Price set to "1.44216"

OCO_confirmation - set "1"

OCO_oCO - if OCO_oCO = "1", One Canel Others

OCO_sL_Pips - Stop Loss Pips set to "50"

OCO_tP_Pips -Take Profit Pips set to "50"

Fine

MQL4 Comments
16319
MQL4 Comments 2011.07.08 18:42  

Hi,

I haven't tried this yet. But as a NuB wanting to build up a Library of reusable programming modules and looking for OCO, which I didn't expect to be native to MQL4; a very hearty 'Thanks: VERY nice! (< 8)

OTO = One-Triggers-the-Other Module?

MQL4 Comments
16319
MQL4 Comments 2011.07.08 18:51  
hkjonus:

Sorry, 2 questions:

1. OCO? whats this EA supposed to do?


OCO stands for 'Order Cancels Other' This places two (pending) orders: both a Buy and a Sell order; When the market movement triggers one in the direction that is profitable, the other order is automatically cancelled. Here is a description from BabyPips.Com:

One-Cancels-the-Other (OCO)

An OCO order is a mixture of two entry and/or stop-loss orders. Two orders with price and duration variables are placed above and below the current price. When one of the orders is executed the other order is canceled.

Let's say the price of EUR/USD is 1.2040. You want to either buy at 1.2095 over the resistance level in anticipation of a breakout or initiate a selling position if the price falls below 1.1985. The understanding is that if 1.2095 is reached, your buy order will be triggered and the 1.1985 sell order will be automatically canceled.

Read more: http://www.babypips.com/school/types-of-orders.html#ixzz1RX7qZaJg
MQL4 Comments
16319
MQL4 Comments 2013.09.03 20:12  

What am I doing wrong:

downloaded the EA into my MT4 experts folder - shut down the MT4 dealing station - double-clicked the EA, and compiled it. It now became .ex file - re-open MT4, OCO EA appears in experts (it has lost all colours, just like other EAs) - dragging it onto a chart, (click allow live trading) OCO EA appears in top right corner

but then what - nothing else happens: no dialog window for parameters pops up.

tky!

Anamorphic
124
Anamorphic 2014.10.06 15:20  

Hi

This looks great but how do I input the trade information ?

/
To add comments, please log in or register