The Explore function in Amibroker is one of the most useful, and yet many Amibroker users never get to use it. It can find stocks that meet your criteria by doing a very simple scan, when you know how.
Amibroker 中的探索功能是最有用的功能之一,但许多 Amibroker 用户从未使用过它。 当您知道如何操作时,它可以通过进行非常简单的扫描来找到符合您标准的股票。
Using this tool can shave hours off your analysis when it finds everything you need automatically with just a little bit of Amibroker AFL language.
使用此工具只需一点 Amibroker AFL 语言即可自动找到您需要的所有内容,从而缩短您的分析时间。
Using Amibroker’s Explore Function To Scan For Stocks
使用 Amibroker 的探索功能扫描股票
First, open up the Formula Editor so we can put in our AFL code:
首先,打开公式编辑器,以便我们可以输入 AFL 代码:
- Up the top bar, go to Analysis > Formula Editor
在顶部栏上,转到“分析”>“公式编辑器”
- In the box that appears, type in this code below:
在出现的框中,输入以下代码:
pchng = ((C - Ref(C,-1)) / Ref(C,-1)) * 100; Filter = pchng; AddColumn(Close, "Close Price" ); AddColumn(pchng, "Percent Change" ); |
- I say type it in, because sometimes it formats wrongly from the website. If it works using copy and paste, then great!
我说输入它,因为有时它的格式从网站上是错误的。 如果使用复制和粘贴可以正常工作,那就太好了!
- Save the file if you want to.
如果需要,请保存文件。
- Click from the top bar: Tools > Send To Automatic Analysis
单击顶栏:工具 > 发送到自动分析
- Now, we work from left to right. Under “Apply To”, select either “Current Symbol” or “Use Filter”. If you are using a filter, select the watchlist you want to scan.
现在,我们从左到右工作。 在“应用到”下,选择“当前符号”或“使用过滤器”。 如果您使用过滤器,请选择要扫描的监视列表。
- Under “Range” select “n Last Days” and set it to 1.
在“范围”下选择“n Last Days”并将其设置为 1。
- Click the Explore button
单击探索按钮
You should see a list of your stock or stocks with the percentage change next to them!
您应该会看到您的股票列表,旁边有百分比变化!
A Closer Look At The Amibroker AFL
仔细看看 Amibroker AFL
Just a quick look at the Amibroker AFL – we’ll go into more detail in other lessons. The “pchng” you see first is setting up an Array, or rule for future use. Basically, by saying “pchng =” we make those rules that follow it happen whenever Amibroker sees the word “pchng” again. That word could be anything you like, but the rules we assign are limited to ones that Amibroker can recognize.
快速浏览一下 Amibroker AFL – 我们将在其他课程中详细介绍。 您首先看到的“pchng”是设置一个数组或规则以供将来使用。 基本上,通过说“pchng =”,只要 Amibroker 再次看到“pchng”这个词,我们就会制定遵循它的规则。 该单词可以是您喜欢的任何单词,但我们分配的规则仅限于 Amibroker 可以识别的规则。
To do the Explore, we simply need to have the “Filter” command. And our filter in this case, is the rule assigned to “Pchng” which gives us the percentage changes. After that, we are just adding columns to display the data for us.
要进行探索,我们只需要使用“过滤”命令即可。 在本例中,我们的过滤器是分配给“Pchng”的规则,它为我们提供了百分比变化。 之后,我们只需添加列来为我们显示数据。