amibroker - exporting data for expired futures contracts

#1
Does anybody know how to export NSE data for expired futures contracts from Traderworkstation (Interactive brokers) to amibroker?

Thanks
 

tomjerry

Well-Known Member
#2
Does anybody know how to export NSE data for expired futures contracts from Traderworkstation (Interactive brokers) to amibroker?

Thanks
Save the data in a CSV file from Trader Workstation then Import in Amibroker.

Check the CSV file is as follows(if not then adjust as follow):
Column A: Date, Column B: Time, Column C: Open, Column D: High, Column E: Low, Column F: Close, Column G: Volume.

Import CSV to Amibroker:
Open Amibroker >> File >> Import Wizard >> Pack Files >> Browse the CSV file, select it, click Open >> click Next >> "Define Fields" window will appear, here you need to set Column 1 to Column 7 as follows
Column 1: DMY/MYD/YMD (Date), Column 2: Time, Column 3: Open, Column 4: High, Column 5: Low, Column 6: Close, Column 7: Volume.

>> now click Next >> click Finish. (If there is any error log file, then say "YES" then close the log file)

Now you can see the Name of CSV file in Amibroker's Symbol list, click on that Symbol name and your data will appear on active chart.
 
#3
Tomjerry - thanks for your previous suggestion.


I assume you have used the trader workstation api to download the historical futures data

i tried doing that, but it is not working.

In order to download 15 min data for LT (LARSEN&TUBRO) jan 2012, i typed the following in the excel data sheet

symbol > lt
type > fut
expiry > 201201
exchange > nse
currency > inr
enddate/time > 20120129.000000
duration > 1 w
bar size > 8
what to show > trades
rth only > 1
date format style > 1
page name > lt_fut_jan2012

on hitting the request historical data button, in the ctrl column, i get a message which says processing, but i did not get any sheet containing historical data.

If you too have used the trader worstation api to download data in csv format, can you please tell me where i am going wrong?
Otherwise if you have used any other alternate method, please let me know how it is done.

Thanks
 

tomjerry

Well-Known Member
#4
I assume you have used the trader workstation api to download the historical futures data
I have not used TWS.

Here are some suggestion which i found on IB website:

Try to enter all fields in CAPITOL letters!

[1] To request historical data, click the Historical Data tab at the bottom of the spreadsheet. Ensure that TWS is running. In the User Name field under Which Trader Workstation? enter the username of the currently running workstation application to connect.

[2] enddate/time > 20120126 13:00:00 GMT (notice the Space between date, time & GMT)
note: last day for january was 25 so first try with 26 if doesn't work then 25 to check that what will work

[End Date/Time: Use the format yyyymmdd {space}hh:mm:ss{space}tmz where the time zone is allowed (optionally)after a space at the end.]

[3] To request historical data for expired contracts:

[1] On the Historical Data page, create a ticker by filling in the fields in the Contract Description section of the page, or by clicking the Create Ticker button on the toolbar and entering the required information in the Ticker box.
[2] Enter the parameters of your query in the Query Specification fields.
[3] In the Expired field in the Query Specification section, enter TRUE.
[4] Select the line, then click the Request Historical Data button. When the Ctrl field displays "Finished," the results are displayed on the specified page.

[4] Try to wait for 10 minutes after click of Request Historical Data button, then check that Ctrl displays Finished or not. The new sheet will be generated at the end of all sheets.

link: http://www.interactivebrokers.com/p...orical_data.htm#XREF_67601_Viewing_Historical
 

tomjerry

Well-Known Member
#5
If this works well then create a new Excel file and copy paste historical data in new excel file then adjust data as i said in my first post then make sure that in new excel file: there is only one sheet (delete other two sheets) then save as "CSV (Comma Delimited)" with your preferred name then import to amibroker!

If you find in the Excel Sheet that Date & Time is combined in one column then you can separate both through Delimited function: Insert a new blank column on right side of "Date & Time" column, then select the entire "Date & Time" column, go to DATA tab on top of excel, in the Data Tools section there is a "Text to Columns" function-click on that, select Delimited then click Next, under Delimiter-select "Space" box (space should be selected), then click Next, click Finish, Click OK if any message "Do you want to replace the contents of the destination cells?", Now you can see that Date and Time are in two different columns, now again select entire Date column then do the Right click on selected column, click on Format cells, click on Date and select the proper date format and click OK.
 
Last edited:
#7
Hello,

I am having EOD datas in Excel file (updating manually EOD datas of Gold spot in USD value). I want to use amibroker for my analysis with EOD values.

Help is requested to convert or import last 5 years datas from excel file to Amibroker. After initial data feed, I can feed EOD values manually on daily basis.

Thanks & regards,
Keerthi
 

sr114

Well-Known Member
#8
Hello,

I am having EOD datas in Excel file (updating manually EOD datas of Gold spot in USD value). I want to use amibroker for my analysis with EOD values.

Help is requested to convert or import last 5 years datas from excel file to Amibroker. After initial data feed, I can feed EOD values manually on daily basis.

Thanks & regards,
Keerthi
yes it can be done, pls send me the excel file in zip format or upload in any file sharing site and i will convert it in ami format foor u and u can use it in ami for ur analysis

sr
 
#9
Hello sr114,

Thanks for your response. I tried to upload zip files in Traderji but but error showing unvalid file. How to attach zip files in Traderji (so far I havn't attached any files in traderji, please excuse me)?. I am available at keerthi405 at the rate g m ail dot com. Please send test message.

Thanks & regards,
Keerthi

yes it can be done, pls send me the excel file in zip format or upload in any file sharing site and i will convert it in ami format foor u and u can use it in ami for ur analysis

sr
 

Similar threads