You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0 KiB

  1. package com.deepchart.service.impl;
  2. import com.deepchart.entity.StockDailyData;
  3. import com.deepchart.entity.StockInfo;
  4. import com.deepchart.service.IndexService;
  5. import com.deepchart.utils.CCIUtil;
  6. import com.deepchart.utils.MACDUtil;
  7. import com.deepchart.utils.MAUtil;
  8. import com.deepchart.utils.StockDataUtil;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import java.util.List;
  12. @Service
  13. public class IndexServiceImpl implements IndexService {
  14. @Autowired
  15. private StockDataUtil stockDataUtil;
  16. @Override
  17. public List<StockDailyData> getStockData(StockInfo stock) {
  18. return stockDataUtil.getStockData(stock);
  19. }
  20. @Override
  21. public String macd(List<StockDailyData> list) {
  22. return MACDUtil.analyzeStock(list);
  23. }
  24. @Override
  25. public String ma(List<StockDailyData> list) {
  26. return MAUtil.analyzeMA(list);
  27. }
  28. @Override
  29. public String cci(List<StockDailyData> list) {
  30. return CCIUtil.analyzeCCI(list);
  31. }
  32. }