Debug my iCustom EA

MQL5 Experts

Job finished

Execution time 3 hours
Feedback from employee
Thank you very much for the job, it has been a pleasure!

Specification

I have a custom indicator, and want to create an EA than using "iCUSTOM" and "PRINT", make the EA can read and print the indicator values at journel for each bar correctly when I put this EA into backtesting, i tried to make it, but it can't get the right values, so would like someone help me to fix it


 

Pls read through my indicator and EA, and make sure you know what’w wrong with my EA before you accpet this job, thanks

 

My indicator

//+------------------------------------------------------------------+
//|     MA_Direction_SingleBuffer_MQL4.mq4                          |
//|      |
//|   適用於 MQL4,便於 EA 調用 buffer[0],與圖表分色並存           |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Lime    // Up
#property indicator_color2 Red     // Down
#property indicator_color3 Gray    // Flat
#property strict

input int MAPeriod = 14;

// Buffers for plotting (only one active per bar)
double bufferUp[];    // buffer 0 - EA 調用此值
double bufferDown[];  // buffer 1 - 僅視覺繪圖用
double bufferFlat[];  // buffer 2 - 僅視覺繪圖用

//+------------------------------------------------------------------+
int OnInit()
  {
   IndicatorShortName("MA_Direction_SingleBuffer");

   SetIndexBuffer(0, bufferUp);
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexLabel(0, "Slope");

   SetIndexBuffer(1, bufferDown);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexLabel(1, "Down");

   SetIndexBuffer(2, bufferFlat);
   SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 1);
   SetIndexLabel(2, "Flat");

   return INIT_SUCCEEDED;
  }
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime& time[],
                const double& open[],
                const double& high[],
                const double& low[],
                const double& close[],
                const long& tick_volume[],
                const long& volume[],
                const int& spread[])
  {
   if (rates_total < MAPeriod + 2)
      return 0;

   int start = MathMax(prev_calculated - 1, 1);

   for (int i = start; i < rates_total - 1; i++)
     {
      double ma_now = iMA(NULL, 0, MAPeriod, 0, MODE_SMA, PRICE_CLOSE, i);
      double ma_prev = iMA(NULL, 0, MAPeriod, 0, MODE_SMA, PRICE_CLOSE, i + 1);
      double slope = ma_now - ma_prev;

      // 寫入主輸出 buffer(供 EA 調用)
      bufferUp[i] = slope;

      // 視覺分色(其他兩 buffer 只為圖表用)
      if (slope > 0)
        {
         bufferDown[i] = 0;
         bufferFlat[i] = 0;
        }
      else if (slope < 0)
        {
         bufferDown[i] = slope;
         bufferFlat[i] = 0;
         bufferUp[i] = 0;
        }
      else
        {
         bufferDown[i] = 0;
         bufferFlat[i] = 0.0000001;  // 微量顯示灰色線
         bufferUp[i] = 0;
        }
     }

   return rates_total;
  }

My EA

//+------------------------------------------------------------------+
//|                             MA_Direction_SingleBuffer_Reader.mq4 |
//|                                  Copyright 2024, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+

#property strict

input int MAPeriod = 14;   
input double Threshold = 0.00001; 

double MA_Value;
datetime OpenTime = iTime(Symbol(), PERIOD_CURRENT, 0);

//+------------------------------------------------------------------+
int OnInit()
  {
   Print("MA Reader EA initialized.");
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
void OnTick()
  {
   if (newC())
     {
      MA_Value = iCustom(Symbol(), PERIOD_CURRENT, "MA_Direction_SingleBuffer", MAPeriod, 0, 1);

      if (MA_Value > Threshold)
         Print("📈 UP: ", DoubleToString(MA_Value, 6));
      else if (MA_Value < -Threshold)
         Print("📉 DOWN: ", DoubleToString(MA_Value, 6));
      else
         Print("➖ FLAT: ", DoubleToString(MA_Value, 6));
     }
  }
//+------------------------------------------------------------------+
bool newC()
  {
   datetime newOpenTime = iTime(Symbol(), PERIOD_CURRENT, 0);
   if (newOpenTime != OpenTime)
     {
      OpenTime = newOpenTime;
      return true;
     }
   return false;
  }
//+------------------------------------------------------------------+



Pls help






Responded

1
Developer 1
Rating
(205)
Projects
308
34%
Arbitration
56
38% / 38%
Overdue
99
32%
Working
2
Developer 2
Rating
(254)
Projects
377
25%
Arbitration
22
59% / 23%
Overdue
1
0%
Loaded
3
Developer 3
Rating
(45)
Projects
58
36%
Arbitration
1
0% / 0%
Overdue
1
2%
Working
4
Developer 4
Rating
(36)
Projects
38
11%
Arbitration
2
50% / 50%
Overdue
2
5%
Working
Similar orders
Pocket option bot 30 - 80 USD
Telegram Connection Options part 1. Custom – User enters their own connection details. 2. HEDGE TRADE (Default) – Connects to my source. 3. ONE DIRECTION (Default) – Connects to my source. HEDGE TRADE and ONE DIRECTION details are hidden from users. To use my signals, they must select one (HEDGE or ONE DIRECTION). Only one connection mode can be active at a time (no multiple sources). 2- make it able to receive
Hello great developer. I am looking to get a ENABLE/DISABLE button on the ninjatrader chart. When I enable that button, the strategy submits the Limit or Stop Order (user input) which is X points (user input) away from the Close price of the last bar. I also want another button under the Enable/Disable button that lets me choose Long Only or Short Only. Let me know if you need any other details
Need someone who can create me a trading bot that does the job for me, you'll get a pdf where everything I need is written. I need an MT5 Expert Advisor that trades the MBT Supply & Demand strategy (Day Trading: 4H Higher Timeframe + 15m Lower Timeframe). Core Logic: Detect Supply/Demand zones (DBR, RBR, RBD, DBD). Zones must show strong imbalance (leg-out ≥ 2× base). Valid entry only when: Price is inside an HTF
Breakout and Retest/Supply and Demand Strategies for EA Expert Advisors, on MQL5 1. *Breakout Strategy*: Identify key levels of support/resistance and enter trades upon breakout. 2. *Retest Strategy*: Wait for price to retest previously broken levels before entering trades. 3. *Supply and Demand Strategy*: Identify areas of strong buying/selling interest (supply/demand zones). *Best Practices* 1. Define clear
I need a scalping EA for trading XAUUSD on the H1 timeframe using Fibonacci. For example, I'd like to buy at the demand zone and sell at the supply zone. I want the EA to be able to set its own TP and LS in percentages and also determine the number of lots to trade. I also want to provide a UI display with information (account balance, profit, loss, daily profit, monthly profit, monthly drawdown) and buy, sell, and
Pocket option bot 40 - 80 USD
Telegram Connection Options part 1. Custom – User enters their own connection details. 2. HEDGE TRADE (Default) – Connects to my source. 3. ONE DIRECTION (Default) – Connects to my source. HEDGE TRADE and ONE DIRECTION details are hidden from users. To use my signals, they must select one (HEDGE or ONE DIRECTION). Only one connection mode can be active at a time (no multiple sources). 2- make it able to receive
Telegram bot 100+ USD
Hell great developer I need a Telegram bot connected to my trading setup. Messages I receive (from MT5 into a bot channel): BareBull: OPEN TRADE - XAUUSD Buy Ticket: 1296584 Entry: 3388.1 SL: 3375 TP: 3395 BareBull: CLOSE TRADE - XAUUSD Buy Ticket 1296584 Bot must do: Read messages from bot channel. Link OPEN and CLOSE trades using ticket number. Forward to private channel (every trade, custom format). Forward to
Summary: I’m hiring an experienced Pine Script developer to build a production‑quality Swing Trading Bot for TradingView using Smart Money Concepts (SMC) . The system should perform market structure analysis , order block (OB) detection , liquidity/imbalance handling , and rule‑based trade management with robust backtesting , alerts , and non‑repainting logic. NOTE: Only apply if you have proven TradingView/Pine v5
Название файла: Zone Recovery Hedge EA.mq4 Задача: Необходимо профессионально конвертировать советник, написанный для MetaTrader 4 (MQL4), в версию для MetaTrader 5 (MQL5). Требования: Полное сохранение всей логики работы советника. Корректная работа всех торговых функций в MT5 (открытие/закрытие ордеров, хеджирование, модификация и сопровождение сделок). Замена функций MQL4 на соответствующие функции MQL5 (
Stratagy: breakout and retest strategy base on price action technic.on a high time frame simple plug and play expert advisors EA. Options for lots adjustment options for buy and sell only option for pending order sl/to/trailing stop

Project information

Budget
30+ USD
For the developer
27 USD