Results 1 to 3 of 3
 0 Attachment(s)    

Thread: BUY & SELL .. Help

  1. #1

    Default BUY & SELL .. Help

    Hi all

    i am trying to write an EA .. I Have no enough experience to do that . i am in need to your help

    this is BUY ORDER's code

    int BuyOrderTicket = OrderSend(Symbol(), OP_BUY, Lots, Ask, slip, Ask - (InitialStop*Point), Ask + (TakeProfit*Point),

    and this is the SELL ORDER's code

    int SellOrderTicket = OrderSend(Symbol(), OP_SELL, Lots, Bid, slip, Bid + (InitialStop*Point), Bid - (TakeProfit*Point),

    does anyone here can write another code to close SELL ORDER when BUY ORDER closed. they should be closed at the same time

    nothe it is important that the SELL ORDER still open untill BUY ORDER closed

    thanx in advance


  2. #2


    Dear Funyoo ... are you here ??? ... help me

  3. #3
    Administrator funyoo's Avatar
    Join Date
    Sep 2008


    Quote Originally Posted by Options Trader View Post
    Dear Funyoo ... are you here ??? ... help me
    Hi Options Trader,

    The code have to count the buy orders :

    Close sell if buy orders = 0 :

             if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic && OrderType()==OP_SELL){
    Count function :

    int count(int type,int magic){
       int cnt;cnt=0;
       for(int i=0;i<OrdersTotal();i++){
          if(OrderSymbol()==Symbol() && OrderType()==type && ((OrderMagicNumber()==magic)||magic==0)){

Similar Threads

  1. EA Request Trailing Buy Stop/Sell Stop or Buy Limit/Sell Limit
    By bseth in forum Ideas for expert advisors
    Replies: 3
    Last Post: 02-25-2016, 03:04
  2. buy/sell AT EMA, not a cross
    By sleepypipsCDN in forum Ideas for expert advisors
    Replies: 0
    Last Post: 11-19-2009, 14:50
  3. Buy and sell at Sweetspot EA
    By badai_chiko in forum MQL programming
    Replies: 4
    Last Post: 09-18-2009, 04:19

Tags for this Thread

magic, slippage, trader

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts