MQL Service My Account  Cart Contents  Checkout  
  Top » Catalog » Scripts » Trading helps » My Account  |  Cart Contents  |  Checkout   
OpenRemote (2)
Programming service (2)
Expert Advisors (2)
Indicators (5)
Scripts-> (8)
  Charting (4)
  Trading helps (4)
Quick Find
Use keywords to find the product you are looking for.
Advanced Search
Testimonials more

dear michal, i have recieved your indicator and it works great so far, no problems. it is exactly...(read more)

Blake Young
Shipping & Returns
Privacy Notice
Conditions of Use
Contact Us
OCO (One Cancels Other) €99,95

This is One Cancels the Other script. OCO orders are not available in MT4 but they are standard on other platforms. To get this functionality in MT4 one can run this script.

The script will be put in MetatraderInstall/experts/scripts folder and after restart of Metatrader it will be available in Navigator/Scripts.

With default parameters it opens two pending stop orders, one for sell and one for buy. This is also known as Straddle and very popular among News Trades. One have a possibility to change order type, set Slippage and Expiration. Also when StopLoss and/or TakeProfits are set to different value than 0 this value will be used during sending orders. Moreover, the script allows for adjusting stop loss and take profits by dragging them with mouse.

One should note, that setting pending orders require that they are put in minimum distance from a market price, Ask for BUYSTOP and Bid for SELLSTOP. This minimum price is different among brokers and can be found in Symbol Properties as Stops level. Most of brokers have value 5 which means that a BUYSTOP can be put with minimum distance of 6 pips above Ask, and SELLSTOP 6 pips below Bid. In case that orders are set too close then 'ERROR #130 : invalid stops' message is put.

The script has following inputs:

extern double BuyOrderOffset = 15; // 15 pips above the market (buy stop order)
extern double SellOrderOffset = -15; // 15 pips below the market (sell stop order)
extern double BuyLots = 1.0; // Buy position size
extern double SellLots = 1.0; // Sell position size
// Trailing stop
extern double StartTrail = 60; // Start trail after so many pips
extern double TrailingStop = 50; // 0 deactivates Trailing Stop
extern double TrailStep = 1; // With which increments TS moves
// Break Even
extern int GainForBE = 50; // How many pips will trigger Break Even. 0 deactivates.
extern int PipsBE = 10; // Level at which Break Even will be put
// Standard SL and TP
extern int StopLoss = 35; // 0 deactivates Hard Stop Loss
extern int TakeProfit = 75; // 0 deactivates Hard Take Profit

extern datetime Expiration = D'15/7/2020 12:00'; // At what time pending orders should expire
extern int Slippage = 1; // Allow entry slippage
extern color BUY_Color = Blue; // Buy line color
extern color SELL_Color = Red; // Sell line color
extern color SL_TP_Color = Orange; // Stop loss and take profit lines color
extern color BE_Color = Green; // Break even lines color
extern int Magic = 20110315;

Magic is a special number to be used as a tag to identify both orders from the same pair. Usually you don’t need to bother about it, however when you would like to put more than one straddle on a single pair (on different MT4 charts), then you should set this number to be different for each straddle. A straddle is identified by symbol name and magic.

Available Options:
This product was added to our catalog on Saturday 04 October, 2008.
Customers who bought this product also purchased
Constant range bars
Constant range bars

Multi Period Converter
Snap Shot
Snap Shot
Instant Orders
Instant Orders
Shopping Cart more
0 items
Notifications more
NotificationsNotify me of updates to OCO (One Cancels Other)
Tell A Friend
Tell someone you know about this product.
Reviews more
Write ReviewWrite a review on this product!
English French

Copyright © 2007-2024 MQL Service