Australian (ASX) Stock Market Forum

Amibroker FAQ

I'm not 100% sure if I understand the question..but...

GraphXSpace=50;

...added to your formula will display the last bar in the centre vertically. Otherwise you can left click to the right of the y axis, hold your mouse button down and move the y axis scale until it's centred.

To centre price horizontally you need to add more space to the right of the x axis. This can be adjusted in using Tools->Preferences->Charting->Blank bars in right margin

AS with all things in Amibroker there are a myriad of ways to achieve what you're after, depending on whether your preference is for a formula based answer or a point and click type answer.
 
Calculating Start of Previous Month

Hello All,

I'm working in the Weekly timeframe and would like to calculate how many weekly bars have past since the START of the PREVIOUS MONTH.

I can easily find out how many bars have occured since the Start of the Current Month using:

BarsStartCurrentMth = BarsSince(Month()!=Ref(Month(),-1)) + 1 ;

However, I'm struggling to find how many bars have occured since the Start of the Previous Month. What makes this difficult for me is that not all Months contain 4 weeks.

The only possible idea I have is to create a loop which contains a variable (x) which increments by 1 each time a new Month begins. Outside of this loop I could then use BarsSince() function to determine how many bars have occurred since (x-1) occurred. However, I've yet to test this idea so not currently sure whether this is possible.

Regardless of this, Is there an easier way to solve this problem?

Many Thanks in advance....
 
Does any body know the code for calculating current equity?
I know Capital is starting capital but need to calculate current equity during a backtest

Thanks
Brad
 
Hey all

I'm for a code for a trailing stop which gives a sell signal for the lowest low in the last x days. I cant seem to find anything on the net about this. Does anyone have anything out there?

Thanks,

Sammy
 
Hey all

I'm for a code for a trailing stop which gives a sell signal for the lowest low in the last x days. I cant seem to find anything on the net about this. Does anyone have anything out there?

Thanks,

Sammy

I could probably make you one.
Do you want it to be a % of the lowest low, move, or just the lowest low x days ago and stay there?
 
I could probably make you one.
Do you want it to be a % of the lowest low, move, or just the lowest low x days ago and stay there?

I need it to be the lowest low within a certain time frame, for e.g the lowest low in the last 13 days. Thank you for your help beamstas. How did you get good at AFL? I bought Brandy's book of quantitative analysis, but it is beyond my level.

Sammy
 
I need it to be the lowest low within a certain time frame, for e.g the lowest low in the last 13 days. Thank you for your help beamstas. How did you get good at AFL? I bought Brandy's book of quantitative analysis, but it is beyond my level.

Sammy

I don't have his book.. but i wish i had it :(

I've learnt the hard way, im not very good yet. Like i said i'll have a go for you.

Thanks
Brad :D
 
Brad,

If you live in Melbourne you are welcome to borrow it as it is not much use to me currently in my beginner AFL stages...
 
Calculating Start of Previous Month

Hello All,

I'm working in the Weekly timeframe and would like to calculate how many weekly bars have past since the START of the PREVIOUS MONTH.

I can easily find out how many bars have occured since the Start of the Current Month using:

BarsStartCurrentMth = BarsSince(Month()!=Ref(Month(),-1)) + 1 ;

However, I'm struggling to find how many bars have occured since the Start of the Previous Month. What makes this difficult for me is that not all Months contain 4 weeks.

The only possible idea I have is to create a loop which contains a variable (x) which increments by 1 each time a new Month begins. Outside of this loop I could then use BarsSince() function to determine how many bars have occurred since (x-1) occurred. However, I've yet to test this idea so not currently sure whether this is possible.

Regardless of this, Is there an easier way to solve this problem?

Many Thanks in advance....

Ok... Well my idea of using a loop in the manner detailed above doesn't seem to work :(

If anyone has any ideas, I'd be most welcome....

Thanks Everyone....
 
Symbol for SPI in Amibroker with Interactive Brokers

Hiya,

Sorry for the newbie question. I have been trying to get the SPI futures contract working with Amibroker and an Interactive Brokers feed.

The connection to IB is working and I can download data for the YM, ES, NQ, etc. However when I use the symbol APM9-SNFE-FUT (for the June contract) I get the error "Symbol invalid".

Anyone have any ideas what the problem might be.

Many thanks.

TiP2012
 
Re: Symbol for SPI in Amibroker with Interactive Brokers

Hiya,

Sorry for the newbie question. I have been trying to get the SPI futures contract working with Amibroker and an Interactive Brokers feed.

The connection to IB is working and I can download data for the YM, ES, NQ, etc. However when I use the symbol APM9-SNFE-FUT (for the June contract) I get the error "Symbol invalid".

Anyone have any ideas what the problem might be.

Many thanks.

TiP2012

Try apm9-snfe-fut-aud

CanOz
 
I'm working in the Weekly timeframe and would like to calculate how many weekly bars have past since the START of the PREVIOUS MONTH.


You know what the bar count is on the last charted bar:

LastValue(Cum(1));

You know how to find the find the start of the month using Month()!=Ref(Month(),-1), so use the ValueWhen() function to find the counter of the bar on the second last time this condition was true:

ValueWhen(2,Month()!=Ref(Month(),-1),Cum(1));

The difference between them is the number of elapsed bars?



Hope this helps.

wabbit :D

P.S. I haven't played with AmiBroker for a while, so interpret the codes as you need to!
 
You know what the bar count is on the last charted bar:

LastValue(Cum(1));

You know how to find the find the start of the month using Month()!=Ref(Month(),-1), so use the ValueWhen() function to find the counter of the bar on the second last time this condition was true:

ValueWhen(2,Month()!=Ref(Month(),-1),Cum(1));

The difference between them is the number of elapsed bars?



Hope this helps.

wabbit :D

P.S. I haven't played with AmiBroker for a while, so interpret the codes as you need to!


Hi Wabbit,

I ended up actually using the BarIndex() function (within the last day or so) to achieve a similar result, after realising that a loop was unnecessary. However, thanks very much for taking the time to reply.

All the best.....
 
Hey all,

A couple of quick queries about amibroker, im looking to purchase it in the coming weeks, on their site it says an ultimate pack pro is available for $409, which says it includes lifetime licenses for the AFL wizard and Amiquote, just confirming this means that i won't have to pay a yearly renewal for them ever?

Would the Howard Bandy book - Introduction to AmiBroker, be the most appropriate learning resource? How long would it take for an average computer literate person to become familiar with using amibroker? p.s. do you still need amiquote if you receive a data feed from data providers, such as esignal?

Thanks,

Shaun.
 
Hey all,

A couple of quick queries about amibroker, im looking to purchase it in the coming weeks, on their site it says an ultimate pack pro is available for $409, which says it includes lifetime licenses for the AFL wizard and Amiquote, just confirming this means that i won't have to pay a yearly renewal for them ever?

Would the Howard Bandy book - Introduction to AmiBroker, be the most appropriate learning resource? How long would it take for an average computer literate person to become familiar with using amibroker? p.s. do you still need amiquote if you receive a data feed from data providers, such as esignal?
Thanks,
Shaun.

Shaun,
you dont need amiquote if you are receiving datafeed from a data provider which has a direct amibroker plugin. I can't tell you about Howard's book yet but I'll let you know from a newbie's perspective soon

regards

Paul
 
Calculate standard dev of volume at time

Hiya,

I found the code below on the Amibroker site, it calculates the average volume of the last d days at the current time on intraday data. I would like to add a standard deviation calculation to the code, however if add the the StDev function programmed in Amibroker it gives an incorrect result.

Does anyone now how to do this?

Thanks:)

Avgvol = 0;

if (Interval()<inDaily)
{
n = round(3600*HID/Interval()); //number of bars in the day
d = 20;//Param("Lookback days",10,1,30,1); //averaging period
barnum = BarsSince(Day()!=Ref(Day(),-1)); //bar number from start of the day
Currentime = TimeNum();
for (i=0; i<n; i++) {
VarSet("vol"+i,IIf(i==barnum,V,0));
}
for (i=0; i<n; i++) {
Avgvol=IIf(barnum==i,Sum(VarGet("vol"+i),n*d)/d,Avgvol);

}
Plot(Avgvol,"Average Volume",colorWhite,styleLine);
}
 
Hey guys, new to Amibroker. Seems quite difficult to get the hang of at the start. Only Trialing Amibroker and a free 3 week trial from Premium Data for the feed. Just wondering how I go about adding indicators to the charts. Mainly volume I'm after but I cant seem to find where to add it onto the chart.

Cheers
 
amip.png


That should explain

Brad
 
Top