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

Sorry I have had trouble getting the TradingView to point to the "Alerts" script instead of the "Backtest".

This is the Alerts part of this pair of Scripts. This part creates alerts to be picked up by the Chrome Add-on .
Jun 09
Phát hành các Ghi chú: Resolve 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.
Jun 17
Phát hành các Ghi chú: Update Docs, Redesigned TSL for easier reading

This is an implementation of a strategy based on two MA Ribbon, a Fast Ribbon and a Slow Ribbon. The strategy revolves around a pair of scripts: to generate alerts signals for Autoview and for Backtesting, to tune your settings.

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 - 0.3 for Binance.

Autoview alert syntax:
NOTE: This assumes you are trading coins BUY and SELL orders on the Binance Exchange
WARNING***Only use Autoview to automate a strategy after you've sufficiently backtested and forward tested the strategy.
You can learn more about the syntax here http://autoview.with.pink/#syntax and you can watch this video here: https://www.youtube.com/watch?v=epN5Tjinuxw
  • For the trade opens you will want to trigger BUY orders on LONGS (eg ETHBTC) with alert option "Once Per Bar Close" and SELL orders on SHORTS (eg BTCUSDT)
    > b=buy q=0.0011 e=binance s=ethbtc u=currency t=market ( LONG )
    > or b=sell q=0.0011 e=binance s=btcusdt t=market ( SHORT )
  • For the trade closes you will want to trigger these alerts on condition with alert option "Once Per Bar" to get the quickest close. "Once per Bar Close" can also be used. (NOTE: with Renko you can only use "Once Per Bar Close" option)
    > b=sell q=99% e=binance s=ethbtc t=market ( CLOSE LONGS )
    > or b=buy q=99% e=binance s=btcusdt u=currency t=market ( CLOSE SHORTS )
NOTE: Most of my testing was conducted on Renko Charts, I do not have any optimised settings for normal Candlestick charts, I have left that for fellow Traders to discover.
Gỡ bỏ khỏi Script Ưa thích Thêm vào Script Ưa thích

Bình luận

@JustUncleL, thanks for sharing! Question - with the only option to trigger alerts Once Per Bar Close, when using renko chart, the alert can sometimes be triggered 20 mins after the Buy marker shows up on the brick. In other words it will trigger on the next brick after the Buy marker. As a result, the price can change significantly between the Buy signal (marker on the brick) and the Alert.
Also, as you can see, with Once Per Bar Close - there could be 5 more renko bricks on the same minute between the Buy Signal (marker on chart) and the Alert fired. As a result again, the price can be significantly different than the Buy Signal on chart. Besides entry/exit price differences, the List of Trades in the strategy mode and the Strategy Performance in general when you tune you MAs parameters will never be close to the reality when you are going to trade realtime. The strategy can give you a very nice gain % but you could never enter/exit at the same prices which can make the strategy a losing one in real trading.
Just wanted to ask for your opinion on this, how you've worked around it.

And another thing - on 1m timeframe, TradingView only gives you about 1 week of actual 1min data (10,000 bars of 1min tf), after that it becomes 1h type of data injected into your strategy in backtest if you look in List of Trades you will see all entries/exits at round hours instead of of on a 1min timeframe. So the parameters you tune in your MAs really gives you result as if you are trading on 1h timeframe.
Knowing how there is an issue with alerts to enter/exit at the chart prices on 1min timeframe at Once Per Bar Close, trading on 1h timeframe becomes completely impossible as the price will change so much there is no more momentum to trade.
With that in mind, how do you really tune your MAs on 1min timeframe if you cannot really test in 1min time frame due to TradingView limit of 10,000 bars?

Appreciate your thoughts on this. Thanks!
Phản hồi
JustUncleL btrades77
@btrades77, A lot of what you are saying is to do with the nature of how Renko bricks are built by TradingView and cannot be altered. For me Backtesting itself has never been that accurate and so results only provide a guide to possible good setups. As Backtesting script is for tuning purposes only, you should not care about the real time data, you can increase Renko history by using by using higher timeframe upto 5mins, to keep good Renko accuracy I would not recommend going much higher than that. Then for the Trading Alert script you go back to 1min timeframe Renko Bricks.

There is nothing stopping you using this script with normal candles, this will then get away from some of the Renko building issues and possibly give you faster Entries and Exits. However, if you want non-repainting trading then the Entry must still use "Once Per Bar Close" alerts, but the Exits can use "Once per Bar" alerts.
Phản hồi
btrades77 JustUncleL
@JustUncleL, have you ever used ribbons on regular candles without renko? It gives zero profitability or close to no matter what parameters you put into MAs.
Wondering if you did you it on regular candles if you were able to achieve profits similar to when using on renko candles.

thanks a lot for your replies!
Phản hồi
JustUncleL btrades77
@btrades77, I did not test the script much with normal candles and so don't have any recommended settings. Don't forget Backtesting is only giving you tuning settings, not accurate results. I recommend some forward testing on Demo account with the better settings indicated by Backtesting and use "Once Per Bar" on exits.

I have not looked at this script for some time, these pair of scripts were really made to show how to convert a normal alerting script into a AutoView/ProfitView Trading script and provide a means for tuning.
Phản hồi
btrades77 JustUncleL
@JustUncleL, got it, thanks!
Phản hồi
JustUncleL btrades77
@btrades77, I have been looking at these scripts recently, to see if I can improve them so they may trade better with standard candles. Sometimes just a small change or a new option/filter can make a difference, so I would welcome any suggestions.
Phản hồi
btrades77 JustUncleL
@JustUncleL, I am trying to make it work on regular candles. So far no luck in terms of %. But this is the better direction.
Phản hồi
Hi Such a shame the buy/sell does not trigger alarms in TV... Any one who can fix it ?
Phản hồi
@Kirk65, I had no problem during testing, I will retest. In the meantime you could try it without the

and (barstate.isconfirmed or barstate.ishistory)

clause on lines 365 and 366.
Phản hồi
Kirk65 JustUncleL
@JustUncleL, do you mean just comment line 365 and 366 or delete barstate.isconfirmed or barstate.ishistory
Phản hồi
Trang chủ Bộ lọc cổ phiếu Bộ lọc Forex Bộ lọc Tiền điện tử Lịch kinh tế Cách thức hoạt động Tính năng Biểu đồ Trả phí Giới thiệu bạn Quy tắc Áp dụng Trung tâm Trợ giúp Giải pháp cho Website & Nhà môi giới Widget Giải pháp biểu đồ Thư viện Biểu đồ Lightweight Blog & Tin tức Twitter
Hồ sơ Tùy chỉnh Hồ sơ Tài khoản và Thanh toán Giới thiệu bạn Ticket Hỗ trợ của tôi Trung tâm Trợ giúp Các ý tưởng đã đăng Người theo dõi Đang theo dõi Tin nhắn riêng Trò chuyện Đăng xuất