OPEN-SOURCE SCRIPT

CCI and MACD Auto Trading Strategy with Risk/Reward

已更新
Overview:
This strategy combines the Commodity Channel Index (CCI) and the Moving Average Convergence Divergence (MACD) indicators to automate trading decisions. It dynamically sets stop-loss and take-profit levels based on recent lows and highs, ensuring a risk/reward ratio of 1:1.5. This script aims to leverage trend and momentum signals while maintaining effective risk management.

Originality and Usefulness:
This script is not just a simple mashup of CCI and MACD indicators; it incorporates dynamic risk management by setting stop-loss and take-profit levels based on recent price action. This approach helps traders to:

・Identify potential trend reversals using the combination of CCI and MACD signals.
・Manage trades effectively by setting realistic stop-loss and take-profit levels based on recent market data.
・Maintain a balanced risk/reward ratio, which is essential for sustainable trading.

Indicators Used:
・CCI (Commodity Channel Index):
 ・Measures the deviation of the price from its average over a specified period, typically ranging from -100 to +100.
 ・Helps identify overbought and oversold conditions.

・MACD (Moving Average Convergence Divergence):
 ・Utilizes the difference between short-term and long-term moving averages to indicate trend strength and direction.
 ・Provides momentum signals that can be used for timing entries and exits.

How It Works:
Entry Conditions:

Long Entry:
 ・The MACD histogram is above zero.
 ・The CCI crosses above the -100 line.

Short Entry:
 ・The MACD histogram is below zero.
 ・The CCI crosses below the +100 line.

Exit Conditions:

Long Positions:
 ・The stop-loss is set at the recent low.
 ・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.

Short Positions:
 ・The stop-loss is set at the recent high.
 ・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.

Risk Management:

・The script dynamically adjusts stop-loss and take-profit levels based on recent market data, ensuring that the risk/reward ratio is maintained at 1:1.5.
 ・This approach helps in managing the risk effectively while aiming for consistent profits.

Strategy Properties:
 ・Account Size: Configured for a realistic account size suitable for the average trader.
 ・Commission and Slippage: Includes settings for realistic commission and slippage to reflect real market conditions.
 ・Risk per Trade: Designed to risk no more than 5-10% of equity per trade, aligning with sustainable trading practices.
 ・Backtesting Results: Configured to generate a sufficient sample size (ideally more than 100 trades) for reliable backtesting results.

Revised Backtesting Settings
Ensure that your backtesting settings are realistic:

・Account Size: Set a realistic initial capital suitable for the average trader.
・Commission and Slippage: Include realistic commission fees and slippage.
・Risk Management: Ensure that each trade risks no more than 5-10% of the account equity.
・Sufficient Sample Size: Choose a dataset that will generate more than 100 trades to provide a       robust sample size.
發行說明
Overview:
This strategy combines the Commodity Channel Index (CCI) and the Moving Average Convergence Divergence (MACD) indicators to automate trading decisions. It dynamically sets stop-loss and take-profit levels based on recent lows and highs, ensuring a risk/reward ratio of 1:1.5. This script aims to leverage trend and momentum signals while maintaining effective risk management.

Originality and Usefulness:
This script is not just a simple mashup of CCI and MACD indicators; it incorporates dynamic risk management by setting stop-loss and take-profit levels based on recent price action. This approach helps traders to:

・Identify potential trend reversals using the combination of CCI and MACD signals.
・Manage trades effectively by setting realistic stop-loss and take-profit levels based on recent market data.
・Maintain a balanced risk/reward ratio, which is essential for sustainable trading.

Indicators Used:
・CCI (Commodity Channel Index):
 ・Measures the deviation of the price from its average over a specified period, typically ranging from -100 to +100.
 ・Helps identify overbought and oversold conditions.

・MACD (Moving Average Convergence Divergence):
 ・Utilizes the difference between short-term and long-term moving averages to indicate trend strength and direction.
 ・Provides momentum signals that can be used for timing entries and exits.

How It Works:
Entry Conditions:

Long Entry:
 ・The MACD histogram is above zero.
 ・The CCI crosses above the -100 line.

Short Entry:
 ・The MACD histogram is below zero.
 ・The CCI crosses below the +100 line.

Exit Conditions:

Long Positions:
 ・The stop-loss is set at the recent low.
 ・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.

Short Positions:
 ・The stop-loss is set at the recent high.
 ・The take-profit is set at 1.5 times the distance between the entry price and the stop-loss.

Risk Management:

・The script dynamically adjusts stop-loss and take-profit levels based on recent market data, ensuring that the risk/reward ratio is maintained at 1:1.5.
 ・This approach helps in managing the risk effectively while aiming for consistent profits.

Strategy Properties:
 ・Account Size: Configured for a realistic account size suitable for the average trader.
 ・Commission and Slippage: Includes settings for realistic commission and slippage to reflect real market conditions.
 ・Risk per Trade: Designed to risk no more than 5-10% of equity per trade, aligning with sustainable trading practices.
 ・Backtesting Results: Configured to generate a sufficient sample size (ideally more than 100 trades) for reliable backtesting results.

Revised Backtesting Settings
Ensure that your backtesting settings are realistic:

・Account Size: 100万yen
・Commission and Slippage: 0.03銭と1スリッページ
・Risk Management: 証拠金の10%
・Sufficient Sample Size: 190回のバックテストトレード実行

Commodity Channel Index (CCI)Moving Average Convergence / Divergence (MACD)

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?


更多:

免責聲明