获取连续n天上涨,上涨幅度大于某值得股票
/**
* 获取连续n天上涨,上涨幅度大于某值得股票
*
* @return
*/
public static String gatherNdaysPositive(int n, double fudu) {
// 获取股票代码表
BufferedReader br = null;
String filePath = "./data/code.csv";
StringBuffer bf = new StringBuffer();
try {
// br = new BufferedReader(new FileReader(filePath));
br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), Charset.forName("GBK")));
// 读取的每一行
String line = "";
// 临时保存切分的每一行
String[] temp = null;
// 读取每一行
int k = 0;
while ((line = br.readLine()) != null) {
temp = line.split(",");
String[][] data = getLatestInfoJson(n, temp[0]);
if (data != null) {
boolean flag = MathUtil.continuePositive(data);
if (flag) {
double nzhangfu = MathUtil.nzhangfu(data);
if (nzhangfu > fudu
&& (temp[0].startsWith("0") || temp[1].startsWith("6") || temp[0].startsWith("7"))) {
bf.append(k + ". " + "股票名