I get price data for use from another source (MetaTrader) and use it in my program I want the chart to be updated every 10 seconds and the price information of the chart to be updated. That's why I wrote this code. With this code:
procedure Button1Click(Sender: TObject);
var
path : string ;
Sellected : string;
begin
path:='C\Users\AppData\Roaming\MetaQuotes\Terminal
\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Files\';
Sellected := ' .txt';
chart(path + 'XAUUSD M1' + Sellected );
Pause(10)
ChartReplace( path + 'XAUUSD M1' + Sellected );
end ;
- With the chart command, the chart is loaded.
- With the pause (10) command, the chart remains in the same state for 10 seconds
- With the replace chart command, the same chart is loaded again. If I want to get new data, this code must be repeated over and over again.
Is there a way for this code to repeat itself every 10 seconds without being written multiple times? In fact, it's like creating a loop for these three lines of code. Please help if possible.. Thank you