Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add/import custom trading details from spreadsheet (csv) to jstock #34

Closed
ghost opened this issue Jun 19, 2015 · 5 comments
Closed

Comments

@ghost
Copy link

ghost commented Jun 19, 2015

I have a company trading details in spreadsheet ( csv format) which i want to import and do technical analysis in jstock. The spreadsheet contains these datas date ,open,close, high, low and volume in six separate column. What are the steps we have to take to import these CSV to jstock.

sample data

Date        Open        High        Low            Close        Volume
2015-06-18  46.220001   46.799999   46.169998   46.720001   3184500
2015-06-17  45.73       46.07       45.360001   45.970001   1566300
2015-06-16  45.349998   46.240002   45.299999   45.830002   2682250
2015-06-15  45.450001   45.650002   45.02       45.48       3080100
2015-06-12  46.220001   46.470001   45.900002   45.970001   2346200
2015-06-11  46.66       46.919998   46.130001   46.439999   2718600
2015-06-10  45.790001   46.830002   45.689999   46.610001   2952300
2015-06-09  45.759998   45.939999   45.459999   45.650002   2412470
2015-06-08  46.299999   46.43       45.669998   45.73       1822300
2015-06-05  46.310001   46.52       45.84       46.139999   2558900
2015-06-04  46.790001   47.16       46.200001   46.360001   2668000
2015-06-03  47.369999   47.740002   46.82       46.849998   2755200
2015-06-02  46.93       47.349998   46.619999   46.919998   2123400
2015-06-01  47.060001   47.77       46.619999   47.23       2592900
2015-05-29  47.43       47.57       46.59       46.860001   3548100



why i tried opening above csv in jstock its showing error as "not correct format"

@ghost ghost changed the title How to add/import custom trading details in spreadsheet (csv) to jstock How to add/import custom trading details from spreadsheet (csv) to jstock Jun 19, 2015
@yccheok
Copy link
Owner

yccheok commented Jun 24, 2015

Import history data feature is not available yet.

@RandallSell
Copy link
Contributor

WARNING: this answer is a HACK and you are on your own if you mess up your data...

Having said that, almost all JStock data is stored in simple CSV files. Look under your "Documents and Settings" (XP) or Users (Vista, 7, etc) and eventually you will find a .JStock folder. A la [Documents-n-Settings][YourUsername].jstock\1.0.7....

Have a peek in there and it is fairly straight forward to sort out where the various bits are stored. As these as just simple CSV files you can edit them manually or use the ETL tool of your choice to automate it and do it on a repeatable fashion.

BUT BE CAREFUL! Some advise...

  1. Make note of the line ends. From my brief inspection I can't tell if the are CR or LF but it certainly isn't both (the windows standard). My guess is that they are the Unix standard whatever that is; either CR or LF.

  2. be sure that JStock is NOT running when you edit these directly. You would risk corrupting your data if JStock was running when you tinker with them directly.

  3. Look closely at your existing JStock data to understand how the data should be formatted, eg date formats, etc.

  4. And finally, and this should be obvious... DO A BACKUP BEFORE YOU START MUCKING AROUND!

Good luck,
-randall

@ghost
Copy link
Author

ghost commented Jun 25, 2015

@yccheok thanks for the quick reply and please consider this option in the next version.
@RandallSell I am not worried about the hack even if it caused any problem i can reinstall jstock. But i am using a ubuntu system and I dont know how to link the csv. from your hints i have tried this sofar

In ubuntu jstock has a hidden folder in the home directory home/.jstock and i am able to find out my stock details here home/.jstock/1.0.7/country_name/ and inside it has four folders databases, history, portfolios and watchlist. Inside watchlist folder there is another folder called "my watchlist" with a file realtimestock.csv. and inside "history" folder there are some csv file with filename similar to 3002w.LY B-start..csv and its content looks like this

code=3002w.LY               
symbol=My Industries                    
name=My Industries                  
board=Unknown                   
industry=Unknown                    
Date        Open    High    Low Close   Volume
Dec 29, 2014    17.6    18.55   17.6    17.1    1818580
Dec 30, 2014    17.9    18.35   17.75   17.9    2823011
Dec 31, 2014    17.95   18.1    17.1    17.15   2367274
...
...
...

My guess is that our watchlist pimary details are saved inside realtimestock.csv and historical data's inside "history" folder as a csv. But how to link realtimestock.csv to history/3002w.LY B-start..csv .

@RandallSell
Copy link
Contributor

Well, I guess my short answer is - you can't. there is no "inter-linking" of these CSVs. I was merely pointing out that the storage of the JStock data is fairly basic, meaning it can easily be manipulated/hacked by third party tools.

-randall

@ghost
Copy link
Author

ghost commented Jun 26, 2015

K thanks for the answer any way i will try to hack myself and let you know if succeeded :)

@ghost ghost closed this as completed Jun 26, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants