LeafAlgo

Double Alligator x Donchian Cloud Strategy

This strategy is based on two sets of Williams Alligator indicators, taking crossovers and crossunders of the two pairs of lips as the main entry signal with confluence from the Donchian Cloud. The first Alligator used is set to the standard 13/8/5 lengths found in the standard indicator. The second Alligator is multiplied tenfold (10x) to 130/80/50 with the offset values also being multiplied. This second set is colored yellow, aqua, and purple for the jaw, teeth, and lips, respectively. A strategy similar to a moving average crossover can be created using these sets of Alligator indicators. While there are 6 lines in total, and can be used for discretionary matters outside of the strategy entry/exits, a cross of the lip pairs seems to yield the most optimal results. As a filter for these signals, we have introduced our Donchian Cloud Score code.

The Donchian Cloud Score is derived from a set of 5 Donchian channels (upper, lower, and basis plotted) defaulted to lengths of 25, 50, 100, 150, and 200. A set of conditions associated with the channels aims to determine ranging versus trending markets. Weights are given to these conditions accordingly, then tallied up to determine the "cloud score", ranging between -25 and 25. In general, a ranging market is determined by a cloud score between -10 and 10, while a positive trending market has a score higher than 10 and a negative trending market has a score lower than -10. That said, long and short thresholds similar to the macro score itself are included in the user settings and set to a default of 3 or -3. Trade frequency will increase the closer these numbers are to zero, however, the stronger (yet infrequent) signals come with values approaching +/- 10 or greater. The cloud score is plotted as a line in the underlay with coloration reflecting ranging or trending markets (green color above the long threshold, gray between the thresholds, and red below the short threshold). The cloud score is incorporated into the strategy syntax for long and short positions in that the score must be above or below the set threshold for a trade to be placed. A breakdown for the Donchian scoring is as follows:
- Broke the 25-length DC (DC(25)) upper band in the previous 3 bars - +1 if true, 0 if false
- Broke the DC(50) upper band in the previous 3 bars - +2 if true, 0 if false
- Broke the DC(100) upper band in the previous 3 bars - +3 if true, 0 if false
- Broke the DC(150) upper band in the previous 3 bars - +4 if true, 0 if false
- Broke the DC(200) upper band in the previous 3 bars - +5 if true, 0 if false

- Broke the DC(25) lower band in the previous 3 bars - -1 if true, 0 if false
- Broke the DC(50) lower band in the previous 3 bars - -2 if true, 0 if false
- Broke the DC(100) lower band in the previous 3 bars - -3 if true, 0 if false
- Broke the DC(150) lower band in the previous 3 bars - -4 if true, 0 if false
- Broke the DC(200) lower band in the previous 3 bars - -5 if true, 0 if false

- DC(25) basis line above the DC(50) basis line - +1 if true, -1 if false
- DC(25) basis line above the DC(100) basis line - +1 if true, -1 if false
- DC(25)basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(25) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(100) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(50) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(100) basis line above the DC(150) basis line - +1 if true, -1 if false
- DC(100) basis line above the DC(200) basis line - +1 if true, -1 if false
- DC(150) basis line above the DC(200) basis line - +1 if true, -1 if false

Take profit, stop loss, and trailing percentages are also included, found at the bottom of the Input tab under “TT and TTP” as well as “Stop Loss”. Make sure to understand the TP/SL ratio that you desire before use, as the desired hit rate/profitability percentage will be affected accordingly. The option for adding in a trailing stop has also been included, with options to choose between an ATR-based trail or a percentage-based trail. This strategy does NOT guarantee future returns. Apply caution in trading regardless of discretionary or algorithmic. Understand the concepts of risk/reward and the intricacies of each strategy choice before utilizing them in your personal trading.

Profitview/Pineconnector Settings:
If you wish to utilize Profitview’s automation system, find the included “Profitview Settings” under the Input tab of the strategy settings menu. If not, skip this section entirely as it can be left blank. Options will be “OPEN LONG TITLE”, “OPEN SHORT TITLE”, “CLOSE LONG TITLE”, and “CLOSE SHORT TITLE”. If you wished to trade SOL, for example, you would put “SOL LONG”, “SOL SHORT”, “SOL CLOSE LONG”, and “SOL CLOSE SHORT” in these areas. Within your Profitview extension, ensure that your Alerts all match these titles. To set an alert for use with Profitview, go to the “Alerts” tab in TradingView, then create an alert. Make sure that your desired asset and timeframe are currently displayed on your screen when creating the alert. Under the “Condition” option of the alert, select the strategy, then select the expiration time. If using TradingView Premium, this can be open-ended. Otherwise, select your desired expiration time and date. This can be updated whenever desired to ensure the strategy does not expire. Under “Alert actions”, nothing necessarily needs to be selected unless so desired. Leave the “Alert name” option empty. For the “Message”, delete the generated message and replace it with {{strategy.order.alert_message}} and nothing else. If using Pineconnector, follow the same directions for setting up an alert, but use the ",buy,,risk=" syntax as noted in the tooltips.

Take your trading to new heights with LeafAlgo Premium Indicators and Strategies. Use code SSMS4MGK at checkout for a 50% discount on your first purchase at www.LeafAlgo.com !

Join our Discord community today!
www.discord.gg/rNQ2QW59Pn
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmıştır ve özgürce kullanabilirsiniz. Bir grafikte kullanmak için favorilerinize ekleyebilirsiniz. Kaynak kodunu görüntüleyemez veya değiştiremezsiniz.
Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?