Skip to content

Commit

Permalink
Use Google Finance as alternative data feed for New Zealand stock mar…
Browse files Browse the repository at this point in the history
…ket.
  • Loading branch information
yccheok committed Dec 7, 2014
1 parent 2f660fb commit 802fbc4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Numbers in parentheses refer to SourceForge.net tracker item numbers (#XXXXX)
JStock 1.0.7s - 2014-xx-xx
Feature: Support Hungary currency.
Bugfix: Fix Korea stock market.

Bugfix: Use Google Finance as alternative data feed for New Zealand stock
market.

JStock 1.0.7r - 2014-07-06
Bugfix: Avoid 0 pricing when there is no internet connection.

Expand Down
1 change: 1 addition & 0 deletions src/org/yccheok/jstock/engine/Factories.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public int compare(StockServerFactory o1, StockServerFactory o2) {
malaysiaList.add(YahooStockServerFactory.newInstance());
netherlandsList.add(YahooStockServerFactory.newInstance());
newZealandList.add(YahooStockServerFactory.newInstance());
newZealandList.add(GoogleStockServerFactory.newInstance());
norwayList.add(YahooStockServerFactory.newInstance());
portugalList.add(YahooStockServerFactory.newInstance());
singaporeList.add(GoogleStockServerFactory.newInstance());
Expand Down
3 changes: 3 additions & 0 deletions src/org/yccheok/jstock/engine/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ public static String toGoogleFormat(Code code) {
return "SGX:" + string.substring(0, string_length - ".SI".length());
} else if (string.endsWith(".TW") && string_length > ".TW".length()) {
return "TPE:" + string.substring(0, string_length - ".TW".length());
} else if (string.endsWith(".NZ") && string_length > ".NZ".length()) {
return "NZE:" + string.substring(0, string_length - ".NZ".length());
}

return string;
Expand Down Expand Up @@ -883,6 +885,7 @@ public static Set<PriceSource> getSupportedPriceSources(Country country) {
toGoogleIndex.put("^ATX", "INDEXVIE:ATX");
toGoogleIndex.put("^FTSE", "INDEXFTSE:UKX");
toGoogleIndex.put("^TWII", "TPE:TAIEX");
toGoogleIndex.put("^NZ50", "NZE:NZ50G");

// TODO : Need revision. We no longer have primaryStockServerFactoryClasses
// concept. Going to replace with PriceSource.
Expand Down

0 comments on commit 802fbc4

Please sign in to comment.