- Joined
- 30 June 2007
- Posts
- 7,200
- Reactions
- 1,226
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?
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?
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.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
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.
I use Commsec.Which data supplier are you using?
I have not checked my imports and hope I have not spent 2 weeks replaying last year...
Contacted Commsec. They will look into it.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.
Quick question how do you import from comsec, are you with iress or something like this, I use both bell direct and comsec but get all my AB feed from northgateContacted Commsec. They will look into it.
// 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)); } } }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?