Export RTH (read custom session) daily futures data from IB  [SOLVED]

Questions about MultiCharts and user contributed studies.
alko
Posts: 23
Joined: 01 Sep 2016

Export RTH (read custom session) daily futures data from IB

Postby alko » 17 Oct 2016

Hello,

I am trying to export RTH (regular trading hours) - or read cutom time session for that matter - data for futures from to IB for offline analysis. On the chart, i have daily bars made out of minutes. Now, i need to export RTH daily data. How can I do that? IB daily data is for ETH sessions, and minutes data downloads from IB does not allow to export daily data.

Thank you for your help.

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Export RTH (read custom session) daily futures data from

Postby bensat » 17 Oct 2016

You can choose a session in the symbol properties of the chart.

Screenshot - Chart/Symbol properties
Image

If the session is not already included, you can set a new session in the <Quotemanager> under <Tools ... Session Templates>.

Kind Regards

Ben

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Export RTH (read custom session) daily futures data from

Postby TJ » 17 Oct 2016

You can choose a session in the symbol properties of the chart.

Screenshot - Chart/Symbol properties


If the session is not already included, you can set a new session in the <Quotemanager> under <Tools ... Session Templates>.

Kind Regards

Ben
That would not change the daily data from the dataprovider.

You have to build the custom daily bars by selecting "Build from minutes".

alko
Posts: 23
Joined: 01 Sep 2016

Re: Export RTH (read custom session) daily futures data from

Postby alko » 17 Oct 2016

I do not have a problem with the chart. I need to export data. And need RTH daily data to export, which is a custom session data. In otder words, how can one export custom session daily data from MC? Thank you.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Export RTH (read custom session) daily futures data from

Postby TJ » 17 Oct 2016

I do not have a problem with the chart. I need to export data. And need RTH daily data to export, which is a custom session data. In otder words, how can one export custom session daily data from MC? Thank you.

Put the chart on the screen then...

File > Export Data

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Export RTH (read custom session) daily futures data from  [SOLVED]

Postby bensat » 17 Oct 2016

That would not change the daily data from the dataprovider.

You have to build the custom daily bars by selecting "Build from minutes".
@TJ

Don't you see it ???

Image

If he only has minute data, how he can export them from the <Quotemanager> as 'Daily' data as he wrote :
I do not have a problem with the chart. I need to export data. And need RTH daily data to export, which is a custom session data. In otder words, how can one export custom session daily data from MC? Thank you.
@alko

Code: Select all

Input: Filename("c:\FDAX_Test.txt"), Adj(0), Dec(2), Version("I");
vars: init(true), out_str("");

If Version = "D" then // Export Dily data
begin
If init then
begin
init = False;
FileDelete(Filename);
FileAppend(Filename, "Date, Open, High, Low, Close, Volume" + NewLine);
end;

out_str=elDateToString(Date) + ",";
out_str=out_str + NumToStr(O+Adj,Dec) + ",";
out_str=out_str + NumToStr(H+Adj,Dec) + ",";
out_str=out_str + NumToStr(L+Adj,Dec) + ",";
out_str=out_str + NumToStr(C+Adj,Dec) + ",";
out_str=out_str + NumToStr(Volume,0) + ",";
FileAppend(filename,out_str + NewLine);

End;

If Version = "I" then // Export intraday data
begin
If init then
begin
init = False;
FileDelete(Filename);
FileAppend(Filename, "Date, Time, Open, High, Low, Close, Volume" + NewLine);
end;

out_str=elDateToString(Date) + ",";
out_str=out_str + NumToStr(Time_s,0) + ",";
out_str=out_str + NumToStr(O+Adj,Dec) + ",";
out_str=out_str + NumToStr(H+Adj,Dec) + ",";
out_str=out_str + NumToStr(L+Adj,Dec) + ",";
out_str=out_str + NumToStr(C+Adj,Dec) + ",";
out_str=out_str + NumToStr(Ticks,0) + ",";
FileAppend(filename,out_str + NewLine);
End;

If Version = "T" then // Export tick data
begin
If init then
begin
init = False;
FileDelete(Filename);
FileAppend(Filename, "Date, Time, Close, Volume" + NewLine);
end;

out_str=elDateToString(Date) + ",";
out_str=out_str + NumToStr(Time_s,0) + ",";
out_str=out_str + NumToStr(C+Adj,Dec) + ",";
out_str=out_str + NumToStr(Ticks,0) + ",";
FileAppend(filename,out_str + NewLine);
End;
Import the attached file and add this to your chart as indicator. If you want to export daily data, you have to change input for <Version> to "D" and so on. You can set the decimals after the comma with input <Dec>.

Kind Regards

Ben
Attachments
dataexport.pla
(4.86 KiB) Downloaded 378 times


Return to “MultiCharts”