{"id":483,"date":"2014-10-03T06:27:32","date_gmt":"2014-10-03T11:27:32","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=483"},"modified":"2014-12-03T08:13:00","modified_gmt":"2014-12-03T13:13:00","slug":"how-to-setup-perodic-scans","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2014\/10\/03\/how-to-setup-perodic-scans\/","title":{"rendered":"How to setup automatic periodic scans & explorations"},"content":{"rendered":"

One of the most powerful features of AmiBroker is the ability of screening even hundreds of symbols in real-time and monitor the occurrence of trading signals, chart patterns and other market conditions we are looking for. This can be done in Analysis module with Scan<\/strong> or Exploration<\/strong> features. <\/p>

The main difference between Scan<\/strong> and Exploration<\/strong> is that Exploration<\/strong> allows to customize the output shown in Analysis window (this is explained in details in the following tutorial chapter: http:\/\/www.amibroker.com\/guide\/h_exploration.html<\/a>), while Scan<\/strong> performs search for at least one of Buy, Sell, Short, Cover signals and displays predefined set of columns. Both these features allow for continuous screening of the database in real-time conditions.<\/p>

The following procedure shows how to configure basic scan formula and generate alerts when conditions coded in the formula are met. We assume that AmiBroker is already configured to receive real-time data from one of realtime data vendors – the list of recommended datasources is available here: http:\/\/www.amibroker.com\/guide\/h_quotes.html<\/a><\/p>

We need to do the following:
– open Formula Editor<\/strong> window with Analysis->Formula Editor<\/strong> command from the menu
– in the editor window enter or paste the code below<\/p><\/span>\/\/ example trading signals defined here
<\/span>Buy <\/span>= <\/span>Cross<\/span>( <\/span>MACD<\/span>(), <\/span>Signal<\/span>() );
<\/span>Sell <\/span>= <\/span>Cross<\/span>( <\/span>Signal<\/span>(), <\/span>MACD<\/span>() );
<\/span>\/\/
\/\/ additional part of the formula which generates audio alerts when condition is detected
<\/span>AlertIF<\/span>( <\/span>Buy<\/span>, <\/span>"SOUND C:\\\\Windows\\\\Media\\\\Ding.wav"<\/span>, <\/span>"Audio alert"<\/span>, <\/span>1 <\/span>);
<\/span>AlertIF<\/span>( <\/span>Sell<\/span>, <\/span>"SOUND C:\\\\Windows\\\\Media\\\\Ding.wav"<\/span>, <\/span>"Audio alert"<\/span>, <\/span>2 <\/span>)<\/code>

After entering the code use Tools->Send to Analysis<\/strong> as shown below:<\/p>

\"Send <\/p>

Then in the Analysis<\/strong> window select Apply To: All Symbols, Range: 1 Recent bar<\/strong>, this defines which symbols are included in the screening and what time-range will be shown in the results list.<\/p>

\"Range <\/p>

To enable continuous screening, mark Auto-repeat (AR) Scan\/Explore<\/strong> option and enter the repeat interval. The interval can be specified in minutes or seconds (for example entering 10s means 10-seconds, while 5m means 5-minutes). The below example uses 15-second repeat interval:<\/p>

\"Auto-repeat <\/p>

NOTE: If that is the very first screening after launching the database and it may require filling the historical quotes, then it is also required to mark Wait for Backfill (applies to data sources, which support this feature, see: http:\/\/www.amibroker.com\/guide\/h_rtsource.html<\/a> for more details).<\/em><\/p>

Now press Scan<\/strong> button to initiate the screening process:<\/p>

\"Scan\" <\/p>

The results window will show the hits and generated alerts will also be logged in Alert Output<\/strong> window and the scan will be automatically repeated every 15 seconds in search for new signals.<\/p>

\"Scan\" <\/p>

More information about generating and configuration formula-based alerts is presented in this tutorial: http:\/\/www.amibroker.com\/guide\/h_alerts.html<\/a><\/p>","protected":false},"excerpt":{"rendered":"

One of the most powerful features of AmiBroker is the ability of screening even hundreds of symbols in real-time and monitor the occurrence of trading signals, chart patterns and other market conditions we are looking for. This can be done in Analysis module with Scan or Exploration features. The main difference between Scan and Exploration […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[14,28,24],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/483"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=483"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/483\/revisions"}],"predecessor-version":[{"id":610,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/483\/revisions\/610"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}