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

want to create ea and still learning please advise

Discussion in 'Belajar MQL dari Nol' started by gxxglesxxk, 09 Oct 2021.

  1. gxxglesxxk

    gxxglesxxk New Member

    Equity
    Credit
    Ref Point
    Hi All Senior , I am very new into Mql4 code . Would like to seek for advise about coding , Appreciate anyone can advise and teach ...... Thank you and sorry if the code is messy

    i wanted create an EA that following

    entry : Buy Stop order at last 3 candle high above 300 point ( include wick)

    entry : Sell Stop order at last 3 candle low below 300 point ( include wick )

    once entry one buy/sell opposite pending cancel

    if buy > sell limit order will place following last 2 candle lowest 300 point ( include wick )

    if sell > buy limit order will place following last 2 candle highest 300 point ( include wick )

    sell/buy limit order will reset and move follow new 2 candle highest/lowest, once candle touch limit order opposite active order will close



    my example:

    struct candlesticks

    {

    double open; // open price

    double close; // close price

    double high; // high price

    double low; // low price

    datetime date; // date

    };


    void OnTick()

    {

    // if no open orders exist

    if (OrdersTotal()==0)



    // send a sell limit order

    int buyticket = OrderSend


    int Mode = OP_BUYSTOP;

    double Entry=NormalizeDouble((Open[3]),MODE_DIGITS);

    if (Ask > Entry && Entry > 0) Mode = OP_BUYLIMIT;

    if (Entry == 0) {Entry = Ask; Mode = OP_BUY;

    }


    void OnTick()

    {

    // if no open orders exist

    if (OrdersTotal()==0)



    // send a sell limit order

    int sellticket = OrderSend


    int Mode = OP_SELLSTOP;

    double Entry=NormalizeDouble((Open[3]),MODE_DIGITS);

    if (Bid > Entry && Entry > 0) Mode = OP_SELLLIMIT;

    if (Entry == 0) {Entry = Bid; Mode = OP_SELL;

    }


    int Mode = Close

    double Close=..................................................................................
     

Share This Page