OPEN-SOURCE SCRIPT

Strategy SEMA SDI Webhook

erdas0의
Purpose of the Code:
The strategy utilizes Exponential Moving Averages (EMA) and Smoothed Directional Indicators (SDI) to generate buy and sell signals. It includes features like leverage, take profit, stop loss, and trailing stops. The strategy is intended for backtesting and automating trades based on the specified indicators and conditions.

Key Components and Functionalities:

1.Strategy Settings:
Overlay: The strategy will overlay on the price chart.
Slippage: Set to 1.
Commission Value: Set to 0.035.
Default Quantity Type: Percent of equity.
Default Quantity Value: 50% of equity.
Initial Capital: Set to 1000 units.
Calculation on Order Fills: Enabled.
Process Orders on Close: Enabled.

2.Date and Time Filters:
Inputs for enabling/disabling start and end dates.
Filters to execute strategy only within specified date range.

3.Leverage and Quantity:
Leverage: Adjustable leverage input (default 3).
USD Percentage: Adjustable percentage of equity to use for trades (default 50%).
Initial Capital: Calculated based on leverage and percentage of equity.

4.Take Profit, Stop Loss, and Trailing Stop:
Inputs for enabling/disabling take profit, stop loss, and trailing stop.
Adjustable parameters for take profit percentage (default 25%), stop loss percentage (default 4.8%), and trailing stop percentage (default 1.9%).
Calculations for take profit, stop loss, trailing price, and maximum profit tracking.

5.EMA Calculations:
Fast and slow EMAs.
Smoothed versions of the fast and slow EMAs.

6.SDI Calculations:
Directional movement calculation for positive and negative directional indicators.
Difference between the positive and negative directional indicators, smoothed.
7.Buy/Sell Conditions:
Long (Buy) Condition: Positive DI is greater than negative DI, and fast EMA is greater than slow EMA.
Short (Sell) Condition: Negative DI is greater than positive DI, and fast EMA is less than slow EMA.

8.Strategy Execution:
If buy conditions are met, close any short positions and enter a long position.
If sell conditions are met, close any long positions and enter a short position.
Exit conditions for long and short positions based on take profit, stop loss, and trailing stop levels.
Close all positions if outside the specified date range.

Usage:
This strategy is used to automate trading based on the specified conditions involving EMAs and SDI. It allows backtesting to evaluate performance based on historical data. The strategy includes risk management through take profit, stop loss, and trailing stops to protect gains and limit losses. Traders can customize the parameters to fit their specific trading preferences and risk tolerance. Differently, it can perform leverage analysis and use it as a template.

By using this strategy, traders can systematically execute trades based on technical indicators, helping to remove emotional bias and improve consistency in trading decisions.

Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
Average Directional Index (ADX)educationalExponential Moving Average (EMA)

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항