CODING

MQL5 专家

指定

// Expert Advisor Example for MT4

#include <Trade\Trade.mqh>

// Global Variables
int gi_44 = 0;
int gi_48 = 0;
int gi_52 = 0;
int gi_56 = 0;
double g_price_564 = 0.0;
double g_price_568 = 0.0;
double g_price_572 = 0.0;
double g_lots_588 = 0.0;

// Entry Point
void OnTick()
{
  // Define Variables
  int l_cmd_0;
  double l_price_4;

  // Get Last Order
  l_cmd_0 = OrderType();

  // Check if no order is open
  if (l_cmd_0 == OP_BUY || l_cmd_0 == OP_SELL)
    return;

  // Check if we are not in position
  if (PositionSelect(Symbol()))
  {
    if (PositionGetDouble(POSITION_TYPE) == POSITION_TYPE_BUY)
    {
      // Set Close Price for Buy Order
      l_price_4 = Bid;

      // Close Buy Order
      OrderClose(PositionTicket(), PositionLots(), l_price_4, 3);
    }
    else
    {
      // Set Close Price for Sell Order
      l_price_4 = Ask;

      // Close Sell Order
      OrderClose(PositionTicket(), PositionLots(), l_price_4, 3);
    }

    // Reset Global Variables
    gi_44 = 0;
    gi_48 = 0;
    gi_52 = 0;
    gi_56 = 0;
    g_price_564 = 0.0;
    g_price_568 = 0.0;
    g_price_572 = 0.0;
    g_lots_588 = 0.0;
  }
  else
  {
    // Set Lots for Order
    g_lots_588 = Lot;

    // Check if Buy Order should be placed
    if (gi_44 == 0)
    {
      // Place Buy Order
      gi_44 = OrderSend(Symbol(), OP_BUY, g_lots_588, Ask, 3, 0, 0, "My EA", 16388, 0, Green);
    }
    else if (gi_48 == 0)
    {
      // Place Buy Order
      gi_48 = OrderSend(Symbol(), OP_BUY, g_lots_588, Ask, 3, 0, 0, "My EA", 16388, 0, Green);
    }
    else if (gi_52 == 0)
    {
      // Place Buy Order
      gi_52 = OrderSend(Symbol(), OP_BUY, g_lots_588, Ask, 3, 0, 0, "My EA", 16388, 0, Green);
    }
    else if (gi_56 == 0)
    {
      // Place Buy Order
      gi_56 = OrderSend(Symbol(), OP_BUY, g_lots_588
// Check if Sell Order should be placed
if (gi_44 == 0)
{
  // Place Sell Order
  gi_44 = OrderSend(Symbol(), OP_SELL, g_lots_588, Bid, 3, 0, 0, "My EA", 16388, 0, Red);
}
else if (gi_48 == 0)
{
  // Place Sell Order
  gi_48 = OrderSend(Symbol(), OP_SELL, g_lots_588, Bid, 3, 0, 0, "My EA", 16388, 0, Red);
}
else if (gi_52 == 0)
{
  // Place Sell Order
  gi_52 = OrderSend(Symbol(), OP_SELL, g_lots_588, Bid, 3, 0, 0, "My EA", 16388, 0, Red);
}
else if (gi_56 == 0)
{
  // Place Sell Order
  gi_56 = OrderSend(Symbol(), OP_SELL, g_lots_588, Bid, 3, 0, 0, "My EA", 16388, 0, Red);
}

反馈

1
开发者 1
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Helvetica Neue'} Hello Looking for someone to help me improve my current strategy on my own algorithm and to also add hedging mode
I want the script in mql5 language for my martingale strategy. The script should open trades in both directions buy and sell and if any trade closes in loss then open new trade in that direction by using the next volume and when trade closes in profit then reset the volume to first from volume list and also maximum consecutive losses limit will apply. If trades closes consecutively in losses and hits the limit then
Long Position 1. Trend Line: When a Lower High (LH) is formed, draw a trend line from the previous Higher High (HH) to the new LH. 2. Trend Line Adjustment: If a new Lower High (LH) is formed without breaking the trend line, redraw the trend line to the new LH. Draw a trend line between the Higher High (HH) and the Higher Low (HL). If a new Higher High (HH) is formed, remove the previous trend line and draw a new one
Please watch the video on this youtube channel and download the Indicator from there. https://www.youtube.com/watch?v=ldTomLu8DxE&amp ;t=32s Rules are explained on the video and the download of the indicator is on the same video
I would like an EA that follows exactly this steps to trade de daily candle. Watch the video and then see if you can do the task. https://www.youtube.com/watch?v=g3oDYq4P9ZE Document is one this link https://cdn.discordapp.com/attachments/1135977927469703230/1135978751461695598/Daily_Bias-TTrades_edu.pdf?ex=669a9a27&amp ;is=669948a7&hm=96de195f7e695a381c1261b065f67b94fae319d02a0c88641b146f8b2978320c& Should have
I have a custom EA that works fine in the live market trading, but when doing a back test in the strategy tester , it does not open sell orders. There are no errors or warnings; it just doesn't open sell orders. I've checked every possible reason that might be the reason why it does not open sell orders, but I can't find anything, especially since it works fine in the real market and it opens both buys and sells
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks

项目信息

预算
30+ USD
开发人员
27 USD