need help solving these errors

 
Hi there, i'm not a coder and new to this, i am now trying to build an EA but keep getting errors in the below code but i have no idea what's wrong.
is it a rare problem or anyone knows how to fix it?
Appreciated for the help!
//+------------------------------------------------------------------+
//| "Tick" event handler function                                    |
//+------------------------------------------------------------------+
void OnTick()
{
    if (Bars < 2)
    {
        Print("Not enough bars.");
        return;
    }

    int lastIndex = Bars - 2;
    double lastHigh = High[lastIndex];
    double lastLow = Low[lastIndex];
    Print("Last complete bar High: ", lastHigh, " Last Low: ", lastLow);
}
Files:
 

1. Bars() is a function, put parameters in it.

2. There are no default Open/High/Low/Close arrays in MQL5, you have to use CopyHigh() and other functions first to fill them. Or use iHigh() function for a single call.
void OnTick()
{
    int bars=Bars(_Symbol, PERIOD_CURRENT);

    if (bars < 2)
    {
        Print("Not enough bars.");
        return;
    }

    int lastIndex = bars - 2;
    double lastHigh = iHigh(_Symbol, PERIOD_CURRENT, lastIndex);
    double lastLow = iLow(_Symbol, PERIOD_CURRENT, lastIndex);
    Print("Last complete bar High: ", lastHigh, " Last Low: ", lastLow);
}
 
Or just use MQL4 compiler :) Rename your file with .mq4 extension.
 
Kristian Kafarov #:
Or just use MQL4 compiler :) Rename your file with .mq4 extension.
He might have tried downloading MT4...
OP, MT4 and its editor can only be downloaded from brokers nowadays.