CCI strategy on OIL1HThis indicator is based on Commodity Channel Index.
It buys when CCI on period 200 is under -130 and it´s rising last 12 bars. It closes the position by hitting Take Profit, Stop Loss or opening short position.
It sells when CCI on period 200 is over 130 and it´s falling last 12 bars. It closes the position by hitting Take Profit, Stop Loss or opening short position.
This strategy seems to working just on USOIL on 1 hour chart. This can predict that it´s just luck and not proper strategy or indicator I would use for trading.
This script is just for educational purposes and that´s why the script is open. I will be happy if you will leave comment and try to come up with some ideas how to improve this strategy, so it can be used also on other commodities/forex pairs.
Strategytesting
Strategy VS Buy & HoldSUMMARY:
A strategy wrapper that makes a detailed and visual comparison between a given strategy and the buy & hold returns of the traded security.
DESCRIPTION:
TradingView has a "Buy & Hold Return" metric in the strategy tester that is often enough to assess how our strategy compares to a simple buy hold. However, one may want more information on how and when your strategy beats or is beaten by a simple buy & hold strategy. This script aims to show such detail by providing a more comprehensive metrics and charting the profit/loss of the given strategy against buy & hold.
As seen in the script, it plots/draws 4 elements:
1) Strategy P/L: strategy net profit + strategy open profit
2) Buy & Hold P/L: unrealized return
3) Difference: Strategy P/L - Buy & Hold P/L
4) Strategy vs Buy Hold Stats
> Percent of bars strategy P/L is above Buy & Hold
> Percent of bars strategy P/L is below Buy & Hold
> All Time Average Difference
ADJUSTABLE PARAMETERS:
All labels/panels can be disabled by unchecking these two options:
>bnh_info_panel = input(true, title='Enable Info Panel')
>bnh_indicator_panel = input(true, title='Enable Indicator Panel')
Comparison Date Range can be changed to better isolate specific areas:
>From Year, From Month, From Day
default: 1970 01 01
>To Year, To Month, To Day
default: 2050 12 31
Default settings basically covers all historical data.
HOW TO USE:
The default script contains a simple 50-200 SMA cross strategy, just delete and replace it. Those are everything between these lines:
/////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////STRATEGY SCRIPT START//////////////////////////////////
(STRATEGY SCRIPT GOES HERE)
//////////////////////////////STRATEGY SCRIPT END////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
Removing all plots and drawings from your strategy is advisable.
If you are going to use the Comparison Date Range, apply "bnh_timeCond" to your strategy to align the dates. A sample on how it’s applied can be seen on the Placeholder MA cross strategy.
Note: bnh_timeCond returns a boolean series
TradersAI_UTBotCREDITS to @HPotter for the orginal code.
CREDITS to @Yo_adriiiiaan for recently publishing the UT Bot study based on the original code -
I just added some simple code to turn it into a strategy. Now, anyone can simply add the strategy to their chart to see the backtesting results!
While @Yo_adriiiiaan mentions it works best on a 4-hour timeframe or above, I am happy to share that this seems to be working on a 15-minute chart on e-mini S&P 500 Index (using the KeyValue setting at 10)! You can play around with the different settings, and may be you might discover even better settings.
Hope this helps. Btw, if any of you play with different settings and discover great settings for a specific instrument, please share them with the community here - it will be rewarded back multiple times!
REAL STRATEGY : Dow_Factor_MFI/RSI_DVOG_StrategyI'm actually one of those who think it's more important to extract clues from indicators than strategy, but I wanted to test the data about the probability and dow factor I've shared for a long time.
Usually, Bitcoin is used as an eye stain for strategy success, since the graph has increased significantly from the beginning.
To prevent this, I used a commission and in the last lines of document I shared Bitmex's Bitcoin and Ethereum 1W test results.
I don't think there's a factor to repaint. ( Warn me if u see or observe )
I considered Bitcoin because I found working with liquid parities much more realistic.
Ethereum and Bitmex have been featured as a spot and may soon find a place at the CME , so I've evaluated the Ethereum .
But since the Ethereum Bitmex was also spot new, I deleted results that were less than 10 closed trades.
Since the Dow Theory also looks at the harmony in the indices, just try it in the Cryptocurrency market.
Use as indicator in other markets. Support with channels, trend lines with big periods and other supportive indicators.
And my personal suggestion : Use this script and indicator TF : 4H and above.
Specifications :
Commission. ( % 0.125 )
Switchable Methods ( Relative Strength Index / Money Flow Index )
Alarms. (Buy / Sell )
Position closure when horizontal market rates weighs.
Progressive gradual buy/sell alarms.
Clean code layout that will not cause repaint. (Caution : source = close )
Switchable barcolor option (I / 0 )
*****Test results :*****
drive.google.com
Summary:
It was a realistic test.
It has achieved great success in some markets, but as I mentioned earlier, use it only to gain insight into the price movements of cryptos.
Use as indicator in other markets.
This code is open source under the MIT license. If you have any improvements or corrections to suggest, please send me a pull request via the github repository : github.com
Stay tuned ! Noldo.