OPEN-SOURCE SCRIPT
已更新 [Autoview][BackTest]Dual MA Ribbons R0.12 by JustUncleL

This is an implementation of a strategy based on two MA Ribbons, a Fast Ribbon and a Slow Ribbon. This strategy can be used on Normal candlestick charts or Renko charts (if you are familiar with them).
The strategy revolves around a pair of scripts: One to generate alerts signals for Autoview and one for Backtesting, to tune your settings.
The risk management options are performed within the script to set SL(StopLoss), TP(TargetProfit), TSL(Trailing Stop Loss) and TTP (Trailing Target Profit). The only requirement for Autoview is to Buy and Sell as directed by this script, no complicated syntax is required.
The Dual Ribbons are designed to capture the inferred behavior of traders and investors by using two groups of averages:
> Traders MA Ribbon: Lower MA and Upper MA (Aqua=Uptrend, Blue=downtrend, Gray=Neutral), with center line Avg MA (Orange dotted line).
> Investors MAs Ribbon: Lower MA and Upper MA (Green=Uptrend, Red=downtrend, Gray=Neutral), with center line Avg MA (Fuchsia dotted line).
> Anchor time frame (0=current). This is the time frame that the MAs are calculated for. This way 60m MA Ribbons can be viewed on a 15 min chart to establish tighter Stop Loss conditions.
Trade Management options:
Trade Management Indication:
Dealing With Renko Charts:
The strategy revolves around a pair of scripts: One to generate alerts signals for Autoview and one for Backtesting, to tune your settings.
The risk management options are performed within the script to set SL(StopLoss), TP(TargetProfit), TSL(Trailing Stop Loss) and TTP (Trailing Target Profit). The only requirement for Autoview is to Buy and Sell as directed by this script, no complicated syntax is required.
The Dual Ribbons are designed to capture the inferred behavior of traders and investors by using two groups of averages:
> Traders MA Ribbon: Lower MA and Upper MA (Aqua=Uptrend, Blue=downtrend, Gray=Neutral), with center line Avg MA (Orange dotted line).
> Investors MAs Ribbon: Lower MA and Upper MA (Green=Uptrend, Red=downtrend, Gray=Neutral), with center line Avg MA (Fuchsia dotted line).
> Anchor time frame (0=current). This is the time frame that the MAs are calculated for. This way 60m MA Ribbons can be viewed on a 15 min chart to establish tighter Stop Loss conditions.
Trade Management options:
- Option to specify Backtest start and end time.
- Trailing Stop, with Activate Level (as % of price) and Trailing Stop (as % of price)
- Target Profit Level, (as % of price)
- Stop Loss Level, (as % of price)
- BUY green triangles and SELL dark red triangles
- Trade Order closed colour coded Label:
- >> Dark Red = Stop Loss Hit
- >> Green = Target Profit Hit
- >> Purple = Trailing Stop Hit
- >> Orange = Opposite (Sell) Order Close
Trade Management Indication:
- Trailing Stop Activate Price = Blue dotted line
- Trailing Stop Price = Fuschia solid stepping line
- Target Profit Price = Lime '+' line
- Stop Loss Price = Red '+' line
Dealing With Renko Charts:
- If you choose to use Renko charts, make sure you have enabled the "IS This a RENKO Chart" option, (I have not so far found a way to Detect the type of chart that is running).
- If you want non-repainting Renko charts you MUST use TRADITIONAL Renko Bricks. This type of brick is fixed and will not change size.
- Also use Renko bricks with WICKS DISABLED. Wicks are not part of Renko, the whole idea of using Renko bricks is not to see the wick noise.
- Set you chart Time Frame to the lowest possible one that will build enough bricks to give a reasonable history, start at 1min TimeFrame. Renko bricks are not dependent on time, they represent a movement in price. But the chart candlestick data is used to create the bricks, so lower TF gives more accurate Brick creation.
- You want to size your bricks to 2/1000 of the pair price, so for ETHBTC the price is say 0.0805 then your Renko Brick size should be about 2*0.0805/1000 = 0.0002 (round up).
- You may find there is some slippage in value, but this can be accounted for in the Backtest by setting your commission a bit higher, for Binance for example I use 0.2%
Special thanks goes to CryptoRox for providing the initial Risk management Framework in his "How to automate this strategy for free using a chrome extension" example.
版本注释
Resolve some Issues- Resolve issue with Orange Close alerts not showing up in the TradingView alarm notifications when using Candlestick Charts.
- Resolve issue with multiple Long/Short signals before Close by better use of the "tradeState" engine to keep control. This also made some of the Risk Management Code simpler.
版本注释
Update Docs, Redesigned TSL for easier readingTrade Management options:
- Option to specify a Strategy start and end time [BackTest] script only.
- Trailing Stop Level, TSL (as % of price), activated on open trade
- Target Profit Level, TP (as % of price)
- Trailing Profit Level, TTP (as % of price below/above TP), activated on price passing TP Level
- Stop Loss Level, SL (as % of price)
- LONG green triangles and SHORT dark red triangles
Trade Order closed colour coded Labels:
> Dark Red = Stop Loss Hit
> Green = Target Profit Hit
> Purple = Trailing Stop Hit
> Orange = Opposite (Sell) Order Close
Trade Management Indication:
- TSL = Fuschia solid stepping line
- TP = Lime '+' line
- TTP = Black solid stepping Line.
- SL = Red '+' line
Dealing With Renko Charts:
- If you choose to use Renko charts, make sure you have enabled the "IS This a RENKO Chart" option, (I have not so far found a way to Detect the type of chart is running).
- If you want non-repainting Renko charts you MUST use TRADITIONAL Renko Bricks. This type of brick is fixed and will not change size.
- Also use Renko bricks with WICKS DISABLED. Wicks are not part of Renko, the whole idea of using Renko bricks is not to see the wick noise.
- Set you chart Time Frame to the lowest possible one that will build enough bricks to give a reasonable history, start at 1min TimeFrame. Renko bricks are not dependent on time, they represent a movement in price. But the chart candlestick data is used to create the bricks, so lower TF gives more accurate Brick creation.
- You want to size your bricks to divide the pair price by 500, so for ETHBTC the price is say 0.0805 then your Renko Brick size should be about 0.0805/500 = 0.0002 (round up).
- You may find there is some slippage in value, but this can be accounted for in the Backtest by setting your commission a bit higher, for example I use 0.2 or 0.3 for Binance.
NOTE: Most of my testing was conducted on Renko Charts, I do not have any optimized settings for normal Candlestick charts, I have left that for fellow Traders to discover.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
JustUncleL
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
JustUncleL
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。