Results 1 to 3 of 3
 0 Attachment(s)    

Thread: How to code for ECN Broker?

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    4

    Question How to code for ECN Broker?

    Hello

    How do you code for a ECN Broker [ i.e placing TP, SL after order has been opened with zero SL and TP....?

  2. #2

    Default

    OrderSelect(1, SELECT_BY_POS) //Select the relevant order.
    OrderModify(...) //Modify SL and TP
    FXCode Inc.
    Expert Advisor Developer

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    4

    Default

    Wouldn't you have to stop it from opening orders with a Sl/tp first,

    Code:
    extern string ECNB = "---ECN Broker---";
    extern bool ECN = True;
    
    
    int start() {
    
    
       if (ECN) {
             OrderSelect(postion, SELECT_BY_POS, MODE_TRADES);
             if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderTakeProfit() == 0.0) return (OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), price, 0));
             if (OrderMagicNumber() == MagicNumber && OrderSymbol() == Symbol() && OrderStopLoss() == 0.0) return (OrderModify(OrderTicket(), OrderOpenPrice(), price, OrderTakeProfit(), 0));
          }
    
    
    
    
       if (!ECN) OrderSend(Symbol(), OP_SELL, lots, Bid, slippage, Bid + StopLoss* Point, price, Comments, MagicNumber, 0, Red);
      else {
      OrderSend(Symbol(), OP_SELL, lots, Bid, slippage, 0, 0, Comments, MagicNumber, 0, Red);
          }

Similar Threads

  1. REQ: PLEASE HELP ME TO ADD 4-digit and 5-digit broker compatible and ECN Broker
    By james_phuc28 in forum Ideas for expert advisors
    Replies: 2
    Last Post: 09-27-2010, 03:21
  2. How to code MA on RSI in an EA ?
    By funyoo in forum MQL programming
    Replies: 0
    Last Post: 11-17-2008, 20:03

Tags for this Thread

broker, ecn, how to, slippage, stop

Posting Permissions

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