OBV MACD Indicator

3802 25
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
Remove from Favorite Scripts Add to Favorite Scripts
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!!
rewrote in the strategy at 12 o’clock, managed to unscrew + 80.2% for 2019 with a drawdown of 27.47% sadness ...
+1 Reply
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")
@RafaelZioni, thank you very much for this great indicator! It is really quite helpful, and I have set alerts for this script. Would the alerts fire on the "up" or "down" after there is a change from the previous red or blue? Thanks, again.
+1 Reply
I found your indicator but when I opened it I didn't see any curve.
How does that curve appear on the tradingview chart? Thanks Pro
@longdt, it work only on chart that has volume inside as it a volume indicator
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out