';' - open parenthesis expected Error

 
i go an error  ';' - open parenthesis expected Line 158  column 23
here is the code 

//+------------------------------------------------------------------+

//|                          NSNDHistory.mq5                        |
//|                      Converted to MQL5 by OpenAI                |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2021, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property indicator_chart_window

input int barcount = 500;
input int NSNDcount = 10;
string comment[10];
static datetime prevtime = 0;
static int prevfirstbar = 0;
static double prevpricemax = 0;

double dummyBuffer[]; // Dummy buffer to suppress "No indicator plot" warning

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
    SetIndexBuffer(0, dummyBuffer, INDICATOR_DATA); // Dummy buffer assigned
    f_clear();
    return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
    f_clear();
}

//+------------------------------------------------------------------+
//| 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[])
{
    string Bull_or_Bear, obj_nameND;
    bool Low_Volume, Pins, Bear_Close_Below, Bull_Close_Above, Bear_Close_Above, Bull_Close_Below;
    string label;
    double chartheight = (ChartGetDouble(0, CHART_PRICE_MAX) - ChartGetDouble(0, CHART_PRICE_MIN));
    double addhigh = 6.00 / 100.00 * chartheight;

    if ((int)ChartGetInteger(0, CHART_VISIBLE_BARS, 0) != prevfirstbar)
    {
        prevtime = 0;
    }
    if (ChartGetDouble(0, CHART_PRICE_MAX) != prevpricemax)
    {
        prevtime = 0;
    }

    if (time[0] != prevtime)
    {
        f_clear();

        int visible_bars = (int)ChartGetInteger(0, CHART_VISIBLE_BARS, 0);
        for (int i = visible_bars - 1; i >= visible_bars - barcount && i >= 0; i--)
        {
            Bull_or_Bear = f_Bull_or_Bear(i, open, close);
            Low_Volume = f_Low_Volume(i, volume);
            Pins = f_Pins(i, Bull_or_Bear, open, close, high, low);

            Bear_Close_Below = false;
            Bear_Close_Above = false;
            Bull_Close_Above = false;
            Bull_Close_Below = false;

            for (int ix = i; ix > i - NSNDcount && ix >= 0; ix--)
            {
                if (Bull_or_Bear == "Bear" && close[ix] < low[i] && !Bear_Close_Above)
                    Bear_Close_Below = true;

                if (Bull_or_Bear == "Bear" && close[ix] > high[i] && !Bear_Close_Below)
                    Bear_Close_Above = true;

                if (Bull_or_Bear == "Bull" && close[ix] > high[i] && !Bear_Close_Below)
                    Bull_Close_Above = true;

                if (Bull_or_Bear == "Bull" && close[ix] < low[i] && !Bear_Close_Above)
                    Bull_Close_Below = true;
            }

            int year, month, day, hour, minute;
            MqlDateTime dt;
            TimeToStruct(time[i], dt);
            year = dt.year;
            month = dt.mon;
            day = dt.day;
            hour = dt.hour;
            minute = dt.min;

            label = IntegerToString(year) + IntegerToString(month) + IntegerToString(day) +
                    IntegerToString(hour) + IntegerToString(minute);

            obj_nameND = "No Demand - " + IntegerToString(i) + " - " + label;
            ObjectDelete(0, obj_nameND);

            if (Bull_or_Bear == "Bull" && Low_Volume && Pins && !Bull_Close_Above && Bull_Close_Below)
            {
                Print("Creating No Demand object at ", time[i], " ", high[i] + addhigh);
                ObjectCreate(0, obj_nameND, OBJ_TEXT, 0, time[i], high[i] + addhigh);
                ObjectSetString(0, obj_nameND, OBJPROP_TEXT, "v");
                ObjectSetInteger(0, obj_nameND, OBJPROP_FONTSIZE, 18);
                ObjectSetInteger(0, obj_nameND, OBJPROP_COLOR, clrRed);
            }

            obj_nameND = "No Supply - " + IntegerToString(i) + " - " + label;
            ObjectDelete(0, obj_nameND);

            if (Bull_or_Bear == "Bear" && Low_Volume && Pins && !Bear_Close_Below && Bear_Close_Above)
            {
                Print("Creating No Supply object at ", time[i], " ", low[i]);
                ObjectCreate(0, obj_nameND, OBJ_TEXT, 0, time[i], low[i]);
                ObjectSetString(0, obj_nameND, OBJPROP_TEXT, "^");
                ObjectSetInteger(0, obj_nameND, OBJPROP_FONTSIZE, 22);
                ObjectSetInteger(0, obj_nameND, OBJPROP_COLOR, clrLime);
            }
        }

        prevtime = time[0];
        prevfirstbar = (int)ChartGetInteger(0, CHART_VISIBLE_BARS, 0);
        prevpricemax = ChartGetDouble(0, CHART_PRICE_MAX);
    }
    return rates_total;
}

//+------------------------------------------------------------------+
string f_Bull_or_Bear(int i, const double &open[], const double &close[])
{
    string retvar;
    if (open[i] > close[i])
        retvar = "Bear";
    if (close[i] > open[i])
        retvar = "Bull";
    return retvar;
}

bool f_Low_Volume(int i, const long &volume[])
{
    return (volume[i] < volume[i + 1] && volume[i] < volume[i + 2]);
}

bool f_Pins(int i, string Bull_or_Bear, const double &open[], const double &close[], const double &high[], const double &low[])
{
    double pip = Point;
    if (Bull_or_Bear == "Bear" && high[i] > open[i] + pip && low[i] < close[i] - pip)
        return (true);
    if (Bull_or_Bear == "Bull" && high[i] > close[i] + pip && low[i] < open[i] - pip)
        return (true);
    return (false);
}

void f_clear()
{
    int total_objects = ObjectsTotal(0, 0, -1);
    for (int i = total_objects - 1; i >= 0; i--)
    {
        string name = ObjectName(0, i);
        if (StringSubstr(name, 0, 2) == "No")
            ObjectDelete(0, name);
    }
}

any one helpme with that 
MetaQuotes — the developer of trading platforms for brokers, banks, exchanges and hedge funds
MetaQuotes — the developer of trading platforms for brokers, banks, exchanges and hedge funds
  • www.metaquotes.net
MetaTrader 5 trading platform is a free Forex and stock trading tool
 

When you post code please use the CODE button (Alt-S) !  

NOTE-1: Traders and coders are working for free:

  • if it is interesting for them personally, or
  • if it is interesting for many members on this forum.

Freelance section of the forum should be used in most of the cases.

NOTE-2: your code seems AI-generated, so it can be hardly helped (would need considerable human review/corrections before being usable in a live trading environment).


Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2025.01.13
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
Oleksandr Medviediev #:
 of the forum should be used in most of the cases.

IM JUST TRYING TO CONVERT MY MT4 TO MT5 

 
abdulwahabzelta #:

IM JUST TRYING TO CONVERT MY MT4 TO MT5 

Freelance section is your next stop.
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2025.01.13
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
    double pip = Point;
  1. Perhaps you should read the manual, or press F1 in the editor. MQL5 Reference
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

    There is no such predefined variable Point.

  2. PIP, Point, or Tick size are all different in general.
              Ticks, PIPs or points in the GUI. Make up your mind. - MQL4 programming forum #1 (2014)
              Percentage in point - Wikipedia

    Unless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 digit brokers (if any still exists), exotics (e.g. USDZAR where spread is over 500 points), and metals. Compute what a logical PIP is and use that, not points.
              How to manage JPY pairs with parameters? - MQL4 programming forum (2017)
              Slippage defined in index points - Expert Advisors and Automated Trading - MQL5 programming forum (2018)

 

tip: highlight function name at the line where the compiler says there's a problem, and press F1

use any of the options

  double pip = _Point;

or

  double pip = Point();

or

double pip = SymbolInfoDouble(_Symbol, SYMBOL_POINT);
 
Your topic has been moved to the section: Technical Indicators
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893