simartspoako:is there a command or a function that can clear the records of the [Expert] / [Journal] tab windows? I thought this will be an easy to find in the documentation / an internet search... I would like to have clear [Expert] window tab when every I am executing a script / EA when looking at data. At moment, I right click on the tab window and select [Clear] each time I execute a script / EA. It kinda annoying that I have to do it each time... TIA!
No, there is no such functionality. You are also defeating the purpose of the logs in the first place by doing so. Instead output your data to your own log file.
Fernando Carreiro #:
No, there is no such functionality. You are also defeating the purpose of the logs in the first place by doing so. Instead output your data to your own log file.
Okay thats cool... I might just display the data on the charts using Label Objects or maybe a comment command line... I don't think I need a log file :D , My purpose just need to view data when I just need it like troubleshooting & debugging... Thanks!
No, there is no such functionality. You are also defeating the purpose of the logs in the first place by doing so. Instead output your data to your own log file.
I recommend the following solution:
We set the platform height to, for example, 7 lines in the "Terminal" window:
https://ibb.co/HYwxBrw
//+------------------------------------------------------------------+ //| ind_LOG_RP.mq5 | //+------------------------------------------------------------------+ #property version "1.00" #property indicator_chart_window #property indicator_buffers 0 #property indicator_plots 0 //+------------------------------------------------------------------+ //| Variable declaration | //+------------------------------------------------------------------+ bool b_CHECK; double db_MAX, db_MIN; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { b_CHECK = true; 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[]) { db_MAX = 1.7234; db_MIN = 1.1422; if(b_CHECK) { Print( "---- START ----", "\n", "db_MAX: ", db_MAX, "\n", "db_MIN: ", db_MIN, "\n", "\n", "\n", "\n", "---- END ----" ); b_CHECK = false; } return(rates_total); } //+------------------------------------------------------------------+
Best regards.
![1 hosted at ImgBB 1 hosted at ImgBB](https://c.mql5.com/36/78/1-hosted-at-imgbb.png)
I achieved a cool effect thanks to Chat GPT. This time everything looks similar, but there is a 5-second delay between the new and old text, which provides us with additional programming comfort. Best regards.
//+------------------------------------------------------------------+ //| ind_LOG_RP.mq5 | //+------------------------------------------------------------------+ #property version "1.00" #property indicator_chart_window #property indicator_buffers 0 #property indicator_plots 0 //+------------------------------------------------------------------+ //| Variable declaration | //+------------------------------------------------------------------+ bool b_CHECK; datetime dt_CT, dt_ST; double db_MAX, db_MIN; int z; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { b_CHECK = true; 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[]) { dt_ST = TimeLocal(); //---- Main program block --------------------- db_MAX = 1.7234; db_MIN = 1.1422; //--------------------------------------------- if(b_CHECK) { for(z = 0; z < 2; z++) { if(z == 0) f_INFORMATION_1(); if(z == 1) f_INFORMATION_2(); Print( "db_MAX: ", db_MAX, "\n", "db_MIN: ", db_MIN, "\n", "\n", "\n", "\n", "---- END ----" ); dt_CT = TimeLocal(); if (dt_CT - dt_ST >= 5) dt_ST = dt_CT; // Start time update else { // Waiting to reach 5 seconds from the beginning of the loop while (TimeLocal() - dt_ST < 5) { Sleep(100); // Wait for 100 milliseconds } } } b_CHECK = false; } return(rates_total); } //+------------------------------------------------------------------+ void f_INFORMATION_1() { Print( "---- START ---- NEW CHANGE ----" ); } void f_INFORMATION_2() { Print( "---- START ----" ); } //+------------------------------------------------------------------+
Editing:
However, the previous version is better because here, regardless, the corrections, calculations, and graphic objects will be applied to the chart only after the execution of the second loop cycle, until the entire program block is completed.![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
is there a command or a function that can clear the records of the [Expert] / [Journal] tab windows?
I thought this will be an easy to find in the documentation / an internet search...
I would like to have clear [Expert] window tab when every I am executing a script / EA when looking at data. At moment, I right click on the tab window and select [Clear] each time I execute a script / EA. It kinda annoying that I have to do it each time... TIA!