sonnyparlin

OBV MA Strategy

sonnyparlin Telah dikemas kini   
The On Balance Volume + Moving Average Strategy

Parameters: 1H candles, ETHUSDT on BINANCEUS, commission percent uses Binance's maker/taker fees of 0.075%
Strategy: I create a 30 day moving average of the On Balance Volume "obvSma = ta.sma(ta.obv, 30)." Then I use the following buy conditions:

  • OBV crosses above the OBV moving average
  • The obv drops x% below the OBV moving average (buy a dip)
  • The OBV moving average is rising, the OBV is greater than the OBV moving average and the OBV is rising

The first buy condition is attempting to buy into an uptrend. When the OBV rises above the OBV moving average, people are buying and it's a good time to enter the trade.
The idea behind the second buy condition is to buy a dip so make sure you are careful to not set it too shallow or you'll end up buying the dip before the dip before the dip. :) I recommend 10% or more.
The third buy condition is there in case our trailing stop takes us out of a trade but the trend is still rising, we don't want to miss out on that profit so if the OBV is above the OBV moving average, the average is rising and the OBV is rising, we are likely in the middle of an uptrend and we should buy in.
Nota Keluaran:
Changed some default parameters for the chart and also updated a variable name to be more clear.

`takeProfit` is now `activation`

I initially called it takeProfit because I tend to keep my trailing stop loss very tight so that if the candle hits the activation level but then starts to fall, the trailing stop will activate. The downside of this is that you end up missing opportunities, but overall, you see much more profit with a tighter trailing stop. The trick is to set your activation level to where you're happy taking profit. Setting it too low produces less profit, setting it too high wins you less trades. I tend to keep my activation level anywhere between 0.5% and 2% depending on the asset.
Nota Keluaran:
Added user configurable moving average length for the OBV moving average.
Nota Keluaran:
Removed
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?