刷新图表的快捷键是什么,我问openai,它说是f5

 

然而按了没反应

有刷新图表的脚本吗


我让ai给我写个刷新图表的脚步,编译失败,他写了个什么

//±-----------------------------------------------------------------+
//| 刷新.mq5 |
//| Copyright 2014, byJJ |
//| http://ideiasparainvestir.com |
//±-----------------------------------------------------------------+

#property copyright “Copyright 2014, by JJ”
#property link “http://ideiasparainvestir.com”
#property version1.00#property script_show_inputs
#property description “Simple Script for Apply Template and/or timeframe in all charts opened”

#include <Charts\Chart.mqh>;

input ENUM_TIMEFRAMES tempo_grafico=PERIOD_M5; // Change TimeFrame - Current = dont changed
input string template_name=“”; // Name of Template (without ‘.tpl’)

//±-----------------------------------------------------------------+
//| Script program start function |
//±-----------------------------------------------------------------+
void OnStart() {
long currChart=ChartID(); // Obter o ID do novo gr醘ico usando o ID gr醘ico anterior

// Se o tempo grafico e diferente aplica a todos  
if(tempo_grafico!=PERIOD_CURRENT) {  
    ChartSetSymbolPeriod(currChart,ChartSymbol(currChart),tempo_grafico);  
}  

// Aplica a template  
bool errTemplate=ChartApplyTemplate(currChart,template_name+“.tpl”);  

if(!errTemplate) {  
    Print("Erro ao adicionar a template a ",ChartSymbol(currChart),"-> ",GetLastError());  
}  

ChartRedraw();  


}
 
//±-----------------------------------------------------------------+  
//| RefreshChart.mq5 |  
//| Copyright 2022, byJJ |  
//| http://ideiasparainvestir.com |  
//±-----------------------------------------------------------------+  

#property copyright “Copyright 2022, by JJ”  
#property link “http://ideiasparainvestir.com”  
#property version1.00”  
#property script_show_inputs  
#property description “Simple Script for Refresh current chart”  

#include <Charts\Chart.mqh>;  

//±-----------------------------------------------------------------+  
//| Script program start function |  
//±-----------------------------------------------------------------+  
void OnStart() {  
    ChartRedraw(ChartID()); // Redesenha o gr醘ico atual  
}  

让它重新写个简单的,还是不行啊

 
//±-----------------------------------------------------------------+  
//| RefreshChart.mq5 |  
//| Copyright 2023 |  
//±-----------------------------------------------------------------+  

//±-----------------------------------------------------------------+  
//| Script program start function |  
//±-----------------------------------------------------------------+  
void OnStart() {  
    ChartSetSymbolPeriod(0,NULL,0); 
} 

还是应该加强学习

原因: