alert - 将 EMA 添加到警报查询
问题描述
对于比我有更多知识的人来说,这是一个快速解决方案。我已对 pinbar 发出警报,但我只希望它们显示它们是否高于 EMA20 线。
//Alert
aboveema = abs(close-open) > ema(close,20)
pinbarup = upshadow>body?prevc>pbody?(close[1]>open[1]?(body[1]>body?(high>high[1]?(upshadow>0.5*body?(upshadow>2*downshadow?1:0):0):0):0):0):0:0 and aboveema
alertcondition(pinbarup, title="PinbarUp", message="PinbarUp")
解决方案
您的代码应该已经这样做了,因为您在aboveema
条件结束时pinbarup
有条件。此版本在功能上是等效的,但用于and
加入您的条件,因此消除了对三元组的需要:
pinbarup = upshadow > body and prevc > pbody and close[1] > open[1] and body[1] > body and high > high[1] and upshadow > 0.5 * body and upshadow > 2 * downshadow and aboveema
推荐阅读
- c# - 可以将非静态类方法添加到 Dictionary 但不能使用集合初始化器
- python - 如何将一列中的值传播到其他列中的行(熊猫数据框)
- typescript - 从 firestore 使用 sendgrid 发送电子邮件
- plantuml - 如何使用 PlantUML 作为 java 项目提供输入并以图表形式获取代码
- substrate - chainlink external-initiator 不受支持的元数据版本 13
- ajax - 如何通过 Ajax 获取 django formset 错误?
- azure - Azure Devops 中的交换服务结构
- material-ui - Material v5.1.0 更新破坏了 mui+styled-engine 对 v5.0.2 的引用
- bash - git branch 命令可以作为 cli 命令正常工作,但在使用变量从循环或脚本运行时会失败
- python - 在python中绘制百分比的堆积条形图