EMA平均归还算法:短交易
我是Pine脚本的新手,并试图生成EMA卑鄙的归还算法。 条件如下 时间范围:10分钟, 时间9:15 AM至10:15.AM,否则没有条目
烛台应远离用户输入EMA(示例7ema)。
如果有多个蜡烛远离该EMA,而不是考虑那个蜡烛 最低的低。 非常靠近EMA)
如果最远的蜡烛的低点被破碎,则将很短。 10.15没有条目 拍摄。
SL应该是远离EMA的HH(最高)。
我是Pine脚本的新手
我只能绘制EMA。
还发现了蜡烛,它们远离EMA的蜡烛。
尚未决定退出条件
代码:
//@version=5
strategy("7ema", overlay=true)
ema_input=input.int(7,'EMA Length')
ema_=ta.ema(close,ema_input)
plot(ema_)
barcolor((close > ema_) and (low > ema_ or high < ema_) ? color.black : na)
I am very new to pine script and trying to generate an EMA mean reversion algo.
Conditions are as follows
TimeFrame: 10mins,
Time 9:15 a.m to 10:15.a.m otherwise no entry
Candle low should be far away and above from the user input EMA (example 7EMA).
If there are multiple candles far away from that EMA than consider that candle which has
farthest low.(Ambiguity: havenot decided how much far way the low should be but it should not be
very near to the EMA)If the low of that farthest candle is broken take short enrty,if time is > 10.15 no entry to be
taken.SL should be the HH(Highest high) of the candles which are away from the EMA.
As I am new to Pine Script
I have only been able to plot EMA.
Also found out the candles whose close and low are away from EMA.
Yet to decide the exit condition
Code:
//@version=5
strategy("7ema", overlay=true)
ema_input=input.int(7,'EMA Length')
ema_=ta.ema(close,ema_input)
plot(ema_)
barcolor((close > ema_) and (low > ema_ or high < ema_) ? color.black : na)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将不得不首先找到蜡烛第一次高于EMA的何时。然后,您必须检查EMA上方的每个连续的蜡烛,如果其低于以前的低点。如果低于先前的低点,则必须生成信号。
时间检查的基本部分。
我已经完成了没有 img src =“ https://i.sstatic.net/fth5r.png” alt =“ plot”>
You will have to first find when is the first time a candle is having low above ema. Then you have to check each successive candle above ema, if its low is above the previous low. If the low is below the previous low then you have to generate signal.
I have done a basic part of that without time checking etc. It will plot all such reversal like in this image