Australian (ASX) Stock Market Forum

Amibroker FAQ

Thanx for the reply Gringotts Banks , i am actually trying to add my BOut to my IndexFilterup if possible?
The IndexFilterup becomes true with both?

I assume you're doing a portfolio backtest with "all symbols" selected in the Analysis window.

x.jpg

Make sure you have symbol ^AORD in your database, with enough history. If you don't, use AQ to download from Yahoo finance.

x.jpg

Then substitute your breakout code where I have bolded below.

SetForeign("^AORD");
MAPeriod = Optimize("op",2,2,100,1);
IndexFilterup = C > MA(C,MAPeriod);
RestorePriceArrays();

Buy = IndexFilterup AND BOut;
 
Hey all, I've got AmiQuote running and downloading data using the Quandl source. It shows that the data is 'imported', however when I open a chart, it's not showing the most recent data. Can anyone help?
 
Hey all, I've got AmiQuote running and downloading data using the Quandl source. It shows that the data is 'imported', however when I open a chart, it's not showing the most recent data. Can anyone help?

In AQ, double click "download completed". Is it empty or populated with the correct quotes?
 
In AQ, double click "download completed". Is it empty or populated with the correct quotes?

I don't see 'download completed', only 'imported', next to the ticker in AmiQuote. When I double click, it says:
$NAME XPE.AX
Not Found

I am running Windows 10 and using AmiQuote 3.10 and Amibroker 5.90 Professional Edition 64-bit.
 
Update: I installed Microsoft Visual C++ 2017 runtime and it seems to be working fine now, the charts are showing updated prices. Thanks GB.
 
Anyone having problems with entering 2020 data?
I have looked at file data for say 2/01/2020 (e.g. 14D,200102,.195,.22,.195,.22,71258) and is no different to data to say 31/12/19 ( e.g. 14D,191231,.205,.21,.205,.21,110629).
(No solutions found on net or at amibroker.com)
 
Anyone having problems with entering 2020 data?
I have looked at file data for say 2/01/2020 (e.g. 14D,200102,.195,.22,.195,.22,71258) and is no different to data to say 31/12/19 ( e.g. 14D,191231,.205,.21,.205,.21,110629).
(No solutions found on net or at amibroker.com)
Here's a simple but time consuming workaround allowing Amibroker to read 2020 EOD data until your vendor starts sending data in the correct format.

Open a daily EOD data file in a simple text editing program (not Word).
Select and copy date segment from one of the ticker lines. For example Jan 2, 2020 will look like this200102. 200110. Fridays data
Go to menu "Find and Change" or similar.
Enter find: 190819
Enter change to: 20200110
Press "Change All" or similar
Save
All date events for every ticker in the daily EOD file are now in correct format.
Repeat this for each daily file.
Complain to your data provider to supply data in four digit format for the year.
notepad++ is free and ok for this to work you need to replace 190819 with this 20200110 this works with comsec data save file and install with wizard this hint was taken from here https://forum.amibroker.com/ i have no problems from Norgate date
 
Here's a simple but time consuming workaround allowing Amibroker to read 2020 EOD data until your vendor starts sending data in the correct format.

Open a daily EOD data file in a simple text editing program (not Word).
Select and copy date segment from one of the ticker lines. For example Jan 2, 2020 will look like this200102. 200110. Fridays data
Go to menu "Find and Change" or similar.
Enter find: 190819
Enter change to: 20200110
Press "Change All" or similar
Save
All date events for every ticker in the daily EOD file are now in correct format.
Repeat this for each daily file.
Complain to your data provider to supply data in four digit format for the year.
notepad++ is free and ok for this to work you need to replace 190819 with this 20200110 this works with comsec data save file and install with wizard this hint was taken from here https://forum.amibroker.com/ i have no problems from Norgate date

Thanks julieta, that worked.
Is a bit of a pain having to do that each time.
Found that reference and see that Tomasz is on top of it, blaming data vendors (rightly so). The year should be a 4 figure number. Will get onto my data supplier.
Thanks again.
 
Which data supplier are you using?
I have not checked my imports and hope I have not spent 2 weeks replaying last year...
Thanks julieta, that worked.
Is a bit of a pain having to do that each time.
Found that reference and see that Tomasz is on top of it, blaming data vendors (rightly so). The year should be a 4 figure number. Will get onto my data supplier.
Thanks again.
 
Thanks julieta, that worked.
Is a bit of a pain having to do that each time.
Found that reference and see that Tomasz is on top of it, blaming data vendors (rightly so). The year should be a 4 figure number. Will get onto my data supplier.
Thanks again.
Contacted Commsec. They will look into it.
 
I've recently started using Amibroker and its giving me some headaches. I have many questions but I will start with the most frustrating first.

I am trying to do what is seemingly a basic chart formatting function but I keep getting variable results.

Each chart has multiple tabs and I'm wanting to fix a few tabs so they keep the same format every time I use Amibroker.
eg.
1st tab may be a price bar chart with SMA,
2nd tab - Price bars and volume,
3rd tab - All ords index price chart bars and volume, ie. locked to XAO,
4th & 5th tabs to reflect the chart format from my 2 system AFL's.

I've used the chart layout and template functions suggested in guide but the results still seem to vary.

Any help will be appreciated.
 
Is it just me, or did someone put the Trash out?
Could be one damned prickly customer but still an amazing AFL coder and tutor.

Where are you Trash!!???
 
Does any one have or seen any code for a rolling 12 month returns profit table?

i.e instead of each month displaying that months return it would display a rolling 12 month CAR

This would be a great tool for looking into a systems consistency. I've tried to build my own no luck as yet.
 
@Roller_1 funny enough I came across this today and i'm sure that you could modify the CBT code to achieve what you want ? or at least give you some ideas

The below example displays the yearly returns at the end of your back test report

https://alvarezquanttrading.com/amibroker-sample-code/

upload_2020-5-29_13-41-47.png

Code:
// Provided by Cesar Alvarez www.AlvarezQuantTrading.com
// this code is for daily bar tests////////////////////////////////////////////////////////////
// Repalce with your code
SetOption("MaxOpenPositions",10);
SetPositionSize(10,spsPercentOfEquity);Buy = RSI(2) < 5;
Sell = RSI(2) > 80;Short = Cover = 0;
// End of replace
///////////////////////////////////////////////////////////// Or you can add the following to the end of your current code
// will not output anything if there are less than 200 bars in your test
SetCustomBacktestProc("");
if(Status("action") == actionPortfolio)
{
    dnStart = Status("rangefromdate");
    dnEnd = Status("rangetodate");
    yrStart = int(dnStart/10000);
    yrEnd = int(dnEnd/10000);    bo = GetBacktesterObject();
    bo.backtest();    ver = Version();    if(BarCount > 200)
    {
        dt = DateNum();
        if(ver <= 5.4)
            eq = Foreign("~~~EQUITY", "C");
        else
            eq = bo.EquityArray();        // This could also be done by compressing to Monthly bars
        eqM = 0; // end of year equity - saving 2001 data in bar 101, 2002 in bar 102, ...
        for (i = 1; i < BarCount-1; i++)
        {
            // are we at the end of a year
            if (int(dt[i+1]/10000) > int(dt[i]/10000) )
                eqM[int(dt[i]/10000)] = eq[i];
        }        // save the last equity
        eqM[yrStart-1] = GetOption("InitialEquity");
        eqM[yrEnd] = eq[BarCount-1];        // output the results
        for (i=yrStart; i<= yrEnd; i++)
        {
            bo.AddcustomMetric("" + (i + 1900) + " Ret % ", 100*(eqM[i]/eqM[i-1] - 1));
        }
    }
}
 
@Roller_1 funny enough I came across this today and i'm sure that you could modify the CBT code to achieve what you want ? or at least give you some ideas

The below example displays the yearly returns at the end of your back test report

https://alvarezquanttrading.com/amibroker-sample-code/

View attachment 103914

Code:
// Provided by Cesar Alvarez www.AlvarezQuantTrading.com
// this code is for daily bar tests////////////////////////////////////////////////////////////
// Repalce with your code
SetOption("MaxOpenPositions",10);
SetPositionSize(10,spsPercentOfEquity);Buy = RSI(2) < 5;
Sell = RSI(2) > 80;Short = Cover = 0;
// End of replace
///////////////////////////////////////////////////////////// Or you can add the following to the end of your current code
// will not output anything if there are less than 200 bars in your test
SetCustomBacktestProc("");
if(Status("action") == actionPortfolio)
{
    dnStart = Status("rangefromdate");
    dnEnd = Status("rangetodate");
    yrStart = int(dnStart/10000);
    yrEnd = int(dnEnd/10000);    bo = GetBacktesterObject();
    bo.backtest();    ver = Version();    if(BarCount > 200)
    {
        dt = DateNum();
        if(ver <= 5.4)
            eq = Foreign("~~~EQUITY", "C");
        else
            eq = bo.EquityArray();        // This could also be done by compressing to Monthly bars
        eqM = 0; // end of year equity - saving 2001 data in bar 101, 2002 in bar 102, ...
        for (i = 1; i < BarCount-1; i++)
        {
            // are we at the end of a year
            if (int(dt[i+1]/10000) > int(dt[i]/10000) )
                eqM[int(dt[i]/10000)] = eq[i];
        }        // save the last equity
        eqM[yrStart-1] = GetOption("InitialEquity");
        eqM[yrEnd] = eq[BarCount-1];        // output the results
        for (i=yrStart; i<= yrEnd; i++)
        {
            bo.AddcustomMetric("" + (i + 1900) + " Ret % ", 100*(eqM[i]/eqM[i-1] - 1));
        }
    }
}

Cheers Trav, I'm more thinking a table similar to the std profit table. I'll look into it more and see how i go. I've scoured the Amibroker forum, no luck as yet though.

Cheers
 
Top