Debug my iCustom EA

MQL5 EA

작업 종료됨

실행 시간 3 시간
피고용인의 피드백
Thank you very much for the job, it has been a pleasure!

명시

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






응답함

1
개발자 1
등급
(214)
프로젝트
316
34%
중재
63
37% / 40%
기한 초과
102
32%
작업중
2
개발자 2
등급
(274)
프로젝트
403
28%
중재
40
40% / 50%
기한 초과
1
0%
무료
3
개발자 3
등급
(47)
프로젝트
67
37%
중재
5
40% / 40%
기한 초과
1
1%
무료
4
개발자 4
등급
(184)
프로젝트
198
46%
중재
4
50% / 25%
기한 초과
1
1%
작업중
비슷한 주문
Hi everyone. I came across a bot named ( Super Scalping EA Gold Tick Scalper ) in the free bots section on MQL5, and I’ve seen its trading results over a two-year period. I would like one of you to create a similar bot for gold trading that achieves the same (or very similar) results, but within a shorter timeframe—specifically 6 to 8 months. I also need the bot to be suitable for both small accounts ($30–$50) and
i have existing EA but its decrypted i dont have its source code , i want you to decrypt the EA and give me the original source code of it
Project: Custom MT5 Day Trading Expert Advisor I need a custom automated trading robot (EA) for MetaTrader 5, developed in MQL5. Markets: - Gold (XAUUSD) - Selected Forex pairs Trading style: Automated day trading. All positions should be closed according to predefined strategy rules and before the end of the selected trading session. Strategy: The developer should propose a clear trading strategy, explain its rules
Hi, I need NinjaTrader 8 Strategy Analyzer backtests on two of my strategies, each over 1 year AND 3 years of data. Please quote the full job. Common settings: NT8 Strategy Analyzer, MCL (Micro WTI Crude Oil) continuous front-month contract (MCL ##-##), 5-minute bars, 1yr + 3yr of the most recent data, $2.50 round-turn commission per contract. Deliverables per run: full Strategy Analyzer summary (net profit, profit
Hi, I need NinjaTrader 8 Strategy Analyzer backtests on two of my strategies, each over 1 year AND 3 years of data. Please quote the full job. Common settings: NT8 Strategy Analyzer, MCL (Micro WTI Crude Oil) continuous front-month contract (MCL ##-##), 5-minute bars, 1yr + 3yr of the most recent data, $2.50 round-turn commission per contract. Deliverables per run: full Strategy Analyzer summary (net profit, profit
1. Overview Build an MQL5 Expert Advisor for MetaTrader 5 that trades XAUUSD (Gold) as a scalper, using Heiken Ashi candles and a 50 EMA for entries. 2. Platform and symbol MetaTrader 5, Expert Advisor (.mq5 and compiled .ex5) Symbol: XAUUSD (must work with broker suffixes, e.g. XAUUSDm) Default timeframe: M5 (configurable; M1 to M15 should work) 3. Indicators Heiken Ashi candles, calculated inside the EA (no
I I am looking for an experienced MQL5 developer to build a robust, fully automated Expert Advisor (EA) for MetaTrader 5 based on a moving average pullback strategy. The EA must be optimized for multi-symbol and multi-timeframe processing, capable of running on a single chart while scanning and trading a user-defined list of currency pairs. 1. Core Strategy Logic * Trend Zone: The strategy utilizes the zone between
a { text-decoration: none; color: #464feb; } tr th, tr td { border: 1px solid #e6e6e6; } tr th { background-color: #f5f5f5; } Project Description I need an Expert Advisor (EA) for MetaTrader 5 (MT5) that can automatically trade Gold (XAUUSD) and major Forex pairs. The EA must analyze market conditions, open and close trades automatically, manage risk effectively, and be fully compatible with the MT5 Strategy Tester
Hi mql5 community, I am actually looking for a dev who applied to my previous job posted few days ago regarding " Need a faithful ready made hft scalper ea robot" He already reached out with an EA which I was validating its performance on my end, but unfortunately the weekend absolutely got my away from internet while have to pay attention to some physical tasks, and during those time I couldn't been able to check
I can pay you 70 USD for consultation if you have something valuable. no scam please, I am too smart to be scammed, Thank you for your patient and attention. Have a nice day for you and your family, May God bless you and your family :)

프로젝트 정보

예산
30+ USD