package link.at17.mid.tushare.test;

import java.util.List;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import link.at17.mid.tushare.dao.StockDailyDao;
import link.at17.mid.tushare.data.models.CostDistribution;
import link.at17.mid.tushare.data.models.StockValueEx;
import link.at17.mid.tushare.data.util.Indicators;
import lombok.extern.slf4j.Slf4j;

@SpringBootTest
@Slf4j
class CostDistributionTest {

    @Autowired
    StockDailyDao stockDailyDao;
    
    @Test
    void contextLoads() {
    }
    
    @Test
    void testCalcCost() {
        List<StockValueEx> values = stockDailyDao.getExQfqDailyBefore("000812.SZ", null, 300L);
        CostDistribution cd = Indicators.getCostDistribution(values, 299, 150, 120);
        log.info("{}", cd);
    }
}
