Help-to save database in Amibroker trial

#1
Hello Everyone,
I have been using Amibroker5.50 trial for 3 months.It does not allow to save databases.Is there a solution to this issue so that the database can be saved in a .csv file which can be used later.Many of the members are experts in Amibroker.Please help me in this.
thanks & regards
dr.pkjee
 
#3
Hi prabhsingh!

Yes, the trial version works fine with RT data.Presently I am using datafeed of NOW, through ManshiRT.There is no problem.Only it would not save the data bases.

thanks
PKJee
 

amanfree

Active Member
#4
dr.pkjee has chosen not to receive private messages or may not be allowed to receive private messages. Therefore you may not send your message to him/her.

If you are trying to send this message to multiple recipients, remove dr.pkjee from the recipient list and send the message again.

plz enable ur private messages
 

amanfree

Active Member
#5
dr.pkjee send me pm, i ll tell u the way to save data. this is just cause i dont forget to reply on this thread again.....
 
#6
Hi,
Thanks for your reply.I was googling for a solution to saving data and found an AFL formula which did the trick. Had some problem in importing the data back to Amobroker which was later solved.For the benefit of others having similar problem,here is the AFL formula:

// By Barry Scarborough 7/14/2008, updated to handle large files 8/30/08
// Export intraday and EOD data to .csv files
// One file for each stock but the symbol name must be a valid Microsoft file
//Name OR you will have to modify it, see code below to change Name
// if the data exceeds 65500 lines it will be broken into separate files up to
//327,500 lines OR about 227 days of 24 Hour, one Minute data
// This will create a directory C:\AmiBackup
// Select your symbols to export with the "Apply to" filter in AA window, to
//save data base use all symbols AND all quotes
// Make sure the chart is on the period you want to save
// Select the same timeframe period you want to save as using the AA
//"Settings"
// Press Scan button
//

// created a directory on your C drive named Savedata data backup

dayhours = ParamToggle("Day hours only", "No|Yes");
fmkdir("c:\\SaveData\\");
SetBarsRequired(100000,100000);
lname = Name(); // gets the name of the symbol
// note: if you have names with invalid characters like / you must rename the
//file before you try to create a Name
// add an IF line for each symbol you need to rename
if (lname == "ER2U8-GLOBEX-FUT") lname = "ER2U8";

fh = fopen( "c:\\SaveData\\" + lname + ".csv", "w");
if( fh )
{
if(Interval() == inDaily OR Interval() == inMonthly OR Interval() ==
inWeekly)
{
fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh );
for( i = 0; i < BarCount; i++ )
{
y = Year();
m = Month();
d = Day();
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] );
fputs( ds, fh );
qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ] );
fputs( qs, fh );
if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
{
fclose( fh );
if(i == 65500 ) fh = fopen( "c:\\SaveData\\" + lname + " A.csv", "w");
if(i == 130000 ) fh = fopen( "c:\\SaveData\\" + lname + " B.csv", "w");
if(i == 196500 ) fh = fopen( "c:\\SaveData\\" + lname + " C.csv", "w");
if(i == 262000 ) fh = fopen( "c:\\SaveData\\" + lname + " D.csv", "w");
}
}
}
else // intraday so add time field
{
fputs( "Ticker,Date,Time,Open,High,Low,Close,Volume \n", fh );
y = Year();
m = Month();
d = Day();
r = Hour();
e = Minute();
n = Second();

for( i = 1; i < BarCount; i++ )
{
if (dayhours AND LastValue(TimeNum()) >= 92900 AND LastValue(TimeNum()) <=
161500)
{
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] );
fputs( ds, fh );

ts = StrFormat("%02.0f:%02.0f:%02.0f,", r[ i ],e[ i ],n[ i ] );
fputs( ts, fh );

qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ] );
fputs( qs, fh );
}
else
{
fputs( Name() + "," , fh );
ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] );
fputs( ds, fh );

ts = StrFormat("%02.0f:%02.0f:%02.0f,", r[ i ],e[ i ],n[ i ] );
fputs( ts, fh );

qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n", O[ i ],H[ i ],L[ i ],C[ i
],V[ i ] );
fputs( qs, fh );
}
if(i == 65500 OR i == 130000 OR i == 196500 OR i == 262000)
{
fclose( fh );
if(i == 65500 ) fh = fopen( "c:\\SaveData\\" + lname + " A.csv", "w");
if(i == 130000 ) fh = fopen( "c:\\SaveData\\" + lname + " B.csv", "w");
if(i == 196500 ) fh = fopen( "c:\\SaveData\\" + lname + " C.csv", "w");
if(i == 262000 ) fh = fopen( "c:\\SaveData\\" + lname + " D.csv", "w");
}
}
}
fclose( fh );
}

Buy = 1;


To import through ASCII the format should be:-
$FORMAT Ticker, Date_DMY, Time, Open, High, Low, Close, Volume
$SKIPLINES 1
$SEPARATOR ,
$CONT 1
$GROUP 255
$AUTOADD 1
$DEBUG 1
$NOQUOTES 1


thanks
PKJ
 

trade2411

Active Member
#7
Hi PKJ,

Am a complete newbie to Amibker, I am getting RT data and charts into amibroker, my amibroker is trial one, Can you please tel how and where to run that formula and where will this saave the data to? to the same DB where the current data is being fetched in RT or it will craete a new DB
 
#8
HI,

any one tell me can i add sound alert in amibroker when my price reach to our target price.

For eg. I purchase Bank nifty @ 11500 and my target is 11550 and stoploss is 11475.

I want set sound alert if price reach to 11550 and secound sound alert if price reach to my stop loss price 11475.

if any one know about these pls tell me.

Thanks
Kishor.
 

nms

Active Member
#9
Hi PKJ,
I am geting realtime data from Trade Tiger to AmiBroker in the method of Mr.Josh1. It is OK. But the data is not being saved. I want to know how the code yuo have mentioned above can be utilised in AB. Have you tried ?If so Pl. give the details step by step or are you adopting any other method to save data?
Thanks & Regards
 
#10
Hi PKJ,
I am geting realtime data from Trade Tiger to AmiBroker in the method of Mr.Josh1. It is OK. But the data is not being saved. I want to know how the code yuo have mentioned above can be utilised in AB. Have you tried ?If so Pl. give the details step by step or are you adopting any other method to save data?
Thanks & Regards
Dear nms,I am so sorry for having not replied.Actually I had taken up some assignment and not been trading or visiting the forum for a long time, so had not checked the mails.
Hope You must have found solution by this time.Still I will clarify how to use the Afl code sent earlier, to save RT data in Amibroker trial version.

1.First create a new folder in any drive of your computer.Name it (for example-C:\XYZ if you name the folder XYZ in drive C)
2.Copy the code in my earlier mail
3.Open Amibroker
4.Go to ->Tools ->Formula Editor
5.Open Formula editor & paste the code there.
6.then search in the code for - "c:\\SaveData\\" & replace with "c:\\XYZ\\".
7.Search the code for the lines:- ds = StrFormat("%02.0f-%02.0f-%02.0f,", m[ i ], d[ i ], y[ i ] );
and replace with:-ds = StrFormat("%02.0f %02.0f %02.0f,", d[ i ], m[ i ], y[ i ] );
(the above changes are to be made in 4 to 5 places)
8. Give a Name to the code.And save.

Now to save data -
1.Open Amibroker analysis window.
2.Click the half open folder icon(pick a file) on the upper right of the window.then browse to the code you had saved(it will be in the custom folder inside Amibroker's formula folder) & double click it.
2.Click settings tab in the analysis window-> change periodicity to Tick
3. Select All Sumbols in apply to option & all quotes in the range option.
4.Click Scan
The RT data will be saved to the folder you had created(in this example, folder XYZ in drive C)

thanks & cheers
PKJ
 

Similar threads