Twin Range Filter Algo

OrcChieftain Telah dikemas kini   
@Colinmck used two different ranges to generate signals. Read his release notes to find out what the original script does.

I added one condition which seems to increase performance on 15m BTCUSD as well as 1h BTCUSD and that is ATR with 32 periods being smaller than ATR with 64 periods. I used my script Volatility Optimiser to discover this tendency.

Both buying and selling conditions are same as in @Colinmck's script plus one condition of my own. You can disable my condition.

Target and stop-loss are manually set values in ticks.

Time stop-loss is manually set value in a number of candles. After this number of candles, a position always exits (or should 😇). You can disable it by inserting a very long period. I do not recommend it, because a value of indicator should not be measured in luck and if market starts moving in the direction after 40 periods, the predictive capability of an indicator is questionable.

I used 300/150/17 for 15m BTCUSD chart and 900/30/17 for 1h BTCUSD. I didn't try to optimize any other parameters for these periods.

Since this script relies mostly on volatility for its prediction, I wouldn't recommend using it on its own. Individual approach to the market is recommended. Also, it didn't work on EURUSD when using the same default values and different order management (tp, sl, time sl), so it is probably not as versatile.

Let me know what do you think of this strategy. If you have some ideas about how to make it more reliable, share it in the comments, I might put it to the test. Good luck 🍀

Nota Keluaran:
► A problem with the position opening and closing at the exact same price at the exact time should be fixed. This was one of my first scripts back when I was learning the basics, it's hard to believe some people actually liked it as it was.
► I added some basic stop-loss and profit settings to the strategy that I add to my buyerss' scripts. It will add some consistency to the strategy without restricting it too much. The previous version had fixed profit and loss too, but its definition was a static number of ticks. The strategy uses dynamic calculation, but a static option is available too.

Target calculation example - option "Close + ATR(len) * %":
Average True Range is calculated for the Length number of candles.
• Above range is multiplied by the percentage. If you want to double it, input 200. If you want to quadruple it, use 400. To half, use 50...
• The result is added to the close price of the candle which was used for entry.
• A set number of ticks is added to the result.
• Algorithm will reverse the process for Short positions.

Stop calculation example - option "Low - (close - lowest low(len)) * %":
• The lowest low in the Length number of bars is subtracted from the closing price of the entry candle.
• This value is multiplied by a percentage. If you want to double the value, set the percentage to 200. If you want to half it, set it to 50.
• The result is subtracted from the entry candle's low. After that, a set number of ticks is subtracted from the result.
• The process is reversed for calculating a stop for Short positions.
Nota Keluaran:
Alerts added - sellect the indicator, choose create an alert, choose "alert() function calls only" in the first dropdown menu.
Please let me know if it works, I didn't test it.

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.


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?