本文介绍了如何在股票数据的收盘价中找到V的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我要绘制数据数组,我可以看到V何时出现.我希望我的程序使用股票的收盘价来查找何时出现V.怎么办呢?
If i were to plot the array of data i could see when the V occurs. I would like my program to find when a V occurs using minuteclose price of stock. How can this be done ?
谢谢
推荐答案您正在寻找局部最小值.您需要做的就是保留最后一个值,并保留有关库存是否最后增加的标志.如果它正在减少(标志为假),但是新值更高 比您之前的价格要低.如果价格在增加(标志为true),但新价格较低,则您已达到本地最高价. You are looking for a local minimum. All you should need to do is keep the last value, and keep a bool flag of whether the stock was last increasing. If it was decreasing (flag is false), but the new value is higher than your previous price, you have a minimum. If it was increasing (flag is true) but the new price is lower, then you have hit a local maximum.
更多推荐
如何在股票数据的收盘价中找到V
发布评论