I am new to Amibroker, need AFL code to develop indicator for Amibroker.
Indicator Logic…
On 5 min Chart, i need Volume Bars and on that volume bars need 21 EMA, logic is, if the next candle volume bar is 5 times of the 21 EMA then it should give pop-up alart saying “Volume Breakout”.
Another example. The code below doesn’t use Alertif() and gives another possibilities of alerting the user about some events by (for example) a PopUp window, spoken message or in any other way. It uses TimeNum() function and for this reason should be used on Intraday charts. Alert is triggered only once per bar.
I suggest adding the code (along with the volume EMA chart) to the pane with the volume histogram, below the main price chart. If you don’t know how to do it, watch this tutorial: http://www.amibroker.com/video/dragdrop1.html
@Sai.Parekh007112 , is your item ADANIENT a valid entry in your database?
The code works for @Milosz, so it would indicate issue is likely to be on your end.
Also by looking at the code and the output, it would appear that the issue could be that the item has no entries (no data).
Try running against a known good symbol.
Also, while there are many great helpful members, if you have an issue, getting “private” responses takes the learning out of the forum, and does not help other users who might have the same (or similar) issue to what you are dealing with. Forum replies help everyone.
Hi @Milosz, thanks for awesome code! I'm really new to AFL codes as well.
I managed to make your code works, when I click "Explore", alert window pops up, but it show's me stocks even way back 2009? I've already selected current date only. How to make it so that it will only limit to show me stocks for today only?
Second question, Do I need to keep on clicking "Explore" to run the code or will it automatically run and will display the pop up window?
@bluesand22 As I wrote, this code is designed to be used in a chart window (during the session) to generate live alerts. Additionally it should be used on intraday charts (1m, 5m, 1h etc.). It doesn't work properly in Exploration.
The above code (drag drop) when applied to multiple symbols throws an alert through alertif only when the condition is satisfied for selected symbol. For unselected symbols I found no alerts till the symbol is selected.
Just ran this code in analysis window as explore with automatic analysis every interval (5 min)
Works well. The following page describes how to use it.
@bluesand22 ,
one possible cause of the alert being triggering on data "way back in 2009", is that the symbol is no longer being traded, ie. the data ends in 2009. Check what setting you have for the "Range" in the Analysis tab.