1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

Suggestion Place order by BID size

Discussion in 'Chit Chat' started by Idalecio Dias Pereira, 01 Jul 2021.

  1. Idalecio Dias Pereira

    Idalecio Dias Pereira New Member

    Equity
    Credit
    Ref Point
    I know almost nothing about MQL4 so I have a problem with this EA project, so I would like someone to help me understand why orders are not placed:
    ... .... ...
    input double lotsize = 0.1; //Size of the trade


    int OnInit()
    {

    //---
    return (INIT_SUCCEEDED);
    }
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
    //---

    }

    //+------------------------------------------------------------------+
    void OnTick()
    {
    //---
    //+------------------------------------------------------------------+
    if(Bid < 34700 && Bid > 34450)
    {
    if( Symbol()=="BTCUSD")
    {
    int ticket = OrderSend(Symbol(),OP_BUY,lotsize,Bid,3,0, 37199, "Robot Orders IDP 09",0,0,Blue);
    }
    }
    if(Ask < 39500 && Ask > 39450)
    {
    if( Symbol()=="BTCUSD")
    {
    int ticket = OrderSend(Symbol(),OP_SELL,lotsize,Ask,3,0, 35199, "Robot Orders IDP 09",0,0,Red);
    }
    }

    }

    ... ... ...
    Thanks in advance
     

Share This Page