LeafAlgo

The Flower - Multiple Strategy Options in One

LeafAlgo Cập nhật   
Strategy Overview
This strategy code currently includes four separate strategies to be used to either aid in discretionary trading or to be used algorithmically through the third-party system Profitview (profitview.app). Support for Pineconnector for use with MetaTrader 4 is in the works. The strategies have been designed with cryptocurrency trading in mind, however, the fundamentals apply to other assets.

The four strategies currently included are labeled “TSI Cross” (the default setting), “Oscillator Bands”, “Scalping”, and “McG/MA Cross”. Detailed information for each independent strategy can be found below, including sample settings configurations for each. A dropdown menu to select the strategy can be found under the “Strategy Options” set of settings under the Input tab of the strategy settings menu.
Additionally, the option to receive only long or short signals can be found alongside the Strategy Choice menu.

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 only visuals associated with the strategy are two McGinley Dynamic lines, red (slow length) and green (fast length). These are relevant to the McGinley Cross strategy, but can be used alongside the other strategies if desired.
When viewing the backtesting data in the TradingView Strategy Tester, ensure that “use bar magnifier” is activated. This option can be found in the Properties tab of the strategy settings menu.

Profitview 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. A sample of our Profitview syntax can be found below.

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.

Strategy Choices
As mentioned above, this strategy code contains four separate strategy options. A detailed breakdown of each follows below:

Total Strength Index (TSI) Cross
This strategy option is the default choice. The main signal involved in this strategy is a crossover or crossunder of the TSI value line and TSI signal line, however, there are a few other signals involved in the creation of a long or short entry. In addition to the TSI, the strategy includes an Average Directional Index (ADX) threshold value, Jurik Volatility Bands (JVB), a Stoch RSI threshold, and an oscillator of choice in conjunction with a threshold of 0. This oscillator choice can be selected under the “Signal Options” menu in the Input tab of the strategy settings. The default oscillator is the Detrended Price Oscillator (DPO), though the option for Chande Momentum (CMO) or Rate of Change (RoC) are both viable for this strategy.
Individual settings for these can be found in the Input tab under “Oscillator Settings” (TSI, Stoch RSI, DPO, CMO, ROC), “Band/Channel Settings” (Jurik Volatility Bands Length/Smoothing), and “Directional Settings” (ADX Smoothing Long, DI Length Short, ADX Threshold).

Sample settings for SOLUSDT using the 20M timeframe:
- Oscillator Settings -- DPO Length (21), DPO *not* centered, RSI (Stoch) Length (4), Stochastic Length (4), TSI Long Length (25), TSI Short Length (13), TSI Signal Length (13), K (3), D (3)
- Band/Channel Settings -- Jurik Volatility Bands Length (25), Jurik Volatility Bands Smoothing (5)
- Directional Settings – JVB Price Threshold (0), ADX Smoothing Long (5), DI Length Short (5), ADX Threshold (23)
- Take Profit/Stop Loss – 0.85% TP, 0.005% TTP, 1.3% SL

Oscillator Bands
This strategy involves the usage of bands or channels that use oscillators as a source input. The main signal for this strategy derives from a cross of the band or channel and a hline of 0. Additionally, this includes a “Directional Filter” and a “MA Filter”. The selections for all of these can be found in the “Signal Options” section of the Input tab.
First option is for Oscillator Choice and includes DPO, CMO, ROC, RSI, TSI, and the Jurik price line. The individual settings for these can be found in the “Oscillator Settings” section. Different channels can be selected for the upper or lower bands, though it is not necessary for them to differ. These current options include Bollinger Bands and Jurik Volatility Bands, the individual settings for each found in the “Band/Channel Settings” section. Next is the MA Filter, of which you can select SMA, EMA, SMMA, WMA, VWMA, KAMA, JMA, or McGinley Dynamic. All options for these settings can be found in the “MA Filter Settings” section. Lastly, the Directional Filters can be selected for either direction like the upper/lower band selection. These filters include the ADX, Bull-Bear Power (BBP), Parabolic SAR (PSAR), or Jurik.

Sample settings for WAVESUSDT using the 20M timeframe:
- Oscillator Choice – DPO (Length – 30, uncentered)
- Upper and Lower Band – JVB Upper/Lower (Jurik Volatility Bands Length – 25; Smoothing – 10)
- MA Filter – VWMA – (MA Length – 40; Source – Open)
- Directional Filter – ADX (ADX Smoothing Long – 14; DI Length Short – 5; ADX Threshold – 22)
- Take Profit/Stop Loss – 0.85% TP, 0.005% TTP, 1.3% SL


Scalping
This strategy heavily relies on the usage of Parabolic SAR, accompanied by a “Directional Filter” (as discussed in the previous section) other than PSAR. This strategy can provide a higher frequency of trades as opposed to the other strategies available, however, it comes with slightly higher risk inherently. A riskier take profit/stop loss spread is recommended here, though risk should always be managed. The settings required for this strategy are all found under the “Directional Settings” section of the strategy inputs.

Sample settings for NEARUSDT using the 20M timeframe:
- Directional Filter set to ADX
- Directional Settings – ADX Smoothing Long (5), DI Length Short (5), ADX Threshold (22), PSAR Start Value (0.02), PSAR Increment (0.005), PSAR Max Value (0.15), PSAR Source (Close)
- Take Profit/Stop Loss – 0.75% TP, 0.005% TTP, 1.5% SL

McGinley Cross
This strategy revolves around the crossing of two McGinley Dynamic lines of varying lengths alongside an ADX filter as well as a DPO filter. McGinley is used as opposed to a standard moving average cross strategy as it adjusts for shifts in market speed and can better gauge market trends. The McGinley length settings can be found with the “MA Filter” settings, labeled as Fast Length and Slow Length. The fast length number should be smaller than the slow length.

Sample settings for SOLUSDT using the 20M timeframe:
- Oscillator Settings – DPO Length (30), uncentered
- MA Filter Settings – McGinley Fast Length (4), McGinley Slow Length (21)
- Take Profit/Stop Loss – 0.85% TP, 0.005% TTP, 1.4% SL

Comprehensive Settings List
Date and Time: From date and to date, adjustable for backtesting purposes.

Signal Options:
Oscillator Choices: Chande Momentum Oscillator (CMO), Detrended Price Oscillator (DPO), Rate of Change (ROC), Relative Strength Index (RSI), True Strength Index (TSI), Jurik Volatility Bands Priceline (JVB) – *** for use with TSI Cross or Oscillator Bands strategies only ***
Upper and Lower Band/Channel Choices: Bollinger Bands (BB) or Jurik Volatility Bands (JVB) -- *** for use with Oscillator Bands strategy only ***
MA/McG Filter: SMA, EMA, RMA, WMA, VWMA, Kaufmann MA, Jurik MA, McGinley Dynamic -- *** for use with Oscillator Bands strategy only ***
Directional Filter Long/Short: Average Directional Index (ADX), Bull/Bear Power (BBP), Parabolic SAR (PSAR), Jurik -- *** for use with Oscillator Bands strategy only ***

Profitview Settings: *** For use with ProfitView extension only, otherwise ignore ***

Oscillator Settings: *** For use with TSI Cross, Oscillator Bands, and McGinley Cross strategies ***
CMO Length, CMO Source – for Chande Momentum Oscillator
DPO Length, DPO Centered – for Detrended Price Oscillator
RoC Length, RoC Source – for Rate of Change
RSI Length, RSI MA Length – for Relative Strength Index
RSI (Stoch) Length, Stochastic Length, Stoch RSI Source, K, D – for Stochastic RSI
TSI Long Length, TSI Short Length, TSI Signal Length – for True Strength Index

Band/Channel Settings: *** For use with Oscillator Bands strategy ***
Jurik Volatility Bands Length, Jurik Volatility Bands Smoothing – for Jurik Volatility Bands
Bollinger Band Length, Bollinger Band Multiplier – for Bollinger Bands

Directional Settings: *** For use with Scalping and Oscillator Bands strategies ***
JVB Price Threshold – for Jurik Volatility as a directional setting
ADX Smoothing Long, DI Length Short, ADX Threshold – for Average Directional Index
PSAR Start Value, PSAR Increment, PSAR Max Value, PSAR Source – for Parabolic SAR

MA Filter Settings: *** For use with Oscillator Bands and McGinley Cross strategies ***
McGinley Fast/Slow Length – for McGinley Dynamic
MA Length, MA Source, MA Offset – for any other moving average

TP and TTP / Stop Loss: *** For use with ALL strategies ***
Long/Short Take Profit % -- for standard take profit settings
Enable Trailing, Trailing Take Profit % -- for trailing settings
Stop Loss % -- for standard stop loss settings; trailing can be enabled or disabled for stop loss

Disclaimers:
Some open-source code has been included -- Jurik Volatility Bands (by "ProValueTrader") and Trailing Take Profit/Stop Loss code (by jason5480). Additional code was used from the TradingView built-ins.

These strategies do 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.

Invites to the strategy will only be disseminated to those with express consent and knowledge of the invite prior to the action itself.
Phát hành các Ghi chú:
Removed Jurik Moving Average option temporarily.
Phát hành các Ghi chú:
Removed some excess code.
Phát hành các Ghi chú:
-Updated stop loss code. Settings not include a trailing % stop loss, a trailing ATR stop loss, and a trailing atr take profit.
-The stop loss and take profit levels are now plotted on chart.
-Optimization of the take prfot/stop loss code
-New bar coloring added utilizing plotcandle() and data from our oscillator consesus tables.
-Added tool tips on different settings for clarity

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
Tập lệnh chỉ hiển thị cho người được mời

Quyền truy cập vào tập lệnh này bị hạn chế đối với người dùng được tác giả ủy quyền và thường yêu cầu thanh toán. Bạn có thể thêm nó vào mục yêu thích của mình, nhưng bạn sẽ chỉ có thể sử dụng nó sau khi yêu cầu sự cho phép từ tác giả. Liên hệ LeafAlgo để thêm thông tin, hoặc làm theo hướng dẫn của tác giả bên dưới.

TradingView không đề xuất trả tiền cho một tập lệnh và sử dụng cho đến khi bạn hoàn toàn tin tưởng tác giả và hiểu cách thức hoạt động của tập lệnh. Trong nhiều trường hợp, bạn có thể tìm thấy một giải pháp thay thế nguồn mở miễn phí trong Thư viện Công cộng của chúng tôi.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Hướng dẫn của tác giả

For access message directly for a 7 day trial, or for full access go to our website at leafalgo.com

Bạn muốn sử dụng tập lệnh này trên biểu đồ?

Cảnh báo: vui lòng đọc trước khi yêu cầu quyền truy cập.