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

 

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

 

Sorry, 2 questions:

1. OCO? whats this EA supposed to do?

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

 
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.

 

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

 
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

 

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?

 
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
 

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!

 

Hi

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

 
Don't waste your time on this, doesn't work.  Forum should either delete this rubbish, or highlight that it is useless.
 
Does not work.