OPEN-SOURCE SCRIPT
已更新 CDC BACKTEST (MACD) FIX AMOUNT $200k per trade

This strategy implements an Exponential Moving Average (EMA) Crossover System designed for backtesting and performance evaluation. EMA 12,26 (MACD)
The trading logic is based on the crossover between two EMAs — a short-term EMA (12) and a long-term EMA (26) — which serves as a momentum-based signal for trend identification.
Buy Condition:
A long (buy) position is entered when the 12-period EMA crosses above the 26-period EMA, indicating a potential upward trend or bullish momentum.
Sell Condition:
A position is closed, or a short (sell) position is opened, when the 12-period EMA crosses below the 26-period EMA, signaling a potential downward trend or bearish momentum.
Position Sizing:
Each trade with a fixed position size of 200,000 USD (default), while the starting account balance is set at 400,000 (USD).
Both the fixed trade amount and the initial balance are user-adjustable parameters, allowing flexibility for different risk preferences and portfolio sizes.
The trading logic is based on the crossover between two EMAs — a short-term EMA (12) and a long-term EMA (26) — which serves as a momentum-based signal for trend identification.
Buy Condition:
A long (buy) position is entered when the 12-period EMA crosses above the 26-period EMA, indicating a potential upward trend or bullish momentum.
Sell Condition:
A position is closed, or a short (sell) position is opened, when the 12-period EMA crosses below the 26-period EMA, signaling a potential downward trend or bearish momentum.
Position Sizing:
Each trade with a fixed position size of 200,000 USD (default), while the starting account balance is set at 400,000 (USD).
Both the fixed trade amount and the initial balance are user-adjustable parameters, allowing flexibility for different risk preferences and portfolio sizes.
版本注释
Description:This strategy implements an Exponential Moving Average (EMA) Crossover System for backtesting and performance evaluation.
The trading logic follows the crossover between a short-term EMA (12) and a long-term EMA (26), which helps identify shifts in market momentum and potential trend reversals.
Buy Condition:
A long (buy) position is opened when the 12-period EMA crosses above the 26-period EMA, signaling a potential bullish trend.
Sell Condition:
A position is closed or reversed to a short (sell) position when the 12-period EMA crosses below the 26-period EMA, indicating a potential bearish trend.
Position Sizing and Capital Management:
Each trade is executed with a fixed position size of 200,000 USD (default), while the starting account balance is set to 400,000 USD.
Both parameters are adjustable, allowing users to align the strategy with their individual risk tolerance and portfolio scale.
Backtest Period Configuration:
The strategy allows users to set a custom start date for the backtest period to focus on specific market conditions or historical intervals.
If no start date is specified, the system defaults to January 1, 1970, effectively running the test over all available data.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。