Chfif

Trend trader + STC [CHFIF] - CV

Chfif 已更新   
This script is my first strategy script coupling the Trend trader (indicator developed by Andrew Abraham in the Trading the Trend article of TASC September 1998.) and Schaff Trend Cycle . The STC indicator is widely used to identify trends and their directions. It is sometimes used by traders to predict trend reversals as well. Based on the movement of the Schaff Trend Cycle , buy or sell signals are generated, which are then used by traders to initiate either long or short positions.

Around I built a user interface to help you in creating a customized strategy to your need.

My idea behind doing this was to make customizable parameters and back testing easier than manually with a lot of flexibility and options. More possibility we have, more solutions we find right? So I started this script few weeks ago to be my first script (second in reality, but first to be published.)

Strategy it self is made out of 2 simple step:
1→ STC gives a Buy/Sell signal.
2→Price is closing above the TT (Buy) or below (Sell) and the signal is the same as given by the STC .

To complete your strategy in order to reach the best result, I added few options:
→ Money management: Define the type of risk you want to take (entry risk will always risk the same percentage of your portfolio disregarding the size of the SL, Fix amount of money, fix amount of the capital (portfolio). NOTE: Margin is not coded yet, target is to show liquidation price. Please keep an eye on the releases to know when it is released.
→ Stop loss and Take profit management: Define the type of target you want to use (ATR, fixed percentage, pivots points) and even customise different take profit level or activate the trailing. Each type of target is customizable via the menu
→ Moving average: You can also complete the strategy using different moving average. To draw it tick the box on the left, to use it in the calculation of the result, tick the box "Price>MA" in front of the needed EMA . You can select different type of MA ( SMA , EMA , DEMA , TEMA , RMA, HMA , WMA , VWAP , VWMA , etc...)
→ RSI: 4 possible approach to use the RSI to complement the strategy:
• OB/OS => short position will be taken only if RSI goes under the lower limit. Long if the RSI goes above the limit. Ticking confirmation will wait to cross back the limit to validate the condition
• Rev OB/OS => Short will be taken if RSI is below lower limit and stays below. Long will be taken if RSI is above upper limit and stays above.
• MA dominance => RSI has to be above MA for long, below for short. Confirmation box ticked requires 2 bars with the RSI on a side to validate signal.
• MA Dominance + limit => It is a combination of the requirement of the provious option and also Rev. OB/OS
→ Volume confirmation => This will consider the volume MA for entry confirmation. The volume will have to be above the MA define by the value entered in the field.
→ Waddah Attar explosion indicator can also be used as a filter for entries in this way:
• Explosion line > dead zone to validate entries
• Trend > dead zone to validate entry
• Both > dead zone is a compound of both rules above to get entry confirmation
→ ADX can also be used as a filter. I added 2 Threshold in order to have a minimum level of acceptance for valid entry but also a maximum level.

When your strategy is setup, you can setup alerts and I would recommend to setup the date range before doing the alerts. Why? Simply because the script do not cover pyramiding and will give a signal only if a trade is not ongoing.
In setting up the sessions at which you would want to trade, no signal within those range can be missed. You can setup 2 sessions, the days and also the global range of backtesting.
發布通知:
Parameters updated (Risk @ 5%) to ensure script compliance to House of rules.
發布通知:
UPDATED FOLLOWING THE VERSION 1.36, GUI version 1.26

ADDED:
→ Position filling
→ Moving average rules
→ Custom exit : MA crossing
→ New SL type: Moving average
→ New SL type: Strategy indicator
→ New Trailing type: Moving average
→ Breakeven function
→ Option to enable/disable stop loss indicator drawings
→ Custom session 2 days selector
→ Stochastic indicator as a filter
→ Option to not use the strategy indicator (to use strategy, the box "--------- STRATEGY SETTINGS" must be ticked"
→ Margin amount
→ Maximum order size field
→ Maintenance Margin Rate
→ Margin order safety parameter
→ Liquidation draw line option
→ Maximum Drawdown parameter
→ Maximum trade loss in a row safety parameter
→ Market filter added (ATR/SMA based)


FIXED:
→ Issue where the algo lost the SL value when changing to trailing
→ Issue where the use of custom session where leading to "NO DATA"
→ Issue with RSI OB/OS mode
→ Issue with negative quantities
→ Other issues


OTHER:
→ Re-organised the GUI.
發布通知:
UPDATED:
Default value of the strategy parameter selection changed to true.

ADDED:
Tooltip for strategy selection checkbox.
發布通知:
FIXED:
Issue where size would not be calculated when equity reach 0 creating a script error.
發布通知:
FIXED: Display bug fixed
發布通知:
Shorttitle updated, review of code prior to optimization to a latest functionality version (to come soon with other strategy)

A goal without a plan remains a dream.
受保護腳本
該腳本是閉源發佈的,您可以自由使用。您可以把它加入到常用以在圖表上使用它。您無法查看或修改其原始碼。
免責聲明

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

想在圖表上使用此腳本?