JustUncleL

[Autoview][BackTest]Dual MA Ribbons R0.12 by JustUncleL

JustUncleL Wizard 已更新   
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:
  • 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 reading

Trade Management options:

  • Option to specify a Strategy start and end time 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.

JustUncleL
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?