Acrypto - Weighted Strategy by accry

By QuantNomad

Performance Metrics

Description

Feb 11, 2022Hello traders!I have been developing a fully customizable algo over the last year. The algorithm is based on a set of different strategies, each with its own weight (weighted strategy). The set of strategies that I currently use are 5: MACD Stochastic RSI RSI Supertrend MA crossoverMoreover, the algo includes STOP losses criteria and a taking profit strategy. The algo must be optimized for the desired asset to achieves its full potential. The 1H and 4H dataframe give good results. The algo has been tested for several asset (same dataframe, different optimization values).Important note:Backtest the algorithm with different data stamps to avoid overfitting resultsBest,AlbertoFeb 12, 2022Release NotesHow it works:The algorithm is based on a combination of well-documented indicators. First, the algorithm calculated the weight_strategy, which represents a value from 0 to 5 of the number of strategies that are fulfilled (in case the weight of each strategy is the same). To open a position, the value of weight_strategy must be greater than the value of weight_signal, by default 2. Modify the indicator parameters for the desired asset and data frame. Set stop-loss and take profit criteria.Features:* The algorithm allows to trade with long, short or both positions.* Backtest the algorithm over a defined interval (data stamp), e.g., from 01/01/2021* Set stoploss (SL) orders based on a percentage of the previous candle source, e.g., close or hl2 (high + low)/2. Only close the position after the candle is close!* It can moves the stoploss every time the algo takes profit (TP)* Take profit based on a percentage of the open position. It is possible to define different values ​​for short positions. Define the percentage of TP to close from the open position.* Define delays to evaluate the strategies of more previous candles: + Candle Delay is for MACD strategy + Candle delay Stoch RSI is for the Stochastic RSI strategy. + RSI Candle Delay is for the RSI strategy. + Candle delay Exit is the number of candles the algorithm waits to open a new position.* Choose if you want to use the weighted strategy or just some of them.* Choose the weight (relevance) of each strategy.* Customize the well-documented MACD strategy.* Customize the well-documented Stochastic RSI strategy.* Customize the well-documented RSI strategy.* Customize the well-documented Supertrend strategy.* Customize the well documented MA cross strategy.Example 4H BTC/USDT - BinanceTrading type* Longs: true* Shorts: trueDatastamp* Since 01/01/2021Stop loss* StopLoss: true* Movestoploss: false* Stop loss %: 6* Move stop loss factor: -* Stop source: hl2Take profit* Take profits: true* Long - take profit each x (%): 6.8* Long- take from open position: 15* Short - take profit each x (%): 13* Short - take from open position: 15Delays* Candle delay: 1* Candle delay Stoch RSI: 2* Candle delay RSI: 2* Candle delay exit: 7Weights* Default (same weights and at least 2 strategies must be satisfied)Strategy 1: MACD* MA1: 16* MA1 type: EMA* MA1 source: hl2* MA2: 36* MA2 type: EMA* MA source: highStrategy 2: Stoch RSI* Exit SRSI long: 70* Exit SRSI short: 27* default...Strategy 3: RSI* Exit RSI long: 77* Exit RSI short: 30Strategy 4: Supertrend* ATR period: 2* Source: hl2* ATR multiplier: 2.4* change ATR calculation method: trueStrategy 5: MA CROSS* MA1: 50* MA1 type: EMA* MA1 source: close* MA2: 88* MA2 type: EMA* MA source: closeFeb 12, 2022Release NotesPlots:* The color-trend represents when at least one of the strategies is satisfied, long in teal and short in gray and there is not a draw, same number of strategies satisfies for long and short.* The + represent the next Take Profit (TP) target in teal and the Stop-Loss (SL) in gray.* Plot labels for every time each strategy satisfies to open a long/short position* Detect potential TOP and BOTTOMS based on a combination of RSI, Stoch RSI, MACD, volume, and the weighted-strategy.Feb 12, 2022Release NotesSolve: typoFeb 12, 2022Release NotesUpdate: typoFeb 14, 2022Release Notes* Update default values to match example H4 BTC/USDT - Binance* Choose the maximum number of Take Profits (TP) as suggested @aynetbtFeb 16, 2022Release NotesMinor update:* Add: buy/sell labels for possible reentries. Feb 16, 2022Release NotesUpdate:* Add: Stop position in case the algo detects a potential Top/Bottom. - It can close a specific percentage of the remaining open long position. - It can close a specific percentage of the remaining open short position. Feb 17, 2022Release NotesUpdate:* Add: monthly table performance. All the credits to @QuantNomad. I have only changed some colors and also adapted the calculations to the last previous candle. The purpose of this change is to make this script compatible with this weighted strategy. Thanks again to QuantNomad for this amazing script!Feb 17, 2022Release Notes* With this monthly performance, we can see that the algo has performed very well over the past two years, capturing the trend very accurately. However, from 2017 to 2019, the algorithm can't even make a profit! This is a disclaimer. Best,AlbertoPS Thank you all for your kind words.P.S. Thanks all for your kind words.Feb 20, 2022Release NotesNews!* Add: New Stop-Loss (SL) strategy!* Update: by default -> move stop loss to TP-2 and desactivate move stop loss to entryFeatures: * Set SL to previous TP targets * Set SL to the average position (after TP) Examples: * Set TP-2 and move SL to entry is desactivated: this implies that if you are in TP3 the SL will correspond with the previous TP1. However, if you are in TP2 the SL will not change, because there is not a TP0. * Set TP-2 and move SL to entry is activated: same as before, but now in TP2 the SL will move to the average entry position.Mar 1, 2022Release Notes## What's Changed- Solve: error TP same bar. Thanks to @aynetbt for letting me know.- Solve: error TP-TOP, TP-BOTTOM when the percentage was smaller than 100. I was always closing the entire trade, not a percentage.- Add: includes TP-TOP and TP-BOTTOM limit orders based on the previous candle with the TOP/BOTTOM label.The patch for TPs will only work if you have enabled the "After is filled" option in the properties tab. Due to the intra-bar calculation, you can have multiple TPs in the same order. This setting is desactivated by default.Mar 2, 2022Release Notes## What's Changed* Update: rename variables and include more delaysMar 2, 2022Release Notes## What's Changed* Update: minor bugMar 8, 2022Release Notes## What's Changed* Add: basic basic editable alarm systemMar 8, 2022Release Notes## What's Changed* Solve: error top/bottom. Many thanks to FFriZz for spotting itMar 25, 2022Release Notes## What's Changed* Solve: error alarm labels thanks to hugchri for spotting it!Apr 9, 2022Release Notes## What's Changed* Solve: close orders in only long/short mode. Many thanks to kegesch for spotting it.Apr 10, 2022Release Notes## What's Changed* Solve: color warnings @thouravi* Add: include different TP messages for long and short orders by @AlbertoCuadraApr 13, 2022Release Notes## What's Changed* Update: default value of slow MA cross strategyApr 23, 2022Release Notes## What's Changed* Add: flag to activate/desactive the shadows of the strategy as suggested @iammatty.* Update: default fast MA Cross strategy

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView