Live chart data export to CSV

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Re: Live chart data export to CSV

Postby chimpy » Mon Jul 25, 2011 3:04 pm

Is there a general guide on the site of how to install the code you posted?

Also what is the default file location where the CSV files are updated to?

Thanks
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

Re: Live chart data export to CSV

Postby allpin » Tue Jul 26, 2011 9:18 am

Please use this zipped executable in case you do not want to compile code by yourself.
LiveChartDataExportToCSVexe.zip
Last edited by allpin on Mon Sep 19, 2011 2:56 pm, edited 8 times in total.
allpin
FXCodeBase: Confirmed User
 
Posts: 21
Joined: Thu Aug 19, 2010 3:29 pm

Re: Live chart data export to CSV

Postby allpin » Fri Jul 29, 2011 12:27 pm

ForexConnect API could be dowloaded from here: http://www.fxcodebase.com/wiki/index.php/June_2011_Release_(0.3.x)
allpin
FXCodeBase: Confirmed User
 
Posts: 21
Joined: Thu Aug 19, 2010 3:29 pm

Re: Live chart data export to CSV

Postby chimpy » Sun Jul 31, 2011 1:28 am

allpin I have attached my 3rd question as a text file.
Attachments
question3.txt
my question
(763 Bytes) Downloaded 342 times
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

Re: Live chart data export to CSV

Postby chimpy » Mon Aug 01, 2011 4:46 am

allpin,

I managed to get the CSV files to appear in the "C:\Program Files\Candleworks\ForexConnectAPI\bin" folder by running the application in administrator mode. However the files are still locked by the process so I cannot view them even using just notepad.
Not sure if this problem is related to the 'user control' feature in Vista/windows 7 but, it may be a good idea to move the CSV file target folder out of the programfiles folder as this folder is always probematic for data files I have experienced in the past.

Was there meant to be a Tick timeframe functionality? I tried to produce a tick CSV file by entering the letter "T" in the timeframe field of the configuration file but, it did not like it? I dont need a tick chart myself, just wondering if it is meant to work?

I also tried to produce CSV data files for the "SPX500" and "JPN225". I got a "Error: instrument JPN225 is invalid" message?

Some 3rd party charting packages have a problem with the price data keep changing the decimal places it uses, for example
one time the open is "1.82" and then on the next line it is "1.82037" then its "1.827" etc. For compatibility can the data be formated using all 5 decimal places as so, 1.82 becomes 1.82000 and 1.827 becomes 1.82700 . I can then set the charting package to analyse to the first four or five decinal places

Thanks again

chimpy
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

Re: Live chart data export to CSV

Postby allpin » Mon Aug 01, 2011 5:31 pm

This application cannot be used on ticks.

The format of the output file is DateTime, Bid Open, Bid High, Bid Low, Bid Close, Ask Open, Ask High, Ask Low, Ask Close, Volume.

About getting offers "SPX500" and "JPN225". Do you have US-based account? If the answer is "yes" you are unable to trade them. If the answer is "no", are you able to see them using trading station? Are you subscribed to them?

I have updated project and zipped executable.
Changes made:
- Output files can be opened while application is running as read-only.
- DateTime can be written in 2 fields ("Date" and "Time"). You have to provide <SeparateDateAndTime>Y</SeparateDateAndTime> in configuration file (default is one field for DateTime)
- Prices can be written formatted with fixed number of decimal places (using Digits value from Offers table). You have to provide <FormatDecimalPlaces>Y</FormatDecimalPlaces> in configuration file (default is 'N' - do not format prices)
- You can choose output directory for the .csv files. You have to provide something like <OutputDir>c:\fxcmdata</OutputDir> in configuration file (default is current directory)
Last edited by allpin on Tue Aug 02, 2011 10:12 am, edited 1 time in total.
allpin
FXCodeBase: Confirmed User
 
Posts: 21
Joined: Thu Aug 19, 2010 3:29 pm

Re: Live chart data export to CSV

Postby chimpy » Tue Aug 02, 2011 3:48 am

allpin,

Thanks for the update.
When the app does the initial download, the time format is 00:00 but then then the periodical updates come as 00:00:00 format. Both are workable but can it be one or the other please.

>>- Prices can be written formatted with fixed numbed of decimal places (using Digits from Offers >>table).
So its exactly the same data but with 0's put on the end to always make it up to 5 decimal places?



I am not in the US but the demo account does not have JPN225 available anyhow, that was the problem..

What does the tradingweekoffset do? I assume the trading day offset is related to the timezone. So a setting of 0 in the trading day offset would mean GMT?

Thanks
Chimpy
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

Re: Live chart data export to CSV

Postby chimpy » Tue Aug 02, 2011 12:26 pm

Hi, can you please tell me what do these two tags do?
<TradingDayOffset>-7</TradingDayOffset>
<TradingWeekOffset>-1</TradingWeekOffset>

Also, the data is set to EST but in the marketscope the time appears to be GMT+1
for consistancy can the CSV have the same time and date a whats in market scope or some way or setting the time.

thanks
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

Re: Live chart data export to CSV

Postby allpin » Tue Aug 02, 2011 12:58 pm

Hello Chimpy,
I have updated zipped project file and zipped executable on the thread.
Changes made:
Historic date and prices should have the same format as upcoming prices.

Trading day offset is an offset of the trading day against the date's midnight, expressed in hours. For example, FXCM US starts the trading day at 17:00 of the previous date. So, the offset of the trading day is -7 hours.
Trading week offset is an offset of the week day against the Sunday's midnight, expressed in days. For example, FXCM US starts the trading week at Friday 17:00 (Saturday's trading day start). So, the offset of the trading day is -1 day.

“Digits” value from “Offers” table is the number of digits after the decimal point to which the price of the instrument is rounded in calculations (5 for EUR/USD and GBP/USD, and 3 for USD/JPY). Application uses this value to get the number of decimal places. It would depend on the instrument used, and it does not always equal 5.
allpin
FXCodeBase: Confirmed User
 
Posts: 21
Joined: Thu Aug 19, 2010 3:29 pm

Re: Live chart data export to CSV

Postby chimpy » Wed Aug 03, 2011 2:08 am

Allpin,

An additional problem I found last night was that the M1 timeframe does not work. It reports an error of file in use even though there is not file at that stage.

Thanks again

Chimpy
chimpy
 
Posts: 97
Joined: Fri Jun 10, 2011 10:32 am

PreviousNext

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 31 guests