IvanLabrie

4H CCI Strategy 1.4

Here's the last version...quick hack job.
I'm sure it can be improved, but this is a rough sketch, code wise.
The strategy works in range bound enviroments, so cointegrated pairs like AUDCAD will shine with it.

Cheers,

Ivan Labrie
Time at Mode FX

🔒Want to dive deeper? Check out my paid services below🔒

linktr.ee/ivanlabrie
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
//@version=2
strategy("4H CCI Strategy 1.4", overlay=true)
length = input( 11 )
overSold = input( -100 )
overBought = input( +100 )
price1 = high
price2 = low
ucci = cci(price1, length)
dcci = cci(price2, length)
tp = input(title='Take profit in ticks:', type=float, defval=3000.0)
sl = input(title='Stop loss in ticks:', type=float, defval=1000.0)
trade_size = input(title='Trade Size:', type=float, defval=500000)
strategy.entry("CCILE", strategy.long, comment="CCILE",qty=trade_size, when=crossover(dcci, overSold))
strategy.exit(id="CCILE", profit = tp, loss = sl)
strategy.entry("CCISE", strategy.short, comment="CCISE",qty=trade_size,when=crossunder(ucci, overBought))
strategy.exit(id="CCISE", profit = tp, loss = sl)
//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)