基本理念: B-Xtrender指標是一種技術分析工具,它基于相對強弱指數(shù)(RSI)并結合了多時間框架的分析來識別市場趨勢。以下是關于B-Xtrender基本理念的一些要點: 趨勢識別:B-Xtrender通過分析不同時間框架下的RSI指標來識別當前市場的主要趨勢。多時間框架分析:該指標結合了短期和長期的RSI分析,以提供一個更為全面的市場視角。 效果圖: ![]() 圖一:B-Xtrender上證指數(shù) Tradingview代碼//@version=4 study('B-Xtrender @Puppytherapy') short_l1 = input(5 , title='Short - L1') short_l2 = input(20, title='Short - L2') short_l3 = input(15, title='Short - L3') long_l1 = input(20, title='Long - L1') long_l2 = input(15, title='Long - L2') shortTermXtrender = rsi(ema(close, short_l1) - ema(close, short_l2), short_l3 ) - 50 longTermXtrender = rsi( ema(close, long_l1), long_l2 ) - 50 shortXtrenderCol = shortTermXtrender > 0 ? shortTermXtrender > shortTermXtrender[1] ? color.lime : #228B22 : shortTermXtrender > shortTermXtrender[1] ? color.red : #8B0000 plot(shortTermXtrender, color=shortXtrenderCol, style=plot.style_columns, linewidth=1, title='B-Xtrender Osc. - Histogram', transp = 50) maShortTermXtrender = t3( shortTermXtrender , 5 ) colShortTermXtrender = maShortTermXtrender > maShortTermXtrender[1] ? color.lime : color.red plot(maShortTermXtrender, color=#000000 , style=plot.style_line, linewidth=5, title='B-Xtrender Shadow') plot(maShortTermXtrender, color=colShortTermXtrender, style=plot.style_line, linewidth=3, title='B-Xtrender Color ') plotshape(maShortTermXtrender > maShortTermXtrender[1] and maShortTermXtrender[1] < maShortTermXtrender[2] ? maShortTermXtrender : na, location=location.absolute, style=shape.circle, color=color.lime, size=size.tiny, transp=10) plotshape(maShortTermXtrender < maShortTermXtrender[1] and maShortTermXtrender[1] > maShortTermXtrender[2] ? maShortTermXtrender : na, location=location.absolute, style=shape.circle, color=color.red , size=size.tiny, transp=10) longXtrenderCol = longTermXtrender> 0 ? longTermXtrender > longTermXtrender[1] ? color.lime : #228B22 : longTermXtrender > longTermXtrender[1] ? color.red : #8B0000 macollongXtrenderCol = longTermXtrender > longTermXtrender[1] ? color.lime : color.red plot(longTermXtrender , color=longXtrenderCol, style=plot.style_histogram, linewidth=2, title='B-Xtrender Trend - Histogram', transp = 80) plot(longTermXtrender , color=#000000 , style=plot.style_line, linewidth=5, title='B-Xtrender Trend - Line', transp = 80) plot(longTermXtrender , color=macollongXtrenderCol, style=plot.style_line, linewidth=3, title='B-Xtrender Trend - Line', transp = 80)
通達信代碼
![]() 圖二:B-Xtrender通達信整體效果 TDX指標翻譯LIJIN1賦值:5 LIJIN2賦值:20 LIJIN3賦值:15 LIJIN4賦值:20 LIJIN5賦值:10 LIJIN6賦值:1 A賦值:收盤價的LIJIN1日指數(shù)移動平均 - 收盤價的LIJIN2日指數(shù)移動平均 LC賦值:1日前的A LIJIN7賦值:A-LC和0的較大值的LIJIN3日[1日權重]移動平均/A-LC的絕對值的LIJIN3日[1日權重]移動平均*100 B賦值:收盤價的LIJIN4日指數(shù)移動平均 LCB賦值:1日前的B LIJIN8賦值:B-LCB和0的較大值的LIJIN5日[1日權重]移動平均/B-LCB的絕對值的LIJIN5日[1日權重]移動平均*100 LIJIN9賦值:LIJIN7 - 50 LIJIN0賦值:LIJIN8 - 50 當滿足條件LIJIN0>0ANDLIJIN0>1日前的LIJIN0時,在0和LIJIN0位置之間畫柱狀線,寬度為0,-1不為0則畫空心柱., 畫淡紅色 當滿足條件LIJIN0>0ANDLIJIN0<1日前的LIJIN0時,在0和LIJIN0位置之間畫柱狀線,寬度為0,-1不為0則畫空心柱., 畫藍色 當滿足條件LIJIN0<=0ANDLIJIN0>1日前的LIJIN0時,在0和LIJIN0位置之間畫柱狀線,寬度為0,-1不為0則畫空心柱., 畫紅色 當滿足條件LIJIN0<=0ANDLIJIN0<1日前的LIJIN0時,在0和LIJIN0位置之間畫柱狀線,寬度為0,-1不為0則畫空心柱., 畫白色 當滿足條件LIJIN9>0時,在LIJIN9和0位置之間畫柱狀線,寬度為1,0不為0則畫空心柱.,COLOR000099 當滿足條件LIJIN9<=0時,在LIJIN9和0位置之間畫柱狀線,寬度為1,0不為0則畫空心柱.,COLOR005E00 當滿足條件LIJIN9>0ANDLIJIN9>1日前的LIJIN9時,在LIJIN9和0位置之間畫柱狀線,寬度為1,0不為0則畫空心柱.,畫紅色 當滿足條件LIJIN9<=0ANDLIJIN9>1日前的LIJIN9時,在LIJIN9和0位置之間畫柱狀線,寬度為1,0不為0則畫空心柱., COLOR00B000 輸出MA_LONG:-LIJIN6*LIJIN6*LIJIN6*LIJIN9的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均+(3*LIJIN6*LIJIN6+3*LIJIN6*LIJIN6*LIJIN6)*LIJIN9的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均+(-6*LIJIN6*LIJIN6-3*LIJIN6-3*LIJIN6*LIJIN6*LIJIN6)*LIJIN9的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均+(1+3*LIJIN6+LIJIN6*LIJIN6*LIJIN6+3*LIJIN6*LIJIN6)*LIJIN9的5日指數(shù)移動平均的5日指數(shù)移動平均的5日指數(shù)移動平均 輸出MA_SHORT:-LIJIN6*LIJIN6*LIJIN6*LIJIN9的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均+(3*LIJIN6*LIJIN6+3*LIJIN6*LIJIN6*LIJIN6)*LIJIN9的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均+(-6*LIJIN6*LIJIN6-3*LIJIN6-3*LIJIN6*LIJIN6*LIJIN6)*LIJIN9的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均+(1+3*LIJIN6+LIJIN6*LIJIN6*LIJIN6+3*LIJIN6*LIJIN6)*LIJIN9的10日指數(shù)移動平均的10日指數(shù)移動平均的10日指數(shù)移動平均,線寬為3,畫紅色 如果MA_SHORT<=1日前的MA_SHORT,返回MA_SHORT,否則返回無效數(shù),線寬為3,畫藍色 李津1賦值:MA_SHORT>1日前的MA_SHORT AND 1日前的MA_SHORT>2日前的MA_SHORT 李津2賦值:MA_SHORT<1日前的MA_SHORT AND 1日前的MA_SHORT<2日前的MA_SHORT 李津3賦值:信號過濾(多頭) 李津4賦值:信號過濾(多頭) 當滿足條件李津3時,在MA_SHORT位置畫34號圖標 當滿足條件李津4時,在MA_SHORT位置畫35號圖標 交易信號生成:B-Xtrender通過比較短期和長期RSI的值來生成買入或賣出的交易信號。當短期RSI超過長期RSI時,可能表明市場正在進入上升趨勢,反之則可能表明市場正在進入下降趨勢。振蕩器特性:作為一個振蕩器,B-Xtrender在0到100之間波動,可以幫助交易者識別超買或超賣的情況。適應性:B-Xtrender可以適應不同的市場條件和交易風格,適用于多種交易策略。 ![]() 圖三:B-Xtrender通達信部分顯示 B-Xtrender通常在圖表上以直方圖的形式展示,直觀地表示市場趨勢的強度和方向。交易者可以根據(jù)個人偏好和交易策略調(diào)整B-Xtrender的參數(shù)設置,如RSI的時間周期和計算方法。 使用B-Xtrender時,交易者應結合其他技術分析工具和風險管理規(guī)則來優(yōu)化交易決策。B-Xtrender指標的設計旨在幫助交易者捕捉市場趨勢,并在適當?shù)臅r機進入或退出交易,以實現(xiàn)盈利。 |
|
來自: 常熟老李jlr5mr > 《★股市》