명시
//@version=5
strategy("Supertrend Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=15)
// Input parameters
atrPeriod = input(10, "ATR Length")
factor = input.float(3.0, "Factor", step=0.01)
trailATR = input.int(1, "ATR Trail", minval=1)
// Calculate Supertrend
[_, trendUp] = ta.supertrend(factor, atrPeriod)
// Entry conditions
longEntry = ta.change(trendUp) < 0
shortEntry = ta.change(trendUp) > 0
// Exit conditions (trail stop with ATR)
longExit = strategy.position_size > 0 and close < nz(strategy.position_avg_price) - trailATR * ta.atr(atrPeriod)
shortExit = strategy.position_size < 0 and close > nz(strategy.position_avg_price) + trailATR * ta.atr(atrPeriod)
// Manage positions
strategy.entry("Long", strategy.long, when=longEntry)
strategy.entry("Short", strategy.short, when=shortEntry)
strategy.close("Long", when=longExit)
strategy.close("Short", when=shortExit)
// Plot equity curve
plot(strategy.equity, title="Equity", color=color.blue, linewidth=2, style=plot.style_line)
응답함
1
등급
프로젝트
217
22%
중재
14
64%
/
21%
기한 초과
1
0%
로드됨
2
등급
프로젝트
932
47%
중재
301
59%
/
25%
기한 초과
124
13%
작업중
3
등급
프로젝트
5
20%
중재
4
0%
/
25%
기한 초과
1
20%
작업중
4
등급
프로젝트
57
35%
중재
4
25%
/
50%
기한 초과
6
11%
로드됨
비슷한 주문
I am looking for stable solution to disable auto-updates for MetaTrader 4 and MetaTrader 5. The update window should not appear on terminal launch if there is a new update available
The basic indicator and the only indicator to be used is PRICE PERCENT RANGE and the indicator files are attached. A picture to visualize what is required is also attached. Job: Indicator : 1. Add Buy alert and Buy arrow function,if the price%R value touches or goes below value 9.5 or the user specified,after candle close. 2. Add Sell alert and Sell arrow function,if the price%R value touches or goes below value 90.5
프로젝트 정보
예산
30+ USD
개발자에게
27
USD