Metatrader and OCO Orders - Page 2
Page 2 of 732 FirstFirst 12
Results 11 to 14 of 314

Thread: Metatrader and OCO Orders

  1. #11
    I 've been looking for and OCO EA for a long time and discovered this but having difficulty getting it to work. If some kind soul could give me some direction I wondred.

  2. #12
    I tried to program one OCO (one cancels another) OrderManager EA for mt4.

    Attached you'll get the EA in addition to an script to ship 2 pending orders. The EA has just 1 option: to ship an oco at startup (it will do if = true). You do not need to allow this if you use the script, etc..

    You may send oco-orders out of your ea's too, the only condition is that one globalvariable is set (hence no need for magicnumbers, etc.):

    Inserted Code GlobalVariableSet(ocoEAfxd_ O-C-O ticket1, ticket2);, whereas ticket1 is your ticket of the very first order, ticket2 the OrderTicket of the next order.

    The OCO ea recognizes the globalvar and attempts to find the oco-pair (of course the ea understands that ticketnumbers will change as soon as an order becomes a marketorder...).

    Following the EA finds one oco-pair, it checks if
    - the oco (following the 2 orders) are still pending
    - one is at market, then the EA should delete the remaining pending order
    - should equally orders become marketorders (e.g. due to newsspikes), the ea will try to delete the latest order to be certain that just one remains at market

    it's just a (original ) attempt, if you prefer, check it out
    https://www.forexsoutheast.asia/atta...899279012246.1
    https://www.forexsoutheast.asia/atta...7931356.script

  3. #13
    I know this thread is old but I can not seem to begin a new thread about this because I just joined.
    I have the OCO indior in my MT4 platform in my MAC, I put two pending orders of buy stop and sell stop on a pair and turned the autotrading on for OCO however, the OCO didn't cancel my one order if the other one was executed and then on a second pair it executed both orders (buy and sell halt ) and didn't cancel the worst one out.
    Not sure what I did wrong, if anyone has used this indior in their MAC please help!

  4. #14
    Frank,

    I don't think there's an OCO function in the MT4 interface. It is something which might be easily programmed using a small bit of knowledge, but, no, there's absolutely no OCO that I know about.



    Quote Originally Posted by ;
    Hello people,
    I've done some searching of all the threads to get some info on this.

    I am looking for the centre of setting an OCO order for a forex pair, at either extreme of expected high or low for the days trading, but I cannot find it readily in Metatrader.
    Who's gone down this path and solved the situation? What have I overlooked? Or do I need to incorporate something else to enable this function?
    I have also emailed Metaquotes.net with nothing useful in the response. They simply suggested using s/l and t/p as to how this could function as OCO, without explanation.
    This is her answer: You can use Stop Loss and Take Profit. Please attempt to refer to this'Trading -- Order Types' topic of the MetaTrader 4 Client Terminal integrated help files.
    You can, also, write your own expert to automated trading.
    When I checked these references in the Help of MT4, I didn't find any joy at all. I overlooked something, or there was nothing.
    I don't wish to exchange reverse pairs to simulate this purpose. My goal is to have an order in so that if a single goal is reached , it cancels the other goal too impending in the computer system.
    Thanks in advance for your help.
    FRank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.