OPEN-SOURCE SCRIPT
Moving Average Trend Strategy V2.1 — With Stop Loss and Add Posi

**Strategy Feature Description:**
---
### **Entry Logic:**
* When **MA7** crosses **MA15**, and the distance between **MA15** and **MA99** is less than **0.5%**
* When **MA15** crosses **MA99**, and the distance between **MA7** and **MA15** is less than **0.5%**
* When the distance among all three MAs (**MA7**, **MA15**, **MA99**) is less than **0.5%** (adjustable via parameters)
---
### **Capital Management:**
* Initial capital: **$100**
* Each position uses **15%** of total capital
* Opens **both long and short positions simultaneously** (dual-direction mode)
---
### **Risk Control:**
* **Long position stop-loss:** Entry price − 2%
* **Short position stop-loss:** Entry price + 2%
* Uses a **five-level take-profit grid**:
* Every 5% profit → close 20% of position
* Any pending take-profit orders are automatically canceled when stop-loss triggers
---
### **Visualization Features:**
* Real-time display of the three moving averages
* Chart annotations for entry signal points
* All trade signals and performance can be viewed through **TradingView backtest reports**
---
### **Notes:**
* Parameters can be adjusted based on the volatility of the instrument (historical backtesting is recommended first)
* Dual-direction positions may generate **hedging costs** — recommended for low-fee markets
* Real trading must consider **exchange minimum order size limits**
* Suggest enabling a **volume filter mechanism** (extension interface already reserved)
* Always perform **historical backtesting and parameter optimization** in TradingView before connecting to live trading systems
---
### **Entry Logic:**
* When **MA7** crosses **MA15**, and the distance between **MA15** and **MA99** is less than **0.5%**
* When **MA15** crosses **MA99**, and the distance between **MA7** and **MA15** is less than **0.5%**
* When the distance among all three MAs (**MA7**, **MA15**, **MA99**) is less than **0.5%** (adjustable via parameters)
---
### **Capital Management:**
* Initial capital: **$100**
* Each position uses **15%** of total capital
* Opens **both long and short positions simultaneously** (dual-direction mode)
---
### **Risk Control:**
* **Long position stop-loss:** Entry price − 2%
* **Short position stop-loss:** Entry price + 2%
* Uses a **five-level take-profit grid**:
* Every 5% profit → close 20% of position
* Any pending take-profit orders are automatically canceled when stop-loss triggers
---
### **Visualization Features:**
* Real-time display of the three moving averages
* Chart annotations for entry signal points
* All trade signals and performance can be viewed through **TradingView backtest reports**
---
### **Notes:**
* Parameters can be adjusted based on the volatility of the instrument (historical backtesting is recommended first)
* Dual-direction positions may generate **hedging costs** — recommended for low-fee markets
* Real trading must consider **exchange minimum order size limits**
* Suggest enabling a **volume filter mechanism** (extension interface already reserved)
* Always perform **historical backtesting and parameter optimization** in TradingView before connecting to live trading systems
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.