
Chiến lược này kết hợp các tín hiệu mua và bán bằng cách kết hợp chiến lược 123 đảo ngược và chiến lược đường thẳng của CMO. Chiến lược 123 đảo ngược tạo ra các mức cao hoặc thấp mới thông qua giá đóng cửa của cổ phiếu trong hai ngày liên tiếp, kết hợp với các chỉ số ngẫu nhiên để xác định sức mua và bán của thị trường, tạo ra tín hiệu giao dịch. Chiến lược đường thẳng của CMO sử dụng các chỉ số CMO để xác định động lực giá, tạo ra giao dịch.
Chiến lược đảo ngược 123 sử dụng các nguyên tắc sau để tạo ra tín hiệu giao dịch:
Chiến lược này tạo ra tín hiệu giao dịch bằng cách đánh giá liệu giá có hình thành một đỉnh cao hoặc thấp mới trong thời gian ngắn hay không, kết hợp với các chỉ số đa luồng với các chỉ số ngẫu nhiên.
Chiến lược CMO Linear sử dụng các nguyên tắc sau để tạo ra tín hiệu giao dịch:
Chiến lược này tạo ra tín hiệu giao dịch bằng cách tính toán tổng hợp các giá trị CMO trong các chu kỳ khác nhau để xác định các chỉ số động lực giá.
Chiến lược kết hợp hoạt động AND đối với tín hiệu của hai chiến lược, nghĩa là khi tín hiệu của hai chiến lược đồng thời làm nhiều hoặc đồng thời làm rỗng, chiến lược kết hợp sẽ tạo ra tín hiệu giao dịch thực tế.
Chiến lược này có những ưu điểm sau:
Chiến lược này cũng có những rủi ro sau:
Các biện pháp có thể được áp dụng:
Chiến lược này có thể được tối ưu hóa bằng cách:
Chiến lược này tạo thành một chiến lược giao dịch kết hợp hiệu quả bằng cách sử dụng hai chiến lược bổ sung mạnh mẽ của 123 reversal và CMO linear. Với điều kiện kiểm soát rủi ro, có thể tạo ra lợi nhuận vượt trội ổn định.
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 19/09/2019
// This is combo strategies for get a cumulative signal.
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
// The strategy sells at market, if close price is lower than the previous close price
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// This indicator plots average of three different length CMO's. This indicator
// was developed by Tushar Chande. A scientist, an inventor, and a respected
// trading system developer, Mr. Chande developed the CMO to capture what he
// calls "pure momentum". For more definitive information on the CMO and other
// indicators we recommend the book The New Technical Trader by Tushar Chande
// and Stanley Kroll.
// The CMO is closely related to, yet unique from, other momentum oriented
// indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc.
// It is most closely related to Welles Wilder?s RSI, yet it differs in several ways:
// - It uses data for both up days and down days in the numerator, thereby directly
// measuring momentum;
// - The calculations are applied on unsmoothed data. Therefore, short-term extreme
// movements in price are not hidden. Once calculated, smoothing can be applied to
// the CMO, if desired;
// - The scale is bounded between +100 and -100, thereby allowing you to clearly see
// changes in net momentum using the 0 level. The bounded scale also allows you to
// conveniently compare values across different securities.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
vFast = sma(stoch(close, high, low, Length), KSmoothing)
vSlow = sma(vFast, DLength)
pos = 0.0
pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0)))
pos
CMOav(Length1,Length2,Length3, TopBand, LowBand) =>
pos = 0
xMom = close - close[1]
xMomabs = abs(close - close[1])
nSum1 = sum(xMom, Length1)
nSumAbs1 = sum(xMomabs, Length1)
nSum2 = sum(xMom, Length2)
nSumAbs2 = sum(xMomabs, Length2)
nSum3 = sum(xMom, Length3)
nSumAbs3 = sum(xMomabs, Length3)
nRes = 100 * (nSum1 / nSumAbs1 + nSum2 / nSumAbs2 + nSum3 / nSumAbs3 ) / 3
pos := iff(nRes > TopBand, 1,
iff(nRes < LowBand, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & CMOav", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Length1 = input(5, minval=1)
Length2 = input(10, minval=1)
Length3 = input(20, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOav = CMOav(Length1,Length2,Length3, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOav == 1 , 1,
iff(posReversal123 == -1 and posCMOav == -1, -1, 0))
possig = iff(reverse and pos == 1, -1,
iff(reverse and pos == -1 , 1, pos))
if (possig == 1)
strategy.entry("Long", strategy.long)
if (possig == -1)
strategy.entry("Short", strategy.short)
if (possig == 0)
strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )