trade_position_analysis_interface.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package data
  2. import "eta_gn/eta_task/models/data_manage"
  3. type TradePositionInterface interface {
  4. MultiInsertTradeBaseDataToTop(exchange, startDate, endDate string) (err error)
  5. GetTradePositionTopOriginDataTimes(exchange string) (dates []string, err error)
  6. GetTradePositionOriginClassifyCountByExchangeDataTime(exchange string, startDate, endDate string) (count int64, err error)
  7. GetFirstBaseFromTradeIndexByDate(exchange string) (item *data_manage.GetFirstBaseFromTradeIndeDate, err error)
  8. GetTradePositionOriginClassifyByExchangeDataTime(exchange, startDate, endDate string) (list []data_manage.TradePositionClassifyInfo, err error)
  9. MultiInsertTradeBaseDataToTopByClassify(exchange string, startDate, endDate string, classifyNames, classifyTypes []string) (err error)
  10. }
  11. type BaseTradePosition struct{}
  12. func (b *BaseTradePosition) MultiInsertTradeBaseDataToTop(exchange, startDate, endDate string) (err error) {
  13. err = data_manage.MultiInsertTradeBaseDataToTop(exchange, startDate, endDate)
  14. return
  15. }
  16. func (b *BaseTradePosition) GetTradePositionTopOriginDataTimes(exchange string) (dates []string, err error) {
  17. dates, err = data_manage.GetTradePositionTopOriginDataTimes(exchange)
  18. return
  19. }
  20. func (b *BaseTradePosition) GetTradePositionOriginClassifyCountByExchangeDataTime(exchange string, startDate, endDate string) (count int64, err error) {
  21. count, err = data_manage.GetTradePositionOriginClassifyCountByExchangeDataTime(exchange, startDate, endDate)
  22. return
  23. }
  24. func (b *BaseTradePosition) GetFirstBaseFromTradeIndexByDate(exchange string) (item *data_manage.GetFirstBaseFromTradeIndeDate, err error) {
  25. item, err = data_manage.GetFirstBaseFromTradeIndexByDate(exchange)
  26. return
  27. }
  28. func (b *BaseTradePosition) GetTradePositionOriginClassifyByExchangeDataTime(exchange, startDate, endDate string) (list []data_manage.TradePositionClassifyInfo, err error) {
  29. list, err = data_manage.GetTradePositionOriginClassifyByExchangeDataTime(exchange, startDate, endDate)
  30. return
  31. }
  32. func (b *BaseTradePosition) MultiInsertTradeBaseDataToTopByClassify(exchange string, startDate, endDate string, classifyNames, classifyTypes []string) (err error) {
  33. err = data_manage.MultiInsertTradeBaseDataToTopByClassify(exchange, startDate, endDate, classifyNames, classifyTypes)
  34. return
  35. }
  36. type GuangzhouTradePosition struct{}
  37. func (g *GuangzhouTradePosition) MultiInsertTradeBaseDataToTop(exchange, startDate, endDate string) (err error) {
  38. err = data_manage.MultiInsertTradeGuangzhouDataToTop(exchange, startDate, endDate)
  39. //查询出今日的value值
  40. return
  41. }
  42. func (g *GuangzhouTradePosition) GetTradePositionTopOriginDataTimes(exchange string) (dates []string, err error) {
  43. dates, err = data_manage.GetTradePositionTopOriginGuangzhouDataTimes(exchange)
  44. return
  45. }
  46. func (g *GuangzhouTradePosition) GetTradePositionOriginClassifyCountByExchangeDataTime(exchange string, startDate, endDate string) (count int64, err error) {
  47. count, err = data_manage.GetTradePositionOriginGuangzhouClassifyCountByExchangeDataTime(exchange, startDate, endDate)
  48. return
  49. }
  50. func (g *GuangzhouTradePosition) GetFirstBaseFromTradeIndexByDate(exchange string) (item *data_manage.GetFirstBaseFromTradeIndeDate, err error) {
  51. item, err = data_manage.GetFirstBaseFromTradeGuangzhouIndexByDate(exchange)
  52. return
  53. }
  54. func (g *GuangzhouTradePosition) GetTradePositionOriginClassifyByExchangeDataTime(exchange, startDate, endDate string) (list []data_manage.TradePositionClassifyInfo, err error) {
  55. list, err = data_manage.GetTradePositionOriginClassifyGuangzhouByExchangeDataTime(exchange, startDate, endDate)
  56. return
  57. }
  58. func (g *GuangzhouTradePosition) MultiInsertTradeBaseDataToTopByClassify(exchange string, startDate, endDate string, classifyNames, classifyTypes []string) (err error) {
  59. err = data_manage.MultiInsertTradeBaseDataToTopGuangzhouByClassify(exchange, startDate, endDate, classifyNames, classifyTypes)
  60. return
  61. }