Reputation:
I can create strategy using built-in methods, like sma
or crossover
.
But can I create strategy which is using built-in indicator? Some like that:
obv = Indicators.OBV() // Trying to use built-in OBV indicator
obv_sma = sma(obv)
if (crossover(obv, obv_sma)) {
strategy.entry("OBV is high", strategy.long)
}
Upvotes: 1
Views: 1837
Reputation: 46
You can use "source input" feature, and select OBV in properties after adding it to chart.
obv = input(close, type=source)
instead of
obv = Indicators.OBV()
Blog post on feature https://blog.tradingview.com/en/new-feature-8211-apply-an-indicator-to-another-indicator-1844/
Upvotes: 3