最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to get new price data for charts every few seconds in Delphi? - Stack Overflow

programmeradmin3浏览0评论

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 ;
  1. With the chart command, the chart is loaded.
  2. With the pause (10) command, the chart remains in the same state for 10 seconds
  3. 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

发布评论

评论列表(0)

  1. 暂无评论