Australian (ASX) Stock Market Forum

Amibroker FAQ

Hi All,
I have a simple AFL question that I just can't find the right code for.

I wan't to ensure that my when my buy signal is generated, the underlying stock has a minimum number of bars / history, i.e. don't buy anything with less than 250 days of trading data.

I assume that it is an easy line of code, any help greatly appreciated.
Thanks
 
Hi All,
I have a simple AFL question that I just can't find the right code for.

I wan't to ensure that my when my buy signal is generated, the underlying stock has a minimum number of bars / history, i.e. don't buy anything with less than 250 days of trading data.

I assume that it is an easy line of code, any help greatly appreciated.
Thanks
Hi @princey37,

If you create an additional entry condition as follows:- Cum(1) >= 250 it should solve the problem.

Cheers, Rob
 
Ok, onto the next simple question, how to exclude stocks that didn't trade yesterday, or must have traded in the last "n" bars.
Thanks in advance.
 
Ok, onto the next simple question, how to exclude stocks that didn't trade yesterday, or must have traded in the last "n" bars.
Thanks in advance.

Simple question - complex answer.

"Yesterday" is an issue when it comes to weekends and public holidays, and you might not necessarily want to exclude a stock that didn't trade because it had a trading halt.

Using volume isn't precise, because there are also situations where a company was halted but had some pre-market trading. That will result in volume but no price movement.


Code:
Traded = V > 0;
TradedInLastTenDays = Sum(Traded,10) > 0;

If your data provider provides bars on every trading date (aka date padding) a crude way of doing it is to look for the number of times V>0. If you use Norgate Data, you could use NorgatePaddingStatusTimeSeries() , and turn on Market Days padding, which provides a "1" if it padded (untraded during regular trading hours) or "0" if not, and use Amibroker's Sum function to see how often it has been padded in the last X days.
 
Simple question - complex answer.

"Yesterday" is an issue when it comes to weekends and public holidays, and you might not necessarily want to exclude a stock that didn't trade because it had a trading halt.

Using volume isn't precise, because there are also situations where a company was halted but had some pre-market trading. That will result in volume but no price movement.


Code:
Traded = V > 0;
TradedInLastTenDays = Sum(Traded,10) > 0;

If your data provider provides bars on every trading date (aka date padding) a crude way of doing it is to look for the number of times V>0. If you use Norgate Data, you could use NorgatePaddingStatusTimeSeries() , and turn on Market Days padding, which provides a "1" if it padded (untraded during regular trading hours) or "0" if not, and use Amibroker's Sum function to see how often it has been padded in the last X days.
Hi Richard,

Thanks, I believe that is what I am after. Basically just trying to stop suspended stocks from showing up in my explorations.
 
Happy Australia Day all...actually come to think of it are you still allowed to wish people happy Oz Day these days :unsure:

Anyway...hoping some AB guru can help me with this: how do I make the Y axis of the portfolio equity in AB backtest Log scale? I know google is your friend but struggling to find solution.

Thanks and hope you have a great "whatever the PC term is" Day.

bt output.png
 
Happy Australia Day all...actually come to think of it are you still allowed to wish people happy Oz Day these days :unsure:

Anyway...hoping some AB guru can help me with this: how do I make the Y axis of the portfolio equity in AB backtest Log scale? I know google is your friend but struggling to find solution.

Thanks and hope you have a great "whatever the PC term is" Day.

View attachment 152152
I don't use AB but seen this, does this help in any way, if not sorry to waste your time.

 
Thanks @debtfree....all working now :D

I've seen that AB forum post before and couldn't follow what they were saying (I'm not the sharpest tool in the shed). Pointing me to the prior post here starting on page 89 turned the light bulb on for me and now I've got it working.

Here's a screen shot of what I did in case this helps others in the future.


log output.png
 
Thanks @debtfree....all working now :D

I've seen that AB forum post before and couldn't follow what they were saying (I'm not the sharpest tool in the shed). Pointing me to the prior post here starting on page 89 turned the light bulb on for me and now I've got it working.

Here's a screen shot of what I did in case this helps others in the future.


View attachment 152161
This doesn't work in latest version of Amibroker, right?
 
Top