OBV MACD Indicator

5351 27
So this script is my improvement to macd that we all know . it faster and more accurate with less lag
first is based on OBV as it primary source
next we convert the OBV to MA style format , in this case we can add all form of MA in order to calculate it . as you will see in settimgs it has many type of MA as each beahave differently
I make the signal to be in linear form jst to make it more sharp/ and in the end in order to make the signal i use Alex grover method (this guy is a genius:) )
in final step we can make pivots point on our new for macd
end resolt is a faster more accurate MACD and much more options fro modification then the regular macd
this is volume indicator based so in some graph where volume does not exist this will not work
从常用的脚本中删除 添加到常用的脚本
I am trying to test it as a strategy, so with the following modifications:
- instead of the study line: strategy(shorttitle="Strat test", title=" Strategy test", overlay=false)
- at the end of the script:
if (up)
strategy.entry("Long 1", strategy.long)
if (down)
strategy.close("Long 1")
The issues is that the entry / close points of the strategy are not in line with the signals of the inital charts (the blue / red crosses), there is always a lag of two periods with the strategy... Would you know why ?
RafaelZioni remy0536
@remy0536, the step system has 1 candle lag.. in bactest you have 1 candle lag , so you get 2 candle lag in backtest.
one may change the signal from step to cross type (longer vs shorter length line) like in real macd then we can remove this lag..
HAlthoff9 remy0536
@remy0536, When i try to convert it into a strategy like you said, i get this: "Add to Chart operation failed, reason: line 266: mismatched input 'strategy.entry' expecting 'end of line without line continuation'".
Can you tell me whats the problem? Or even better copy your strategy code and publish? Thank you!!
remy0536 HAlthoff9
@HAlthoff9, the indentation is creating a problem sorry, this would work:

if (up)
strategy.entry("Long 1", strategy.long)

if (down)
strategy.close("Long 1")
remy0536 remy0536
looks like tab doesn't get applied... (before strategy.entry and strategy.close in principle)
rewrote in the strategy at 12 o’clock, managed to unscrew + 80.2% for 2019 with a drawdown of 27.47% sadness ...
+1 回复
RafaelZioni kirillkiselev82
@kirillkiselev82, it can be made better if we add filters to remove bad trades
Alerts available on this???
RafaelZioni alerttss2019
paste this to script end
/////// Alerts /////
alertcondition(piv ? na : shrt ? na : pivoth ? max_upper + 2 : na,title="resistance pivot")
alertcondition(piv ? na : shrt ? na : pivotl ? min_lower - 2 : na,title="support pivots")
首页 股票筛选器 外汇筛选器 加密货币筛选器 财经日历 剧集 如何运作 图表功能 价格 推荐朋友 网站规则 帮助中心 网站 & 经纪商解决方案 插件 图表解决方案 轻量图表库 博客 & 新闻 Twitter
概览 个人资料设置 账户和账单 推荐朋友 我的客服工单 帮助中心 已发表观点 粉丝 正在关注 私人消息 聊天 退出