使用变量进行计算不起作用,但如果使用硬编码值则可以

发布于 2025-01-16 03:17:34 字数 555 浏览 1 评论 0原文

如果满足以下条件(示例),我想在图表上绘制一条线。

当使用“rangeLow”的变量输出(基于数学/计算)时,它不起作用

rangeLow = open-(open/100*25) // assuming open equals 40000, the result is 30000 per my math.
bool isSupport = open >= rangeLow  // throws no errors but lines not meeting the condition gets printed to chart.

当使用硬编码值时,它起作用

rangeLow = 30000
bool isSupport = open >= rangeLow     // works when printing a line to chart. Lines not meeting the condition dont get printed.

我做错了什么?

I want to plot a line to the chart if the following condition is met (example).

When using the variable output (based on math/calulation) from 'rangeLow' it doesnt work:

rangeLow = open-(open/100*25) // assuming open equals 40000, the result is 30000 per my math.
bool isSupport = open >= rangeLow  // throws no errors but lines not meeting the condition gets printed to chart.

When using a hardcoded value instead, it works.

rangeLow = 30000
bool isSupport = open >= rangeLow     // works when printing a line to chart. Lines not meeting the condition dont get printed.

What is it I am doing wrong?

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

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

发布评论

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