In order to delete quotations from a local database manually, we can use Quotations Editor (Symbol–>Quote Editor<\/strong>), then mark the required range of quotes and press Delete<\/strong> button. To mark a range – it is enough to click on the first line of the range, then scroll to the other line, hold SHIFT and click on the end-line of the range. To multi-select individual lines, hold down CTRL key while clicking on the lines.<\/p>
<\/p>
There is also a way to delete quotations programmatically with use of OLE automation interface explained here:<\/p>
http:\/\/www.amibroker.com\/guide\/objects.html<\/a><\/p>
\/\/ THIS IS NOT AFL\r\/\/ This is Windows script to be run from the outside of AmiBroker\rfunction RemoveAllQuotes( Name )\r{\r AB = new ActiveXObject(\"Broker.Application\");\r Stk = AB.Stocks( Name );\r Quotes = Stk.Quotations;\r iQty = Quotes.Count;\r for( i = iQty - 1; i >= 0; i-- )\r {\r Quotes.Remove( i );\r }\r AB.RefreshAll();\r}\rRemoveAllQuotes(\"MSFT\");\rWScript.Echo ( \"Completed\" );\r<\/pre>The code above is intended to be used from the outside of AmiBroker.<\/p>
To use above code follow these steps:<\/p>
- Open Notepad
- Copy-paste above the code
- Save the file with .JS extension (which means that system will treat this as JScript code)
- Make sure that AmiBroker is running with desired chart as active one
- Double click on .JS file to execute the JScript code<\/ol>
IMPORTANT:<\/em> if you are running 64-bit Windows and have BOTH 32-bit and 64-bit versions of AmiBroker installed the OLE scripts by default would only talk to 64-bit instance. To use 32-bit version instead you would need to follow advice given in this article: “Running OLE automation scripts with 32- and 64-bit versions of AmiBroker”<\/a><\/p>
\/\/ THIS IS NOT AFL\r\/\/ This is Windows script to be run from the outside of AmiBroker\rfunction RemoveQuotesWithZeroVolume( Name )\r{\r AB = new ActiveXObject(\"Broker.Application\");\r Stk = AB.Stocks( Name );\r Quotes = Stk.Quotations;\r iQty = Quotes.Count;\r cnt = 0;\r for( i = iQty - 1; i >= 0; i-- )\r {\r qt = Quotes.Item( i );\r if( qt.Volume == 0 ) \r { \r cnt++;\r Quotes.Remove( i );\r }\r }\r \r AB.RefreshAll();\r\r return cnt;\r}\rn = RemoveQuotesWithZeroVolume(\"MSFT\");\rWScript.Echo ( \"Removed \" + n + \" quotes with zero volume\" );\r<\/pre>","protected":false},"excerpt":{"rendered":"In order to delete quotations from a local database manually, we can use Quotations Editor (Symbol–>Quote Editor), then mark the required range of quotes and press Delete button. To mark a range – it is enough to click on the first line of the range, then scroll to the other line, hold SHIFT and click […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1037"}],"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=1037"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":1044,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1037\/revisions\/1044"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}