Print() (or Comment()/Alert()) at key points to trace logic. In MT5, Print() logs can still be very useful alongside the debugger. For example: Print("Price=", Ask, " ticks=", TicksTotal);. In c#, an equivalent is Print() (cTrader’s logger) or Console.WriteLine() if debugging outside the platform.