Zzz

MQL5 Experts

Termos de Referência

// กำหนดค่าตัวแปรพื้นฐาน
input double lotSize = 0.1;        // ขนาดล็อตที่ต้องการ
input int takeProfit = 50;         // ระยะ Take Profit (จุด)
input int stopLoss = 50;           // ระยะ Stop Loss (จุด)
input int magicNumber = 123456;    // หมายเลข Magic Number
input int smaPeriod = 14;          // ช่วงเวลา Simple Moving Average (SMA)

// เวลาที่ออเดอร์ล่าสุดถูกเปิด
datetime lastOrderTime = 0;

// ฟังก์ชั่นหลักของ EA
void OnTick()
{
   // ตรวจสอบว่าผ่านไปมากกว่า 10 นาทีหรือยัง
   if (TimeCurrent() - lastOrderTime >= 600)  // 600 วินาที = 10 นาที
   {
      // ตรวจสอบสัญญาณ Buy หรือ Sell
      if (SignalBuy())
      {
         // เปิดออเดอร์ Buy
         OpenOrder(ORDER_TYPE_BUY);
      }
      else if (SignalSell())
      {
         // เปิดออเดอร์ Sell
         OpenOrder(ORDER_TYPE_SELL);
      }
      
      // บันทึกเวลาที่เปิดออเดอร์ล่าสุด
      lastOrderTime = TimeCurrent();
   }
}

// ฟังก์ชั่นเปิดออเดอร์ Buy หรือ Sell
void OpenOrder(int orderType)
{
   double price = (orderType == ORDER_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
   double sl = (orderType == ORDER_TYPE_BUY) ? price - stopLoss * _Point : price + stopLoss * _Point;
   double tp = (orderType == ORDER_TYPE_BUY) ? price + takeProfit * _Point : price - takeProfit * _Point;

   // สร้างคำสั่งซื้อขาย
   MqlTradeRequest request;
   MqlTradeResult result;
   
   // กำหนดค่าของคำสั่ง
   request.action = TRADE_ACTION_DEAL;
   request.symbol = _Symbol;
   request.volume = lotSize;
   request.type = orderType;
   request.price = price;
   request.sl = sl;
   request.tp = tp;
   request.deviation = 3;
   request.magic = magicNumber;

   // ส่งคำสั่ง
   OrderSend(request, result);

   // ตรวจสอบผลลัพธ์
   if (result.retcode != TRADE_RETCODE_DONE)
   {
      Print("Error opening order: ", result.retcode);
   }
}

// ฟังก์ชั่นตรวจสอบสัญญาณ Buy (ใช้ SMA)
bool SignalBuy()
{
   double sma = iMA(_Symbol, 0, smaPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
   double priceClose = Close[0];  // ราคาปิดปัจจุบัน
   
   // ถ้าราคาปิดปัจจุบันสูงกว่าเส้น SMA -> ส่งสัญญาณ Buy
   return (priceClose > sma);
}

// ฟังก์ชั่นตรวจสอบสัญญาณ Sell (ใช้ SMA)
bool SignalSell()
{
   double sma = iMA(_Symbol, 0, smaPeriod, 0, MODE_SMA, PRICE_CLOSE, 0);
   double priceClose = Close[0];  // ราคาปิดปัจจุบัน
   
   // ถ้าราคาปิดปัจจุบันต่ำกว่าเส้น SMA -> ส่งสัญญาณ Sell
   return (priceClose < sma);
}

Respondido

1
Desenvolvedor 1
Classificação
(45)
Projetos
63
52%
Arbitragem
3
0% / 0%
Expirado
1
2%
Livre
2
Desenvolvedor 2
Classificação
(135)
Projetos
177
18%
Arbitragem
17
47% / 18%
Expirado
0
Trabalhando
3
Desenvolvedor 3
Classificação
(325)
Projetos
410
22%
Arbitragem
44
61% / 23%
Expirado
47
11%
Carregado
Pedidos semelhantes
Hello Guys, I need a trading bot for the MT5 to place order based on my trading strategy which is based on - >> entry based on EMA with rejection from specific levels like support and resistance area - levels and time frame i will apply into the robot manually on daily basis. also need - trailing stoploss , shift to breakeven after gaining some points. need a highly expert developer
Trade Manger EA 30+ USD
Hello Programmer! I am looking to build an EA that will place my trade and manage it. Once i have manually found my setup, I will want an EA to open the trade, set the R:R and manage it according to my specifications. please take a look at the attached to get an Idea of what I would like. I will require the source code once completed
Hello there i need someone who will create a robot that will calculate the movement between buy/sell and show where to take profit the robot should work with all currency and indices including stock
EA to send account history to web request. It should send every 5 mins or when there is an update. It then sends the json to a web request where gain, drawdown, balance, equity will be displayed
I have a full strategy based on indicator and candle based on . i would like to make it into a robot which will trade for me on a specific time and specific rules. i need a person who can do this project for me. If you have done this type of job . you are most welcome for this. Apply only if you know binary trading option and binomo trading platform well and how it works
Preciso de um EA, que faça o fecho automático de operações abertas no final da sessão e nas notícias de alto impacto. Um EA simples com apenas 1 função. Fecho das operações abertas
Enter buy trade at close of candle when bar closes above the 3 emas. Emas are 34 ema, 64 ema and 128 ema. For a buy trade the 34 ema must be above the other two emas. The 64 ema should be in the middle. The 128 ema should be below the other two emas. For a buy trade the Awesome Oscillator should be above the middle line and colored green. Exit a buy trade when price touches 64 ema. Sell trade same conditions as buy
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable
Hello, I’m looking for a TradingView indicator that fits my forex trading needs. If you can create or customize one for me, please reach out. I'd appreciate your help! Thanks in advance."
I need someone who can code a new EA from scratch and also know how to integrate AI into the EA and use AI and market sentiments along with news to then open positions. I have the description of the job ready. Need someone serious, with experience and who will help optimize the current strategy with their expertise. Thanks

Informações sobre o projeto

Orçamento
30+ USD

Cliente

Pedidos postados1
Número de arbitragens0