• 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 :)
General chit-chat
Help Users
  • No one is chatting at the moment.

      want to create ea and still learning please advise

      gxxglesxxk

      New Member
      Credits
      0
      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=..................................................................................
       
      Back
      Top