sbd-npm 1.3.80 → 1.3.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +1 -0
- package/package.json +1 -1
- package/stock_basics.js +8 -8
package/constant.js
CHANGED
@@ -286,5 +286,6 @@ const IndexList = [
|
|
286
286
|
{'code': 'hsci', 'name': '恒生综合指数', 'is_industry': 1, 'is_key': 1},
|
287
287
|
{'code': 'hstech', 'name': '恒生科技指数', 'is_industry': 0, 'is_key': 1},
|
288
288
|
{'code': 'sp500', 'name': '标普500指数', 'is_industry': 1, 'is_key': 1},
|
289
|
+
{'code': 'ths_all_a', 'name': '同花顺全A指数', 'is_industry': 0, 'is_key': 0},
|
289
290
|
{'code': 'usdcnh', 'name': '美元离岸人民币汇率', 'is_industry': 0, 'is_key': 0},
|
290
291
|
];
|
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -1044,10 +1044,7 @@ let Stock = {
|
|
1044
1044
|
*/
|
1045
1045
|
fetch_margin: function () {
|
1046
1046
|
Stock["rzye_chart"] = Util.show_chart_loading(Stock["rzye_chart"], "rzye_line_canvas");
|
1047
|
-
let margin_url = "
|
1048
|
-
if (Util.is_sh(Stock["code"])) {
|
1049
|
-
margin_url = "http://www.sse.com.cn/market/othersdata/margin/detail/";
|
1050
|
-
}
|
1047
|
+
let margin_url = "https://data.10jqka.com.cn/market/rzrqgg/code/" + Stock["code"];
|
1051
1048
|
$("#margin_panel_title").html(Util.pack_html_link(margin_url, "[" + Stock.name + "]融资余额"));
|
1052
1049
|
let payload = {
|
1053
1050
|
action: "margin",
|
@@ -1058,7 +1055,9 @@ let Stock = {
|
|
1058
1055
|
Util.post("/stock/" + Stock["code"], payload, function (j) {
|
1059
1056
|
Stock["rzye_chart"].hideLoading();
|
1060
1057
|
let date_data = [], rzye_data = [], rqye_data = [], price_data = [], rqye_color_data = [], rzye_low = Number.MAX_SAFE_INTEGER, rzye_high = 0, rqye_low = Number.MAX_SAFE_INTEGER, rqye_high = 0;
|
1058
|
+
let latest_date = 0, margin_summary = "", rqye_summary = "";
|
1061
1059
|
j["data"].forEach(function (item) {
|
1060
|
+
latest_date = Math.max(latest_date, item["date"]);
|
1062
1061
|
date_data.push(Util.seconds_to_format(item["date"], "%Y-%m-%d"));
|
1063
1062
|
rzye_low = Math.min(rzye_low, item["rzye"]);
|
1064
1063
|
rzye_high = Math.max(rzye_high, item["rzye"]);
|
@@ -1069,7 +1068,8 @@ let Stock = {
|
|
1069
1068
|
price_data.push(item["price"]);
|
1070
1069
|
rqye_color_data.push("#E74C3C");
|
1071
1070
|
});
|
1072
|
-
|
1071
|
+
latest_date = Util.seconds_to_format(latest_date, "%Y-%m-%d");
|
1072
|
+
$("#stock_margin_url").attr("href", Util.get_url("trend_margin") + "?start_date=" + latest_date + "&end_date=" + latest_date);
|
1073
1073
|
if (j["latest"].length > 0) {
|
1074
1074
|
if (j["latest"].length === 1) {
|
1075
1075
|
margin_summary = " 最新融资余额(" + Util.seconds_to_format(j["latest"][0]["date"], "%Y-%m-%d") + "): " + Util.to_unit(j["latest"][0]["rzye"], 3);
|
@@ -1143,9 +1143,9 @@ let Stock = {
|
|
1143
1143
|
"head_cols": [
|
1144
1144
|
{"name": "日期", "class": "info", "table_sort": 1},
|
1145
1145
|
{"name": "融资余额", "table_sort": 1, "title": "本日融资余额 = 前日融资余额 + 本日融资买入额 - 本日融资偿还额"},
|
1146
|
-
{"name": "融资余额增值", "table_sort": 1, "title": "当天融资余额跟前一天融资余额的差值,即`本日融资买入额` - `本日融资偿还额`"},
|
1147
1146
|
{"name": "融资买入额", "table_sort": 1},
|
1148
1147
|
{"name": "融资偿还额", "table_sort": 1, "title": "本日融资偿还额 = 本日直接还款额 + 本日卖券还款额 + 本日融资强制平仓额 + 本日融资正权益调整 - 本日融资负权益调整"},
|
1148
|
+
{"name": "融资净买入", "table_sort": 1, "title": "本日融资买入额 - 本日融资偿还额"},
|
1149
1149
|
{"name": "融券余额", "table_sort": 1, "title": "本日融资融券余额 = 本日融资余额 + 本日融券余量金额"},
|
1150
1150
|
{"name": "融券余量", "table_sort": 1, "title": "本日融券余量 = 前日融券余量 + 本日融券卖出数量 - 本日融券偿还量"},
|
1151
1151
|
{"name": "收盘价", "table_sort": 1},
|
@@ -1158,6 +1158,8 @@ let Stock = {
|
|
1158
1158
|
_html.push("<tr>");
|
1159
1159
|
_html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1160
1160
|
_html.push("<td title='", item["rzye"], "' data-val='", item["rzye"], "'>", Util.to_unit(item["rzye"], 3), "</td>");
|
1161
|
+
_html.push("<td title='", item["rzmre"], "' data-val='", item["rzmre"], "'>", Util.to_unit(item["rzmre"], 3), "</td>");
|
1162
|
+
_html.push("<td title='", item["rzche"], "' data-val='", item["rzche"], "'>", Util.to_unit(item["rzche"], 3), "</td>");
|
1161
1163
|
let net_rzye = "--", gap_rzye = 0;
|
1162
1164
|
if (j["data"][index + 1] && j["data"][index + 1]["rzye"]) {
|
1163
1165
|
gap_rzye = item["rzye"] - j["data"][index + 1]["rzye"];
|
@@ -1168,8 +1170,6 @@ let Stock = {
|
|
1168
1170
|
}
|
1169
1171
|
}
|
1170
1172
|
_html.push("<td title='", gap_rzye, "' data-val='", gap_rzye, "'>", net_rzye, "</td>");
|
1171
|
-
_html.push("<td title='", item["rzmre"], "' data-val='", item["rzmre"], "'>", Util.to_unit(item["rzmre"], 3), "</td>");
|
1172
|
-
_html.push("<td title='", item["rzche"], "' data-val='", item["rzche"], "'>", Util.to_unit(item["rzche"], 3), "</td>");
|
1173
1173
|
_html.push("<td title='", item["rqye"], "' data-val='", item["rqye"], "'>", (item["rqye"] > 0 ? Util.to_unit(item["rqye"], 3) : "--"), "</td>");
|
1174
1174
|
_html.push("<td title='", item["rqyl"], "' data-val='", item["rqyl"], "'>", Util.to_unit(item["rqyl"], 3), "</td>");
|
1175
1175
|
let text_color = Util.text_color(item["p_change"]);
|