์ค๋ช
cTrader(cAlgo)๋ฅผ ์ํ "UTBotStrategy" ๋ด ์ค๋ช
๋ด UTBotStrategy๋ ์ ๋ฌธ๊ฐ ์ด๋๋ฐ์ด์ (EA)๋ก์ C#์ผ๋ก ๊ฐ๋ฐ๋์์ผ๋ฉฐ, cTrader(cAlgo) ํ๋ซํผ์ฉ์ ๋๋ค. ์ด ๋ด์ ATR ๋ฐ ๋์ ํธ๋ ์ผ๋ง ์คํฑ ๊ธฐ๋ฐ ์ ๊ทผ๋ฒ์ ์ฌ์ฉํ์ฌ ๊ฑฐ๋ ์ ํธ๋ฅผ ์๋ณํ๊ณ ํฌ์ง์ ์ ์๋์ผ๋ก ๊ด๋ฆฌํฉ๋๋ค. ์ฃผ์ ๊ธฐ๋ฅ ๊ฐ์๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
1. ์ ๋ ฅ ๋งค๊ฐ๋ณ์
์ด ๋ด์ ์ ๋ ฅ ๋งค๊ฐ๋ณ์๋ฅผ ํตํด ๋งค์ฐ ๊ตฌ์ฑ ๊ฐ๋ฅํ๋ฉฐ, ๋ค์์ ํฌํจํฉ๋๋ค:
- ๊ธฐ์ ์งํ:
-
- ํค ๊ฐ (์ ํธ ๋ฏผ๊ฐ๋, ATR ๋ฐฐ์)
- ATR ๊ธฐ๊ฐ (ATR ๊ธฐ๊ฐ)
- ํค์ดํจ ์์ (์ผ๋ฐ ์บ๋ค ๋์ ํค์ดํจ ์์ ์บ๋ค ์ฌ์ฉ ์ต์ )
- ๊ฑฐ๋ ๊ด๋ฆฌ:
-
- ๋กํธ ํฌ๊ธฐ (๋กํธ ํฌ๊ธฐ)
- ์คํฑ ๋ก์ค (ํ ๋จ์)
- ๊ฑฐ๋ ์๊ฐ (์์ ๋ฐ ์ข ๋ฃ ์๊ฐ)
- ํน์ ์๊ฐ์ ํฌ์ง์ ๊ฐ์ ์ข ๋ฃ
- ๋์ ํธ๋ ์ผ๋ง ์คํฑ:
-
- ์ผ์ ํ ์ด์ต ํ ํ์ฑํ
- ์คํฑ ๋ก์ค ์์ค ์กฐ์ ์ ์ํ ํธ๋ ์ผ๋ง ์คํฑ ๋จ๊ณ
2. ๊ฑฐ๋ ๋ ผ๋ฆฌ
์ด ๋ด์ ATR(ํ๊ท ์งํญ ๋ฒ์)์ ์ด์ฉํ ๋์ ๊ณ์ฐ ํธ๋ ์ผ๋ง ์คํฑ ๊ธฐ๋ฐ ์ ๋ต์ ๋ฐ๋ฆ ๋๋ค. ์๋ ๋ฐฉ์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
๋ถ์ ๋จ๊ณ (OnBar)
- ๋ด์ ์ ์ํ ํธ๋ ์ผ๋ง ์คํฑ ์ค์ ์ ์ํด ATR ๊ฐ์ ๊ณ์ฐํฉ๋๋ค.
- ํค์ดํจ ์์(ํ์ฑํ๋ ๊ฒฝ์ฐ)๋ฅผ ์ฌ์ฉํ์ฌ ์ข ๊ฐ๋ฅผ ํ์ธํฉ๋๋ค.
- ํ์ฌ ๊ฐ์ ํธ๋ ์ผ๋ง ์คํฑ ์์ค๊ณผ ๋น๊ตํ์ฌ ์์ฅ ๋ฐฉํฅ์ ๊ฒฐ์ ํฉ๋๋ค.
- ์ง์ ์กฐ๊ฑด:
-
- ๋กฑ ์ ํธ: ๊ฐ๊ฒฉ์ด ํธ๋ ์ผ๋ง ์คํฑ์ ์ํฅ ๋ํํ๋ฉฐ ์์น ์ถ์ธ๋ฅผ ํ์ธํฉ๋๋ค.
- ์ ์ ํธ: ๊ฐ๊ฒฉ์ด ํธ๋ ์ผ๋ง ์คํฑ์ ํํฅ ๋ํํ๋ฉฐ ํ๋ฝ ์ถ์ธ๋ฅผ ํ์ธํฉ๋๋ค.
- ๋ฏธ๋ฆฌ ์ ์๋ ์คํฑ ๋ก์ค์ ํจ๊ป ๋งค์ ๋๋ ๋งค๋ ์ฃผ๋ฌธ์ ์คํํฉ๋๋ค.
ํฌ์ง์ ๊ด๋ฆฌ
- ๋์ ํธ๋ ์ผ๋ง ์คํฑ:
-
- ์ด์ต์ด ๋ฏธ๋ฆฌ ์ ํด์ง ์๊ณ๊ฐ์ ๋๋ฌํ๋ฉด ํธ๋ ์ผ๋ง ์คํฑ์ด ํฌ์ง์ ์ ์ ๋ฆฌํ๊ฒ ์ด๋ํฉ๋๋ค.
- ๊ฐ์ ์ข ๋ฃ:
-
- ์ง์ ๋ ์๊ฐ์ด ๋๋ฉด ๋ชจ๋ ์ด๋ฆฐ ํฌ์ง์ ์ ์ข ๋ฃํฉ๋๋ค.
3. ์ถ๊ฐ ๊ธฐ๋ฅ
- ๊ฑฐ๋ ์ ํธ ์ฐจํธ: ๋ด์ด ์ง์ ๊ธฐํ๋ฅผ ์๋ฆฌ๊ธฐ ์ํด ์ฐจํธ์ ํ์ดํ๋ฅผ ๊ทธ๋ฆฝ๋๋ค.
- ์ฝ์์ ์ ๋ณด ์ถ๋ ฅ: ํธ๋ ์ผ๋ง ์คํฑ ๊ฐ, ๊ฐ๊ฒฉ ๋ฐ ์์ฅ ๋ฐฉํฅ์ ํ์ํฉ๋๋ค.
- ๋น๊ฑฐ๋ ์๊ฐ ๋ณดํธ: ์ง์ ๋ ์๊ฐ ์ธ ๊ฑฐ๋๋ฅผ ๋ฐฉ์งํฉ๋๋ค.
4. ์ ๋ต ๋ชฉํ
์ด ์ ๋ต์ ๋ค์์ ์ ์ฉํฉ๋๋ค: โ
์ค์บํ ๋๋ ๋ฐ์ด ํธ๋ ์ด๋ฉ (1๋ถ, 5๋ถ, 15๋ถ ํ์ํ๋ ์).
โ
๋์ ํธ๋ ์ผ๋ง ์คํฑ์ ์ด์ฉํ ์ถ์ธ ์ถ์ข
.
โ
์ฌ์ ์ค์ ๋ ์ํ ๊ด๋ฆฌ์ ํจ๊ปํ๋ ๊ฑฐ๋ ์๋ํ.
๐น ๊ฐ์ : ๋งค๊ฐ๋ณ์ ์ ์ฐ์ฑ, ์ง๋ฅํ ํธ๋ ์ผ๋ง ์คํฑ, ์ค๋ฒ๋์ดํธ ๋ฐฉ์ง๋ฅผ ์ํ ๊ฐ์ ์ข
๋ฃ.
๐ธ ๊ฐ๋ฅํ ๊ฐ์ ์ : ์๋ชป๋ ์ ํธ๋ฅผ ์ค์ด๊ธฐ ์ํ ์ถ๊ฐ ํํฐ(RSI, MACD) ๊ตฌํ.
Description of the "UTBotStrategy" Bot for cTrader (cAlgo)
The UTBotStrategy bot is an expert advisor (EA) developed in C# for the cTrader (cAlgo) platform. This bot uses an ATR and dynamic trailing stop approach to identify trading signals and manage positions automatically. Here is an overview of its main features:
1. Input Parameters
The bot is highly configurable via input parameters, which include:
Technical Indicators:
Key Value (Signal Sensitivity, ATR Multiplier)
ATR Period
Heikin Ashi (Option to use Heikin Ashi candles instead of regular ones)
Trading Management:
Lot Size
Stop Loss in pips
Trading Hours (Start and End Time)
Forced Closing of Positions at a Specific Time
Dynamic Trailing Stop:
Triggered after a certain profit in pips
Trailing stop step to adjust the stop loss level
2. Trading Logic
The bot follows a strategy based on a dynamically calculated trailing stop with the ATR (Average True Range). Here is how it works:
Analysis Phase (OnBar)
The bot calculates the ATR value to set an adaptive trailing stop.
Checks the closing price using Heikin Ashi (if enabled).
Compares the current value with the trailing stop level to determine the market direction.
Entry Conditions:
Long Signal: The price breaks above the trailing stop and confirms an uptrend.
Short Signal: The price breaks below the trailing stop and confirms a downtrend.
Executes buy or sell orders with a predefined stop loss.
Position Management
Dynamic Trailing Stop:
When profit reaches a predefined threshold, the trailing stop moves in favor of the position.
Forced Close:
If the specified time is reached, closes all open positions.
3. Extra Features
Trading Signal Charts: The bot draws arrows on the chart to signal entry opportunities.
Print information to the console: Shows trailing stop values, prices and market direction.
Off-Trading Time Protection: Prevents trading outside the specified time window.
4. Strategy Objective
This strategy is useful for: โ Scalping or Day Trading on low time frames (1M, 5M, 15M).
โ Trend Following with dynamic trailing stop.
โ Trading automation with preset risk management.
๐น Strengths: Flexibility in parameters, intelligent trailing stop, forced closing to avoid overnight.
๐ธ Possible Improvements: Implementation of additional filters (RSI, MACD) to reduce false signals
์์ฝ
The botโs trading logic calculates an adaptive trailing stop using ATR, compares price levels (optionally using Heikin Ashi closes) against this stop to determine market direction, and generates long or short signals when price crosses the trailing stop. It executes buy or sell orders with predefined stop loss levels. Position management features include a dynamic trailing stop that activates after reaching a profit threshold and forced closing of all positions at a set time to avoid overnight exposure.
Additional features include chart arrows signaling trade opportunities, console output of trailing stop values and market direction, and protection from trading outside specified hours. The strategy is designed for scalping or day trading on low timeframes (1M, 5M, 15M), trend following with dynamic stops, and automated risk-managed trading.
๊ณ ๊ฐ ๋ฆฌ๋ทฐ
5 | 100 % | |
4 | 0 % | |
3 | 0 % | |
2 | 0 % | |
1 | 0 % |