I asked chatgpt to code me this and this code does not generate the arrows for which all the parameters are met

 
Here is the parameters:
the buy signal is: in the 30mins timeframe, ma50 should be below price, ma100 should be below ma50, the macd signal crosses above or has crossed above the base line + in the 1hr timeframe, the macd signal line crosses or has crossed above the macd base line. This is the buy signal, the macds of both 30mins and 1hr must, signal line crossed above base line. The inverse is of all these parameters is a sell signal
Here is the code chatgpt made for me:
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrGreen
#property indicator_color2 clrRed
#property indicator_width1 2
#property indicator_width2 2
#property indicator_label1 "Buy Signal"
#property indicator_label2 "Sell Signal"

input int ma50Period = 50;
input int ma100Period = 100;
input ENUM_TIMEFRAMES tf30min = 30;
input ENUM_TIMEFRAMES tf1hr = 60;
input int macdFastEMA = 12;
input int macdSlowEMA = 26;
input int macdSignalSMA = 9;

double ma50Buffer[];
double ma100Buffer[];
double macdSignalBuffer[];
double macdBaseBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   SetIndexBuffer(0, ma50Buffer);
   SetIndexBuffer(1, ma100Buffer);
   SetIndexBuffer(2, macdSignalBuffer);
   SetIndexBuffer(3, macdBaseBuffer);
   SetIndexLabel(0, "MA50");
   SetIndexLabel(1, "MA100");
   SetIndexLabel(2, "MACD Signal");
   SetIndexLabel(3, "MACD Base");
   IndicatorSetInteger(INDICATOR_DIGITS, 5);

   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
{
   int limit = rates_total - prev_calculated;
   if (limit <= 0)
      return (0);

   for (int i = limit - 1; i >= 0; i--)
   {
      ma50Buffer[i] = iMA(NULL, tf30min, ma50Period, 0, MODE_SMA, PRICE_CLOSE, i);
      ma100Buffer[i] = iMA(NULL, tf30min, ma100Period, 0, MODE_SMA, PRICE_CLOSE, i);
      macdSignalBuffer[i] = iMACD(NULL, tf30min, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 0);
      macdBaseBuffer[i] = iMACD(NULL, tf30min, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 1);
   }

   for (int i = 0; i < rates_total; i++)
   {
      if (ma50Buffer[i] < close[i] && ma100Buffer[i] < ma50Buffer[i] &&
          macdSignalBuffer[i] > macdBaseBuffer[i] && iMACD(NULL, tf1hr, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 0) > iMACD(NULL, tf1hr, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 1))
      {
         SetIndexArrow(0, 233);
         PlotIndexSetInteger(0, PLOT_ARROW, 233);
      }
      else
      {
         PlotIndexSetInteger(0, PLOT_ARROW, 0);
      }

      if (ma50Buffer[i] > close[i] && ma100Buffer[i] > ma50Buffer[i] &&
          macdSignalBuffer[i] < macdBaseBuffer[i] && iMACD(NULL, tf1hr, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 0) < iMACD(NULL, tf1hr, macdFastEMA, macdSlowEMA, macdSignalSMA, PRICE_CLOSE, i, 1))
      {
         SetIndexArrow(1, 234);
         PlotIndexSetInteger(1, PLOT_ARROW, 234);
      }
      else
      {
         PlotIndexSetInteger(1, PLOT_ARROW, 0);
      }
   }

   return (rates_total);
}
Can someone please help?
 
  1. marixx: Here is the code chatgpt made for me:

    Stop using ChatGPT.
              Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum #2 (2023)

    ChatGPT (the worst), “Bots Builder”, “EA builder”, “EA Builder Pro”, EATree, “Etasoft forex generator”, “Forex Strategy Builder”, ForexEAdvisor (aka. ForexEAdvisor STRATEGY BUILDER, and Online Forex Expert Advisor Generator), ForexRobotAcademy.com, forexsb, “FX EA Builder”, fxDreema, Forex Generator, FxPro, Molanis, Octa-FX Meta Editor, Strategy Builder FX, Strategy Quant, “Visual Trader Studio”, “MQL5 Wizard”, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.

    Since you haven't learned MQL4/5, therefor there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.

    We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

    ChatGPT
    1. Even it says do not use it for coding. * 
    2. Mixing MT4 and MT5 code together.
    3. Creating multiple OnCalculate/OnTick functions.
    4. OnCalculate returning a double.
    5. Filling buffers with zero in OnInit (they have no size yet). Setting buffer elements to zero but not setting Empty Value to correspond.
    6. Calling undefined functions.
    7. Calling MT4 functions in MT5 code.
    8. Sometimes, not using strict (MT4 code).
    9. Code that will not compile.
    10. Creating code outside of functions. * 
    11. Creating incomplete code. * 
    12. Initialization of Global variables with non-constants. * 
    13. Assigning a MT5 handle to a double or missing the buffer and bar indexes in a MT4 call. * 
    14. Useing MT4 Trade Functions without first selecting an order. * 
    15. Uses NULL in OrderSend. * 
    bot builder Creating two OnInit() functions. * 
    EA builder
    1. Counting up while closing multiple orders.
    2. Not useing time in new bar detection.
    3. Not adjusting for 4/5 digit brokers, TP/SL and slippage. * 
    4. Not checking return codes.
    EATree Uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
    ForexEAdvisor
    1. Non-updateing global variables.
    2. Compilation errors.
    3. Not checking return codes.
    4. Not reporting errors.
    FX EA Builder
    1. Not checking return codes.
    2. Loosing open tickets on terminal restart. No recovery (crash/power failure.)
    3. Not adjusting stops for the spread. * 
    4. Using OrdersTotal directly.
    5. Using the old event handlers.
  2. marixx: Can someone please help?

    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
              No free help (2017)

 
marixx:
Here is the parameters:
the buy signal is: in the 30mins timeframe, ma50 should be below price, ma100 should be below ma50, the macd signal crosses above or has crossed above the base line + in the 1hr timeframe, the macd signal line crosses or has crossed above the macd base line. This is the buy signal, the macds of both 30mins and 1hr must, signal line crossed above base line. The inverse is of all these parameters is a sell signal
Here is the code chatgpt made for me:
Can someone please help?

ask the same to chatgpt using GPT 4 and it should be resolved. say chatgpt 3.5 did this and arrow are not seen and GPT4 will listen