tools

package
v0.0.0-...-d94b88f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockDownload

func BlockDownload() error

BlockDownload 下载blck数据

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	err := tools.BlockDownload()
	if err != nil {
		log.Fatal(err)
	}

}
Output:

block_ths.zip

func IPOToday

func IPOToday() ([]map[string]any, error)

IPOToday 当日可申请IPO

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	results, err := tools.IPOToday()
	if err != nil {
		log.Fatal(err)
	}

	for _, result := range results {
		log.Println(result)
	}
	log.Println("条数:", len(results))

}
Output:

[]

func IPOWait

func IPOWait() ([]map[string]any, error)

IPOWait 等待申请IPO

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	results, err := tools.IPOWait()
	if err != nil {
		log.Fatal(err)
	}

	for _, result := range results {
		log.Println(result)
	}
	log.Println("条数:", len(results))

}
Output:

2022/07/31 11:43:18 map[exchange:STAR industry_name:医疗器械 industry_ttm:34.77 issue_count:10000.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787271 order_date:20220810 order_limit_up:1.0000 pre_issue_info:[] stock_code:688271 stock_name:联影医疗 success_date:20220812 success_rate: top_order:10.0000]
2022/07/31 11:43:18 map[exchange:S industry_name:化学制品 industry_ttm:19.33 issue_count:2500.0000 issue_pe_static:22.99 issue_pe_ttm:21.0043 issue_price:17.7700 listing_date: market_id:33 order_code:001231 order_date:20220809 order_limit_up:1.0000 pre_issue_info:[map[price:17.7700 ttm:22.98]] stock_code:001231 stock_name:农心科技 success_date:20220811 success_rate: top_order:10.0000]
2022/07/31 11:43:18 map[exchange:H industry_name:化学制品 industry_ttm:19.33 issue_count:3336.6667 issue_pe_static:22.99 issue_pe_ttm:21.5426 issue_price:21.8800 listing_date: market_id:17 order_code:732255 order_date:20220809 order_limit_up:1.3000 pre_issue_info:[map[price:21.8800 ttm:22.99]] stock_code:603255 stock_name:鼎际得 success_date:20220811 success_rate: top_order:13.0000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:传媒 industry_ttm:27.64 issue_count:7550.1745 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:301171 order_date:20220808 order_limit_up:1.4000 pre_issue_info:[] stock_code:301171 stock_name:易点天下 success_date:20220810 success_rate: top_order:14.0000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:计算机设备 industry_ttm:27.66 issue_count:3712.3013 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:301330 order_date:20220808 order_limit_up:0.9000 pre_issue_info:[] stock_code:301330 stock_name:熵基科技 success_date:20220810 success_rate: top_order:9.0000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:半导体及元件 industry_ttm:27.66 issue_count:3333.3600 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787401 order_date:20220808 order_limit_up:0.8500 pre_issue_info:[] stock_code:688401 stock_name:路维光电 success_date:20220810 success_rate: top_order:8.5000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:半导体及元件 industry_ttm:27.66 issue_count:16697.0656 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787403 order_date:20220808 order_limit_up:2.3000 pre_issue_info:[] stock_code:688403 stock_name:汇成股份 success_date:20220810 success_rate: top_order:23.0000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:化工合成材料 industry_ttm:19.33 issue_count:1605.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:301300 order_date:20220805 order_limit_up:0.4500 pre_issue_info:[] stock_code:301300 stock_name:远翔新材 success_date:20220809 success_rate: top_order:4.5000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:化工合成材料 industry_ttm:11.53 issue_count:5066.9517 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787203 order_date:20220805 order_limit_up:1.4000 pre_issue_info:[] stock_code:688203 stock_name:海正生材 success_date:20220809 success_rate: top_order:14.0000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:计算机应用 industry_ttm:44.99 issue_count:3928.6667 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787292 order_date:20220805 order_limit_up:1.0000 pre_issue_info:[] stock_code:688292 stock_name:浩瀚深度 success_date:20220809 success_rate: top_order:10.0000]
2022/07/31 11:43:18 map[exchange:S industry_name:计算机设备 industry_ttm:27.66 issue_count:6175.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:001339 order_date:20220804 order_limit_up:2.4500 pre_issue_info:[map[price:16.8600 ttm:22.99]] stock_code:001339 stock_name:智微智能 success_date:20220808 success_rate: top_order:24.5000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:自动化设备 industry_ttm:34.77 issue_count:1900.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:301338 order_date:20220804 order_limit_up:0.4500 pre_issue_info:[] stock_code:301338 stock_name:凯格精机 success_date:20220808 success_rate: top_order:4.5000]
2022/07/31 11:43:18 map[exchange:S industry_name:家用轻工 industry_ttm:36.21 issue_count:3410.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:33 order_code:001222 order_date:20220803 order_limit_up:1.3500 pre_issue_info:[map[price:13.7100 ttm:14.73]] stock_code:001222 stock_name:源飞宠物 success_date:20220805 success_rate: top_order:13.5000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:计算机设备 industry_ttm:27.66 issue_count:30000.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787041 order_date:20220803 order_limit_up:4.2000 pre_issue_info:[] stock_code:688041 stock_name:海光信息 success_date:20220805 success_rate: top_order:42.0000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:家用轻工 industry_ttm:26.48 issue_count:1000.0000 issue_pe_static: issue_pe_ttm:22.5406 issue_price:37.5300 listing_date: market_id:33 order_code:301336 order_date:20220802 order_limit_up:1.0000 pre_issue_info:[] stock_code:301336 stock_name:趣睡科技 success_date:20220804 success_rate: top_order:10.0000]
2022/07/31 11:43:18 map[exchange:STAR industry_name:医疗器械 industry_ttm:34.77 issue_count:2500.0000 issue_pe_static: issue_pe_ttm: issue_price: listing_date: market_id:17 order_code:787273 order_date:20220802 order_limit_up:0.6000 pre_issue_info:[] stock_code:688273 stock_name:麦澜德 success_date:20220804 success_rate: top_order:6.0000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:半导体及元件 industry_ttm:27.66 issue_count:3687.0000 issue_pe_static:45.71 issue_pe_ttm:37.5953 issue_price:26.8000 listing_date: market_id:33 order_code:301132 order_date:20220801 order_limit_up:1.0500 pre_issue_info:[] stock_code:301132 stock_name:满坤科技 success_date:20220803 success_rate: top_order:10.5000]
2022/07/31 11:43:18 map[exchange:GEM industry_name:消费电子 industry_ttm:27.66 issue_count:1736.0000 issue_pe_static:32.38 issue_pe_ttm:35.2542 issue_price:64.6800 listing_date: market_id:33 order_code:301318 order_date:20220801 order_limit_up:0.4500 pre_issue_info:[] stock_code:301318 stock_name:维海德 success_date:20220803 success_rate: top_order:4.5000]
2022/07/31 11:43:18 条数: 18

func JYCurrentYearAllTradeDate

func JYCurrentYearAllTradeDate() ([]string, error)

JYCurrentYearAllTradeDate 获取本年所有交易日

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	results, err := tools.JYCurrentYearAllTradeDate()
	if err != nil {
		log.Fatal(err)
	}

	for _, result := range results {
		log.Println(result)
	}
	log.Println("条数:", len(results))

}
Output:

2022/07/31 11:47:28 20220104
2022/07/31 11:47:28 20220105
2022/07/31 11:47:28 20220106
2022/07/31 11:47:28 20220107
2022/07/31 11:47:28 20220110
2022/07/31 11:47:28 20220111
2022/07/31 11:47:28 20220112
2022/07/31 11:47:28 20220113
2022/07/31 11:47:28 20220114
2022/07/31 11:47:28 20220117
2022/07/31 11:47:28 20220118
2022/07/31 11:47:28 20220119
2022/07/31 11:47:28 20220120
2022/07/31 11:47:28 20220121
2022/07/31 11:47:28 20220124
2022/07/31 11:47:28 20220125
2022/07/31 11:47:28 20220126
2022/07/31 11:47:28 20220127
2022/07/31 11:47:28 20220128
2022/07/31 11:47:28 20220207
2022/07/31 11:47:28 20220208
2022/07/31 11:47:28 20220209
2022/07/31 11:47:28 20220210
2022/07/31 11:47:28 20220211
2022/07/31 11:47:28 20220214
2022/07/31 11:47:28 20220215
2022/07/31 11:47:28 20220216
2022/07/31 11:47:28 20220217
2022/07/31 11:47:28 20220218
2022/07/31 11:47:28 20220221
2022/07/31 11:47:28 20220222
2022/07/31 11:47:28 20220223
2022/07/31 11:47:28 20220224
2022/07/31 11:47:28 20220225
2022/07/31 11:47:28 20220228
2022/07/31 11:47:28 20220301
2022/07/31 11:47:28 20220302
2022/07/31 11:47:28 20220303
2022/07/31 11:47:28 20220304
2022/07/31 11:47:28 20220307
2022/07/31 11:47:28 20220308
2022/07/31 11:47:28 20220309
2022/07/31 11:47:28 20220310
2022/07/31 11:47:28 20220311
2022/07/31 11:47:28 20220314
2022/07/31 11:47:28 20220315
2022/07/31 11:47:28 20220316
2022/07/31 11:47:28 20220317
2022/07/31 11:47:28 20220318
2022/07/31 11:47:28 20220321
2022/07/31 11:47:28 20220322
2022/07/31 11:47:28 20220323
2022/07/31 11:47:28 20220324
2022/07/31 11:47:28 20220325
2022/07/31 11:47:28 20220328
2022/07/31 11:47:28 20220329
2022/07/31 11:47:28 20220330
2022/07/31 11:47:28 20220331
2022/07/31 11:47:28 20220401
2022/07/31 11:47:28 20220406
2022/07/31 11:47:28 20220407
2022/07/31 11:47:28 20220408
2022/07/31 11:47:28 20220411
2022/07/31 11:47:28 20220412
2022/07/31 11:47:28 20220413
2022/07/31 11:47:28 20220414
2022/07/31 11:47:28 20220415
2022/07/31 11:47:28 20220418
2022/07/31 11:47:28 20220419
2022/07/31 11:47:28 20220420
2022/07/31 11:47:28 20220421
2022/07/31 11:47:28 20220422
2022/07/31 11:47:28 20220425
2022/07/31 11:47:28 20220426
2022/07/31 11:47:28 20220427
2022/07/31 11:47:28 20220428
2022/07/31 11:47:28 20220429
2022/07/31 11:47:28 20220505
2022/07/31 11:47:28 20220506
2022/07/31 11:47:28 20220509
2022/07/31 11:47:28 20220510
2022/07/31 11:47:28 20220511
2022/07/31 11:47:28 20220512
2022/07/31 11:47:28 20220513
2022/07/31 11:47:28 20220516
2022/07/31 11:47:28 20220517
2022/07/31 11:47:28 20220518
2022/07/31 11:47:28 20220519
2022/07/31 11:47:28 20220520
2022/07/31 11:47:28 20220523
2022/07/31 11:47:28 20220524
2022/07/31 11:47:28 20220525
2022/07/31 11:47:28 20220526
2022/07/31 11:47:28 20220527
2022/07/31 11:47:28 20220530
2022/07/31 11:47:28 20220531
2022/07/31 11:47:28 20220601
2022/07/31 11:47:28 20220602
2022/07/31 11:47:28 20220606
2022/07/31 11:47:28 20220607
2022/07/31 11:47:28 20220608
2022/07/31 11:47:28 20220609
2022/07/31 11:47:28 20220610
2022/07/31 11:47:28 20220613
2022/07/31 11:47:28 20220614
2022/07/31 11:47:28 20220615
2022/07/31 11:47:28 20220616
2022/07/31 11:47:28 20220617
2022/07/31 11:47:28 20220620
2022/07/31 11:47:28 20220621
2022/07/31 11:47:28 20220622
2022/07/31 11:47:28 20220623
2022/07/31 11:47:28 20220624
2022/07/31 11:47:28 20220627
2022/07/31 11:47:28 20220628
2022/07/31 11:47:28 20220629
2022/07/31 11:47:28 20220630
2022/07/31 11:47:28 20220701
2022/07/31 11:47:28 20220704
2022/07/31 11:47:28 20220705
2022/07/31 11:47:28 20220706
2022/07/31 11:47:28 20220707
2022/07/31 11:47:28 20220708
2022/07/31 11:47:28 20220711
2022/07/31 11:47:28 20220712
2022/07/31 11:47:28 20220713
2022/07/31 11:47:28 20220714
2022/07/31 11:47:28 20220715
2022/07/31 11:47:28 20220718
2022/07/31 11:47:28 20220719
2022/07/31 11:47:28 20220720
2022/07/31 11:47:28 20220721
2022/07/31 11:47:28 20220722
2022/07/31 11:47:28 20220725
2022/07/31 11:47:28 20220726
2022/07/31 11:47:28 20220727
2022/07/31 11:47:28 20220728
2022/07/31 11:47:28 20220729
2022/07/31 11:47:28 20220801
2022/07/31 11:47:28 20220802
2022/07/31 11:47:28 20220803
2022/07/31 11:47:28 20220804
2022/07/31 11:47:28 20220805
2022/07/31 11:47:28 20220808
2022/07/31 11:47:28 20220809
2022/07/31 11:47:28 20220810
2022/07/31 11:47:28 20220811
2022/07/31 11:47:28 20220812
2022/07/31 11:47:28 20220815
2022/07/31 11:47:28 20220816
2022/07/31 11:47:28 20220817
2022/07/31 11:47:28 20220818
2022/07/31 11:47:28 20220819
2022/07/31 11:47:28 20220822
2022/07/31 11:47:28 20220823
2022/07/31 11:47:28 20220824
2022/07/31 11:47:28 20220825
2022/07/31 11:47:28 20220826
2022/07/31 11:47:28 20220829
2022/07/31 11:47:28 20220830
2022/07/31 11:47:28 20220831
2022/07/31 11:47:28 20220901
2022/07/31 11:47:28 20220902
2022/07/31 11:47:28 20220905
2022/07/31 11:47:28 20220906
2022/07/31 11:47:28 20220907
2022/07/31 11:47:28 20220908
2022/07/31 11:47:28 20220909
2022/07/31 11:47:28 20220913
2022/07/31 11:47:28 20220914
2022/07/31 11:47:28 20220915
2022/07/31 11:47:28 20220916
2022/07/31 11:47:28 20220919
2022/07/31 11:47:28 20220920
2022/07/31 11:47:28 20220921
2022/07/31 11:47:28 20220922
2022/07/31 11:47:28 20220923
2022/07/31 11:47:28 20220926
2022/07/31 11:47:28 20220927
2022/07/31 11:47:28 20220928
2022/07/31 11:47:28 20220929
2022/07/31 11:47:28 20220930
2022/07/31 11:47:28 20221010
2022/07/31 11:47:28 20221011
2022/07/31 11:47:28 20221012
2022/07/31 11:47:28 20221013
2022/07/31 11:47:28 20221014
2022/07/31 11:47:28 20221017
2022/07/31 11:47:28 20221018
2022/07/31 11:47:28 20221019
2022/07/31 11:47:28 20221020
2022/07/31 11:47:28 20221021
2022/07/31 11:47:28 20221024
2022/07/31 11:47:28 20221025
2022/07/31 11:47:28 20221026
2022/07/31 11:47:28 20221027
2022/07/31 11:47:28 20221028
2022/07/31 11:47:28 20221031
2022/07/31 11:47:28 20221101
2022/07/31 11:47:28 20221102
2022/07/31 11:47:28 20221103
2022/07/31 11:47:28 20221104
2022/07/31 11:47:28 20221107
2022/07/31 11:47:28 20221108
2022/07/31 11:47:28 20221109
2022/07/31 11:47:28 20221110
2022/07/31 11:47:28 20221111
2022/07/31 11:47:28 20221114
2022/07/31 11:47:28 20221115
2022/07/31 11:47:28 20221116
2022/07/31 11:47:28 20221117
2022/07/31 11:47:28 20221118
2022/07/31 11:47:28 20221121
2022/07/31 11:47:28 20221122
2022/07/31 11:47:28 20221123
2022/07/31 11:47:28 20221124
2022/07/31 11:47:28 20221125
2022/07/31 11:47:28 20221128
2022/07/31 11:47:28 20221129
2022/07/31 11:47:28 20221130
2022/07/31 11:47:28 20221201
2022/07/31 11:47:28 20221202
2022/07/31 11:47:28 20221205
2022/07/31 11:47:28 20221206
2022/07/31 11:47:28 20221207
2022/07/31 11:47:28 20221208
2022/07/31 11:47:28 20221209
2022/07/31 11:47:28 20221212
2022/07/31 11:47:28 20221213
2022/07/31 11:47:28 20221214
2022/07/31 11:47:28 20221215
2022/07/31 11:47:28 20221216
2022/07/31 11:47:28 20221219
2022/07/31 11:47:28 20221220
2022/07/31 11:47:28 20221221
2022/07/31 11:47:28 20221222
2022/07/31 11:47:28 20221223
2022/07/31 11:47:28 20221226
2022/07/31 11:47:28 20221227
2022/07/31 11:47:28 20221228
2022/07/31 11:47:28 20221229
2022/07/31 11:47:28 20221230
2022/07/31 11:47:28 条数: 242

func RandInstance

func RandInstance(n int) string

RandInstance 生成随机instance

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	instance := tools.RandInstance(8)

	log.Println("Instance:", instance)

}
Output:

2022/07/31 11:49:44 Instance: 74978410

func TodayTrend

func TodayTrend() (bool, error)

TodayTrend 当日是否交易日

Example
package main

import (
	"github.com/bensema/ths_quote/tools"
	"log"
)

func main() {
	b, err := tools.TodayTrend()
	if err != nil {
		log.Fatal(err)
	}

	if b {
		log.Println("交易日")
	} else {
		log.Println("非交易日")

	}

}
Output:

2022/07/31 11:46:02 非交易日

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL