Australian (ASX) Stock Market Forum

Amibroker FAQ

Joined
Jul 1, 2008
Posts
129
Reactions
1
Hi, is there a way to open a particular chart always on the "Weekly" view, each time I click on a company from the analysis results table, it reverts back to the daily view.
I am using
TimeFrameSet( inWeekly );
in the code
the graph plots using weekly data but the time axis is still using the daily timeline
Capture.PNG .
 
Joined
Jul 1, 2008
Posts
129
Reactions
1
^ Choosing Weekly in the settings (for Periods) of the Analysis window, stops the chart switching to daily.
But is there a way to have that set in the code for a chart.
 
Joined
Oct 25, 2009
Posts
13
Reactions
0
Hi Guys, How do I make a scan for the following, whereby to scan stocks and place in separate columns based on the zscore calculation (zz):
> 0 and < 2 >2 and <5, >0 and <-2, >-2 and <-5

Tks



function zscore(price,Length)
{
av = MA(price,Length);
st = StDev(price,Length);
zs = (price - av) / st;
return zs;
}
zz= zscore(C,20);
Plot(C,"C",colorBlack,styleCandle);
Plot(zz,"z-score",colorDarkBlue,styleLine|styleOwnScale,-2,2);
Plot(0,"0",colorDarkGrey,styleDots|styleOwnScale,-2,2);
Plot(1,"1",colorDarkGreen,styleDots|styleOwnScale,-2,2);
Plot(-1,"-1",colorDarkGreen,styleDots|styleOwnScale,-2,2);
 
Joined
Jun 13, 2007
Posts
838
Reactions
114
Hi xyz --

You probably want an Exploration, which will result in a table.

(Plots show up when you "Apply Indicator" to open a pane in the chart window to plot the indicator.
Scans are usually used to display lists of issues with action signals -- Buy or Sell -- for a short time period, such as today only.)

As a first cut, which puts all the zscores in a single column which you can sort by clicking the header of that column:

// ZScoreExplore.afl
//
// Run this as an Exploration
//
// Set the current symbol or use a watchlist
// Set a date range or use n last days
// Click Explore
//
// To sort, click the column header, ZScore

function zscore( price, Length )
{
av = MA( price, Length );
st = StDev( price, Length );
zs = ( price - av ) / st;
return zs;
}

zz = zscore( C, 20 );

Filter = 1;

AddColumn( zz, "ZScore", 10.4 );

//////////////// end ////////////////

Thanks,
Howard
 
Joined
Mar 16, 2010
Posts
22
Reactions
0
Hi Fellas,
Just wondering if anyone can tell me how to bring up OOS equity curves for previously saved walk forward test results on a portfolio level.
I worked out how to bring them up on current ongoing studies but once finished and closed i can't seem to find any way to bring it up again without doing the test again.:confused:

Thanks a lot,

Sparfarkle
 
Joined
May 24, 2008
Posts
500
Reactions
7
Hi Fellas,
Just wondering if anyone can tell me how to bring up OOS equity curves for previously saved walk forward test results on a portfolio level.
I worked out how to bring them up on current ongoing studies but once finished and closed i can't seem to find any way to bring it up again without doing the test again.:confused:

Thanks a lot,

Sparfarkle

I recently came across a method in the Amibroker Knowledge Base on how to create a copy of the portfolio equity to another symbol so you can keep it for future analysis. Will this help? See http://www.amibroker.com/kb/2006/03/11/how-to-create-copy-of-portfolio-equity/
 
Joined
Mar 16, 2010
Posts
22
Reactions
0
Thanks for the link AE,not quite what i was looking for but useful in itself.
My question relates to opening a previously saved walk forward study showing all the results but being unable to bring up an out of sample equity curve for it.:eek:

Sparfarkle
 
Joined
Sep 28, 2009
Posts
8
Reactions
0
Can anyone please tell me whether the AlertIf function can be used for multiple stock symbols at the same time? If so, how can it be done? I have live data feed from IQFeed. Thank you.
 
Joined
Oct 25, 2009
Posts
13
Reactions
0
Hi Howard,
Thank you for your reply, you make it look so easy. I am attempting to learn.. from no experience in programming on and off for quite a while now between working etc. I have to learn to look outside the square, and tackle the problems from different angles, (I think.) Thank you again.
 
Joined
Jul 1, 2008
Posts
129
Reactions
1
I am doing explorations on a specif set of date ranges, i.e. not upto the current date e.g. 1/10/2010 to 1/3/2011.
I am having trouble figuring out when we are at the last day of the exploration range, as Amibroker's barindex goes beyond the range.

As I plan to filter only the stocks I am currently holding (i.e. bought) and perform a rough profit calculation, so these values can be side by side in a table next to the indicator values I am testing.

The end goal is plot these on a scatter diagram (by cut and pasting the table into Excel) and see if there are correlations.

I can't use backtest to calculate individual profits because then I lose the indicator values.

Thanks
 
Joined
Jul 1, 2008
Posts
129
Reactions
1
I am currently manually writing the date in code to signal this
EndExp = 1110304; //1/3/2011
EndExpBar = IIf( BarIndex() == ValueWhen(EndExp == DateNum(), BarIndex()),1, Null) ;
 
Joined
Feb 26, 2007
Posts
358
Reactions
0
Couple of beginner questions...

Is there a way to specify a specific range? Rather than just 'last x bars', I want the average of the bars between 20 and 3 days ago. It can be done by summing the last 20, and subtracting the last 3, and taking the average, but I'm wondering if theres aneater way.

Also, I see there is a lowest and highest function. Is it possible to get the 2nd lowest, or the sum of the top 5 highest?
 
Joined
Aug 6, 2010
Posts
116
Reactions
0
Couple of beginner questions...

Is there a way to specify a specific range? Rather than just 'last x bars', I want the average of the bars between 20 and 3 days ago. It can be done by summing the last 20, and subtracting the last 3, and taking the average, but I'm wondering if theres aneater way.

Also, I see there is a lowest and highest function. Is it possible to get the 2nd lowest, or the sum of the top 5 highest?
Remember that MA() is an array. So,

X = Ref( MA( C, 17 ), -3 );
 
Joined
Oct 24, 2005
Posts
1,286
Reactions
786
Amibroker 5.43.0 Beta was released earlier this morning and introduces multi-threaded Backtesting. A quick test of one of my systems shows backtesting speed reduced from 17 seconds down to 8 seconds :)

The next step will be the implementation of multi-threading for optimisation/ walk-forward analysis. Tomasz seems particularly receptive to any suggestions at the moment regarding these changes so it would be a great opportunity for anyone with an interest in this area to test the current Betas and provide some feedback via the Yahoo list or direct to Tomasz.
 
Joined
Dec 14, 2010
Posts
3,300
Reactions
30
Is there any way at all to get up a New High-New Low indicator which tells how many companies on the All Ords have made new highs/lows on any particular day?

I'm not too optimistic that there is but thought I would ask just incase.
 
Joined
Oct 24, 2005
Posts
1,286
Reactions
786
Is there any way at all to get up a New High-New Low indicator which tells how many companies on the All Ords have made new highs/lows on any particular day?
The Add to composite function would probably be the best way of creating a custom indicator to show those values. A couple of links below. The 2nd link has links to several AFL library formulas with some good examples. eg. 52 week new high/low etc.

http://www.amibroker.com/guide/a_addtocomposite.html

http://www.amibroker.com/guide/afl/afl_view.php?name=addtocomposite
 
Joined
Dec 14, 2010
Posts
3,300
Reactions
30
The Add to composite function would probably be the best way of creating a custom indicator to show those values. A couple of links below. The 2nd link has links to several AFL library formulas with some good examples. eg. 52 week new high/low etc.

http://www.amibroker.com/guide/a_addtocomposite.html

http://www.amibroker.com/guide/afl/afl_view.php?name=addtocomposite
Thanks, that is exactly what I'm after.
However, I am having difficulty applying this as an indicator. I opened the second link you posted to use as the indicator and followed the instructions in the first link but I cannot get my head around it.
Is there a simple way to explain this for someone who isn't all that savvy with Amibroker or coding?
 
Joined
Dec 14, 2010
Posts
3,300
Reactions
30
There's an Add-to-composite tutorial in the 3rd party support area of Amibroker that may help. (nb. this link will open a PDF file)

http://www.amibroker.org/3rdparty/IntroToAtc.pdf
Thanks, I had a play around with that.
I've got the ~NewHighNewLowIndex to show up under Groups --> Composites (253). In the screenshot below you can see that it comes up in the top window. The highlighted day shows -549 which coincides with the low of the market so it is obviously correct.

My queston is: How is this made into an indicator (in bar or line format), which can be opened at the same time as other price charts?

NewHighLow.png
 

CanOz

Home runs feel good, but base hits pay bills!
Joined
Jul 11, 2006
Posts
11,534
Reactions
491
Can anyone tell me how to enter ASX stock symbols into Amibroker while using Interactive Brokers data? Eg. WBS-ASX-STK??? obviously not as that doesn't work, but it should be something like that.

Cheers,


CanOz
 

Similar threads

Top