hi i need to fix this code anybody help ?

 
//+------------------------------------------------------------------+
//|                                                 find the gap.mq4 |
//|                                  Copyright 2023, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
    //--- Input parameters
    string Symbol1 = "EURUSD"; // First asset symbol
    string Symbol2 = "GBPUSD"; // Second asset symbol

    //--- Global variables
    double MaxGap = -1000000000; // Maximum gap between the assets
    double MinGap = 1000000000; // Minimum gap between the assets
    double CurrentGap = 0; // Current gap between the maximum and minimum gaps

    // Set the script to run on every tick
    EventSetTimer("OnTick");

    // Display the reported data on the top right of the chart
    ObjectCreate("Correlation", OBJ_TEXT, 0, 0, 0);
    ObjectSet("Correlation", OBJPROP_CORNER, 2);
    ObjectSet("Correlation", OBJPROP_XDISTANCE, 10);
    ObjectSet("Correlation", OBJPROP_YDISTANCE, 20);
}

//--- Script tick function
void OnTick()
{
    //--- Input parameters
    double Price1 = SymbolInfoDouble(_Symbol, SYMBOL_BID);
    double Price2 = SymbolInfoDouble("GBPUSD", SYMBOL_BID);

    //--- Global variables
    static double MaxGap = -1000000000; // Maximum gap between the assets
    static double MinGap = 1000000000; // Minimum gap between the assets
    static double CurrentGap = 0; // Current gap between the maximum and minimum gaps

    // Get the closing prices of the two assets
    Price1 = iClose(_Symbol, PERIOD_CURRENT, 0);
    Price2 = iClose("GBPUSD", PERIOD_CURRENT, 0);

    // Calculate the correlation between the two assets
    double Correlation = MathSqrt(1 - (MathPow((Price1 - Price2), 2) / (MathPow(Price1, 2) + MathPow(Price2, 2))));

    // Update the maximum and minimum gap between the assets
    MaxGap = MathMax(MaxGap, Correlation);
    MinGap = MathMin(MinGap, Correlation);

    // Calculate the current gap between the maximum and minimum gaps
    CurrentGap = MaxGap - MinGap;

    // Update the text on the displayed object
    ObjectSetText("Correlation", "Max Gap: " + DoubleToStr(MaxGap, 5) + "\nMin Gap: " + DoubleToStr(MinGap, 5) + "\nCurrent Gap: " + DoubleToStr(CurrentGap, 5), 10, "Arial", White);
}

//--- Script deinitialization function
void OnDeinit(const int reason)
{
    // Remove the displayed data from the chart
    ObjectDelete("Correlation");
}
'find the gap.mq4' find the gap.mq4 1 1
implicit conversion from 'string' to 'number' find the gap.mq4 25 19
0 errors, 1 warnings, 96 msec elapsed 1 2

Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2023.04.28
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

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

  3.     EventSetTimer("OnTick");
    Invalid call.
  4.     double Price1 = SymbolInfoDouble(_Symbol, SYMBOL_BID);
        double Price2 = SymbolInfoDouble("GBPUSD", SYMBOL_BID);
    
        // Get the closing prices of the two assets
        Price1 = iClose(_Symbol, PERIOD_CURRENT, 0);
        Price2 = iClose("GBPUSD", PERIOD_CURRENT, 0);
    Why are you getting values, and then throwing them away?
 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

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

  3. Invalid call.
  4. Why are you getting values, and then throwing them away?

i dont know , can u help me fix it ? thanks in advance 

 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

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

  3. Invalid call.
  4. Why are you getting values, and then throwing them away?

...

Improperly formatted code removed by moderator. Please EDIT your post and use the CODE button (Alt-S) when inserting code.

Code button in editor

Hover your mouse over your post and select "edit" ... 

...

possible loss of data due to type conversion find the gap.mq4 34 43
'INDICATOR_WIDTH' - undeclared identifier find the gap.mq4 36 25
'INDICATOR_COLOR' - undeclared identifier find the gap.mq4 37 25
'INDICATOR_FONT' - undeclared identifier find the gap.mq4 39 24
'INDICATOR_FONT_SIZE' - undeclared identifier find the gap.mq4 40 25
4 errors, 1 warnings 5 2

Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2023.04.28
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
Naveen Raaj J R #: i dont know , can u help me fix it ? thanks in advance 

MT4: Learn to code it.
MT5: Begin learning to code it.

If you don't learn MQL4/5, 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 your code.

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

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
          No free help (2017)