TradingView
chanu_lev10k
23 sept. 2021 14:11

Chanu Delta Strategy V3 

BTCUSDT SPOTBybit

Description

This strategy is built on the Chanu Delta Indicator, which indicates the strength of the Bitcoin market. When the Chanu Delta Indicator hits “Delta Bull” and “Delta Bear” and closes the candle, long and short signals are triggered respectively. The example shown on the screen is a default setting optimized for a 4-hour candlestick strategy based on the Bybit BTCUSDT futures market. You can use it by adjusting the setting value and modifying it to suit you.

This new version is selectable from both reference and large amplitude BTCUSD markets in order to enable fine backtesting. I recommend using BYBIT:BTCUSDT for the reference market and INDEX:BTCUSD for the large amplitude market.

If you use this strategy in conjunction with the Chanu Delta Indicator, it is convenient to anticipate alert signals in advance. Because the Chanu Delta Indicator represents the price difference based on the Bybit BTCUSDT futures market, backtesting is possible from March 2020.

▶ Improvements and originality compared to the previous version
1. Selectable BTCUSD reference and large amplitude markets
2. Improvement of the SL/TP Function
- Improved SL/TP function based on the actual entry price of the position.
- Application of SL/TP function can be turned on/off.

Notes de version

== IMPORTANT REVISION ==
Normalization of Chanu Delta: By dividing the original Chanu Delta value by the price of the reference Bitcoin market, it allows the Chanu Delta strategy to be universally used in the long term despite Bitcoin price fluctuations.
Original Chanu Delta (Previous version) = Price of BTCUSD Large amplitude market - Price of BTCUSD reference market
Normalized Chanu Delta = (Original Chanu Delta / Price of BTCUSD reference market) * 100000
Here are recommended settings of the strategy.
BTCUSD reference market: BYBIT:BTCUSDT
BTCUSD large amplitude market: INDEX:BTCUSD
Source: Close
Resolution: Same as chart (4hr)
1. [Unchecked] Use normalization of Chanu Delta
- Bull Level: 21
- Bear Level: -14.6
- SL: 16.9
- TP: 17.2
2. [Checked] Use normalization of Chanu Delta
- Bull Level: 35.4
- Bear Level: -41.5
- SL: 13.5
- TP: 17

Notes de version

[Minor change] Default value revision (Recommended settings are changed.)
- BTCUSD large amplitude market : INDEX:BTCUSD → BYBIT:BTCUSD
- Bull Level: 35.4 → 67.0
- Bear Level: -41.5 → -102.0
- SL: True → False

Notes de version

Just conversion to PineScript v5

Notes de version

릴리즈 노트:
Default value revision (Recommended settings are changed.)
- Bull Level: 67.0 → 50
- Bear Level: -102.0 → -52
- TP: 17 → 18
Commentaires
pggo88
I very much like your idea try this for no repaint.
//@version=5
var int PyramidingAmount = 1
var int Leverage = 5
var int Equity = 10
var int PositionQuantityInEquity = Leverage * Equity
var float Ticks = input.float(title="Trailing Offset ticks", minval=1, step=1, defval=2)
var float Pips = Ticks * syminfo.mintick

plot(Equity, title="Equity", display=display.none)
plot(Leverage, title="Leverage", display=display.none)
plot(Pips, title="Pips", display=display.none)
strategy(title='XRP CHANU DELTA 1h',use_bar_magnifier = true, process_orders_on_close=true, precision=8, currency=currency.USD, backtest_fill_limits_assumption=5, slippage=1, overlay=false, pyramiding=PyramidingAmount, max_bars_back=5000, commission_type=strategy.commission.percent, commission_value=0.02, default_qty_type=strategy.percent_of_equity, default_qty_value=PositionQuantityInEquity, margin_long = 1./2*50, margin_short = 1./2*50, initial_capital=1000)

normalized_delta_bull = input.float(defval=9.5, minval=0.1, step=0.1, title='Delta Bull')
normalized_delta_bear = input.float(defval=-14.7, maxval=-0.1, step=0.1, title='Delta Bear')

src = input(title='Source', defval=hl2)
tf = input.timeframe(title='resolution', defval='')
issl = input.bool(title='SL', inline='linesl1', group='Stop Loss / Take Profit:', defval=false)
slpercent = input.float(title=', %', inline='linesl1', group='Stop Loss / Take Profit:', defval=19, minval=0.0, step=0.1)
istp = input.bool(title='TP', inline='linetp1', group='Stop Loss / Take Profit:', defval=false)
tppercent = input.float(title=', %', inline='linetp1', group='Stop Loss / Take Profit:', defval=15.6, minval=0.0, step=0.1)
usd_symbol = input.symbol("INDEX:BTCUSD", title="Instrument USD Symbol")
usdt_symbol = input.symbol("BYBIT:BTCUSDT", title="Instrument USDT Symbol")
_NRPrt(sym, tf, src) =>
request.security(sym, tf, src[barstate.isrealtime ? 1 : 0], barmerge.gaps_off)[barstate.isrealtime ? 0 : 1]
usd = _NRPrt(usd_symbol, tf, src)
usdt = _NRPrt(usdt_symbol, tf, src)
delta = usd - usdt
normalized_delta = (delta / usd) * 100000
bull_crossover = ta.crossover(normalized_delta, normalized_delta_bull)
bear_crossunder = ta.crossunder(normalized_delta, normalized_delta_bear)
longCondition = bull_crossover[1] and not bear_crossunder
shortCondition = bear_crossunder[1] and not bull_crossover
if longCondition
strategy.entry('Long', strategy.long)
if shortCondition
strategy.entry('Short', strategy.short)
// Entry price / Take profit / Stop Loss
entryprice = strategy.position_avg_price
pm = longCondition ? 1 : shortCondition ? -1 : 1 / math.sign(strategy.position_size)
takeprofit = entryprice * (1 + pm * tppercent * 0.01)
stoploss = entryprice * (1 - pm * slpercent * 0.01)
strategy.exit(id='Exit Long', from_entry='Long', stop=issl ? stoploss : na, limit=istp ? takeprofit : na, alert_message='Close Long')
strategy.exit(id='Exit Short', from_entry='Short', stop=issl ? stoploss : na, limit=istp ? takeprofit : na, alert_message='Close Short')
ghw4365
소스공유는 안되나요?ㅎㅎ자동매매에 적용해보고싶습니다
chanu_lev10k
@ghw4365, 예전에 공개를 했더니 소스를 도용해서 퍼블리시한 일이 있어서 공개안하기로 했는데요.. 최근에 파인이 v5로 업데이트되어서 그런건지 long, short 신호가 아닌데도 얼러트가 떠서 소스 공개해도 자동매매 적용이 될지 모르겠네요... 그래서 어제 소스를 v5로 업데이트했는데도 오늘 얼러트가 잘못 떴습니다.. 리페인팅은 아닌데 원인을 모르겠네요;
ghw4365
@chanu_lev10k, 넵 알겠습니다ㅎㅎ
chanu_lev10k
▶ 8hr candle strategy
- Ref: BYBIT:BTCUSDT
- Large amplitude: INDEX:BTCUSD
- Source: Close
- Resolution: Same as chart (8hr)
- (Unchecked) Use normalization of Chanu Delta
- Bull Level: 0.6
- Bear Level: -0.9
- (Unchecked) SL
- (Unchecked) TP
chanu_lev10k
1. (Unchecked) Use normalization of Chanu Delta
- Bull Level: 21
- Bear Level: -14.6
- SL: 16.9
- TP: 17.2
2. (Checked) Use normalization of Chanu Delta
- Bull Level: 35.4
- Bear Level: -41.5
- SL: 13.5
- TP: 17
smilepeople
@chanu_lev10k, v5로 업데이트 하기 전 수치도 전략지표를 계속 보고 있었는데요. 갑자기 어느 순간 과거의 long, short 신호가 바뀌어 있는 경우가 있네요. 예를 들어 2번 수치의 경우 오늘 아침 9시에 롱신호가 나왔었는데 방금 큰 하락후 사라졌어요. 이 신호 뿐만 아니라 과거의 신호들도 갑자기 많이 바뀌었어요. 적용시킨 지표가 오늘 오전과 현재가 롱, 숏 신호가 바뀐 것을 보면 리페인팅이 아니라 무엇인가 오류가 있는 것 같은데 한번 확인해주시면 감사드리겠습니다!
chanu_lev10k
@smilepeople, 네 저도 이 오류때문에 얼러트가 잘못떠서 원인을 찾고 있는데 잘 모르겠습니다; 이 전략 실제로 포지션들어가서 투자하고 계신가요? 이거보다 개인적으로 제 전략 중에 RSI+CMO hybrid 전략을 더 추천드립니다.
smilepeople
@chanu_lev10k, 네. 전략이 괜찮은 것 같아 믿고 투자하고 있었는데 오류가 있어서 아쉽네요 ㅠㅠ. 현재는 손실중이지만 꾸준히 하면 충분히 수익으로 전환될 수 있는 좋은 전략인 것 같아요. 업데이트 간절히 바라고 있습니다. 개인적으로 트레이딩 횟수가 많을 수록 신뢰도가 높다고 판단하여 RSI+CMO hybrid 전략은 사용하지 않고 있습니다. 하지만 항상 좋은 전략, 업데이트 감사드립니다!
chanu_lev10k
@smilepeople, RSI+CMO 전략을 비트스탬프같이 트레이딩수 100이 넘는 오래된 차트를 사용해서 백테스팅하면 신뢰도괜찮다고 생각하는데 체크해보셔요. 델타전략은 시장의 상대 가격을 보다보니 시기별로 좋고 나쁨이 발생하고 절대적인 지표가 아니고 상대적이다보니 델타전략보다는 RSI+CMO 전략 추천드렸었습니다^^
Plus