Code Question - OrderSend()

thread: Code Question - OrderSend()

  1. #1
    Junior Member ETERNOXVII's Avatar
    21

    Code Question - OrderSend()

    Can somebody be kind enough to tell me whats wrong with my code please?

    OrderSend(Symbol(), OP_BUY, lots, Ask, 3, Ask-stoploss*Point, Ask takeprofit*Point, Buy trade, magical, Blue);


    Thanks
    JT

  2. #2
    Junior Member ETERNOXVII's Avatar
    21
    Is it true that the parameter between blue, magic have to be 0? I am new to this and get confused.

    #property copyright Copyright 2015, MetaQuotes Software Corp..
    #property link https://www.mql5.com
    #property version 1.00
    #property stringent
    extern double lots = 0.01;
    extern int takeprofit = 72;
    extern int stoploss = 24;
    extern int magic = 33454;
    //p ------------------------------------------------------------------
    //| Expert initialization serve |
    //p ------------------------------------------------------------------
    int OnInit()

    //--
    opensell();
    //--
    return(0);

    // ------------------------------------------------------------------
    //| Expert deinitialization function |
    // ------------------------------------------------------------------
    void OnDeinit(const int reason)

    //--


    // ------------------------------------------------------------------
    //| Expert tick function |
    // ------------------------------------------------------------------
    void OnTick()

    //--


    // ------------------------------------------------------------------
    void opensell()

    OrderSend(Symbol(), OP_SELL, lots, Bid, 3, Bid stoploss*Point, Bid-takeprofit*Point, Sell trade, magic, Blue);

  3. #3
    Junior Member ETERNOXVII's Avatar
    21
    Thanks for the responces but CJA set me straight that it was my broker and not my code.

    Thanks everybody
    JT

  4. #4
    [quote=thjw;7988728]Can the parameter between magic, blue have to be 0?

    You probably have the expiry date set to blue from the preceding.

  5. #5
    Junior Member jarivfer's Avatar
    11
    Hi JT,

    comparing it with http://docs.mql4.com/trading/ordersend, I see two different things:

    1. You did not normalize TP and SL worth
    2. You're missing one parameter between magic and Blue

    Greets,

  •