accry

Acrypto - Weighted Strategy

accry 업데이트됨   
Hello 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 crossover

Moreover, 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 results

Best,
Alberto
릴리즈 노트:
How 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 - Binance

Trading type
* Longs: true
* Shorts: true

Datastamp
* Since 01/01/2021

Stop loss
* StopLoss: true
* Movestoploss: false
* Stop loss %: 6
* Move stop loss factor: -
* Stop source: hl2

Take 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: 15

Delays
* Candle delay: 1
* Candle delay Stoch RSI: 2
* Candle delay RSI: 2
* Candle delay exit: 7

Weights
* 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: high

Strategy 2: Stoch RSI
* Exit SRSI long: 70
* Exit SRSI short: 27
* default...

Strategy 3: RSI
* Exit RSI long: 77
* Exit RSI short: 30

Strategy 4: Supertrend
* ATR period: 2
* Source: hl2
* ATR multiplier: 2.4
* change ATR calculation method: true

Strategy 5: MA CROSS
* MA1: 50
* MA1 type: EMA
* MA1 source: close
* MA2: 88
* MA2 type: EMA
* MA source: close
릴리즈 노트:
Plots:

* 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.
릴리즈 노트:
Solve: typo
릴리즈 노트:
Update: typo
릴리즈 노트:
* Update default values to match example H4 BTC/USDT - Binance
* Choose the maximum number of Take Profits (TP) as suggested @aynetbt
릴리즈 노트:
Minor update:

* Add: buy/sell labels for possible reentries.
릴리즈 노트:
Update:
* 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.
릴리즈 노트:
Update:

* 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!
릴리즈 노트:
* 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,
Alberto

PS Thank you all for your kind words.

P.S. Thanks all for your kind words.
릴리즈 노트:
News!

* Add: New Stop-Loss (SL) strategy!
* Update: by default -> move stop loss to TP-2 and desactivate move stop loss to entry

Features:
* 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.
릴리즈 노트:
## 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.
릴리즈 노트:
## What's Changed
* Update: rename variables and include more delays
릴리즈 노트:
## What's Changed
* Update: minor bug
릴리즈 노트:
## What's Changed
* Add: basic basic editable alarm system
릴리즈 노트:
## What's Changed
* Solve: error top/bottom. Many thanks to @FFriZz for spotting it
릴리즈 노트:
## What's Changed
* Solve: error alarm labels thanks to @hugchri for spotting it!
릴리즈 노트:
## What's Changed
* Solve: close orders in only long/short mode. Many thanks to @kegesch for spotting it.
릴리즈 노트:
## What's Changed
* Solve: color warnings @thouravi
* Add: include different TP messages for long and short orders by @AlbertoCuadra
릴리즈 노트:
## What's Changed
* Update: default value of slow MA cross strategy
릴리즈 노트:
## What's Changed
* Add: flag to activate/desactive the shadows of the strategy as suggested @iammatty.
* Update: default fast MA Cross strategy

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?