通达信、东方财富神奇九转指标计算公式,代码实现

同花顺神奇九转指标计算公式可以参考:https://stockapi.com.cn

@Slf4j
@Service
public class NineTurnServiceImpl extends StockServiceParent implements NineTurnServiceService {
   

	@Override
    public Result nineTurn(String code, String date) {
   
        String key = "nineTurn:" + code + date;
        Object strOjb = redisTemplate.opsForValue().get(key);
        Map<String, Object> obj = null;
        if (ObjectUtil.isNull(strOjb)) {
   
            LocalDate endDate = LocalDate.parse(date, ISO_DATE);
            LocalDate startDate = endDate.minusDays(30);
            Result day = day(code, startDate.toString(), endDate.toString());
            Map<String, Object> data = (Map) day.getData();
            Result result = nineTurnCalculateService.doCalculate(data, code, date);
            if (ObjectUtil.isNotNull(result)) {
   
                obj = (Map<String, Object>) result.getData();
                setRedisValue(key, obj);
            }
        } else {
   
            obj = 

你可能感兴趣的:(股票基金数据接口,java,spring,boot,开发语言)