我该如何让这个酒吧在Python工作?

发布于 2025-02-04 11:05:19 字数 731 浏览 1 评论 0原文

我正在尝试将Ceyhun的指示底部从TradingView转换为Python。 我被卡住了吧台线。其中之一就是这样,

per = input(14, title="Bottom Period")
loc = low < lowest(low[1], per) and low <= lowest(low[per], per)
bottom = barssince(loc)

到目前为止,我在python中有这个,

bottomPeriod = 14
data['counter'] = data.index.where(data.loc[data.index[-1], "low"] < min(data["low"][(-bottomPeriod-1):-1]) and data.loc[data.index[-1], "low"] <= min(data["low"][(-bottomPeriod*2-1):(-bottomPeriod-1)]))
data['counter'].fillna(method="ffill",inplace=True)
data['Rows_since_condition'] = data.index-data['counter']
data.drop(['counter'], axis=1,inplace=True)

我无法在工作中获得。我几乎要开始在数据集上迭代,但这是一个很大的数据集,需要快速运行。任何帮助都非常感谢

I'm trying to convert indicator Top Bottom by ceyhun from tradingview to python.
I am stuck converting the barssince lines. One of them is like this

per = input(14, title="Bottom Period")
loc = low < lowest(low[1], per) and low <= lowest(low[per], per)
bottom = barssince(loc)

So far I have this in python

bottomPeriod = 14
data['counter'] = data.index.where(data.loc[data.index[-1], "low"] < min(data["low"][(-bottomPeriod-1):-1]) and data.loc[data.index[-1], "low"] <= min(data["low"][(-bottomPeriod*2-1):(-bottomPeriod-1)]))
data['counter'].fillna(method="ffill",inplace=True)
data['Rows_since_condition'] = data.index-data['counter']
data.drop(['counter'], axis=1,inplace=True)

I can't get the where to work. I'm almost about to start iterating over the dataset but it is a big one and needs to run fast. Any help is much appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文