|
樓主 |
發表於 12-3-19 14:03
|
顯示全部樓層
這是 HTS 的版本 就玩玩看嘍- Parameters : KTrend(True),KDLines(True), MultiKDLines(True),OverSold(20), OverBought(80)
- Parameters : ShortK(9),MiddleK(5),LongK(10)
- VARIABLES : SK(50),MK(50),LK(50),SRSV(0),MRSV(0),LRSV(0)
- VARIABLES : SlowD(50),MD(50),LD(50)
- Variables :StdKDKBars(ShortK),MiddleKBars(ShortK*MiddleK),LongKBars(LongK*ShortK)
- Variables :MRSVBars(0),LRSVBars(0)
- Variables :BarCount(0)
- StdKDKBars = ShortK
- MiddleKBars= ShortK*MiddleK
- LongKBars = LongK*ShortK
- BarCount += 1
- //DrawBase1( OverBought, "Over Bought", DarkGray )
- //DrawBase2( OverSold, "Over Sold", DarkGray )
- //DrawBase3(50,"50", DarkGray)
- IF KDLines
- THen
- SRSV = (Close - Lowest(Low,StdKDKBars)) / (Highest(High,StdKDKBars) - Lowest(Low,StdKDKBars)) * 100
- //SRSV = (Close - Lowest(Low,9)) / (Highest(High,9) - Lowest(Low,9)) * 100
- SK = (SK[1] * 2 + SRSV ) /3
- SlowD = (SLowD[1] *2 + SK ) /3
- Draw4(SK, "%K",Red)
- Draw3(SlowD,"%D",Green)
- Else
- // NoDraw(4)
- // NoDraw(3)
- End IF
- IF MultiKDLines
- Then
- MRSVBars = Mod(BarCount,MiddleK) + (ShortK-1) * MIddleK + 1
- //MRSV = (Close - Lowest(Low,MRSVBars)) / (Highest(High,MRSVBars) - Lowest(Low,MRSVBars)) * 100
- MRSV = (Close - Lowest(Low,MiddleKBars)) / (Highest(High,MiddleKBars) - Lowest(Low,MiddleKBars)) * 100
- MK = ( MK[MOD(BarCount,MiddleK)+1] *2 + MRSV ) /3
- MD = ( MD[MOD(BarCount,MiddleK)+1] *2 + MK ) /3
- LRSVBars = Mod(BarCount,LongK) + (ShortK-1) * LongK + 1
- //LRSV = (Close - Lowest(Low,LRSVBars)) / (Highest(High,LRSVBars) - Lowest(Low,LRSVBars)) * 100
- LRSV = (Close - Lowest(Low,LongKBars)) / (Highest(High,LongKBars) - Lowest(Low,LongKBars)) * 100
- LK = (LK[MOD(BarCount,LongK)+1] *2 + LRSV ) /3
- LD = (LD[MOD(BarCount,LongK)+1] *2 + LK ) /3
-
- //Draw2(MK, "%mK",IFF(MK > MK[1],Red,Green))
- //Draw1(LK, "%lK",IFF(LK > LK[1],Red,Green))
- //Draw2(MK, "%mK",IFF(MK > MD,RGB(255,121,0),RGB(0,121,255)))
- //Draw1(LK, "%lK",IFF(LK > LD,RGB(255,232,0),RGB(0,232,255)))
- IF KTrend
- Then
- Draw2(MK, "%mK",IFF(MK > MK[1],RGB(255,0,121),RGB(0,255,121)))
- Draw1(LK, "%lK",IFF(LK > LK[1],RGB(255,0,232),RGB(0,255,232)))
- Else
- Draw2(MK, "%mK",IFF(MK > MD,RGB(255,0,121),RGB(0,255,121)))
- Draw1(LK, "%lK",IFF(LK > LD,RGB(255,0,232),RGB(0,255,232)))
- End IF
-
-
-
- Else
- //NODraw(2)
- //NoDraw(1)
- End IF
- //Draw3(MK, "M% K",RGB(181,55,171))
- //Draw4(LK, "L% K",Blue)
- TXT_Delete(Value6)
- IF SK > SlowD
- Then
- Value6 = Txt_New(Date,Time,25,space(15) + "↑S " + numtostr(SK - SlowD,2) )
- TXT_SetStyle( value6, 0, 0 )
- TXT_SetColor(Value6,Red)
- Else
- Value6 = Txt_New(Date,Time,25,space(15) + "↓S " + numtostr(SK - SlowD,2) )
- TXT_SetStyle( value6, 0, 0 )
- TXT_SetColor(Value6,Green)
- End IF
- TXT_Delete(Value7)
- IF MK > MD
- Then
- Value7 = Txt_New(Date,Time,55,space(15) + "↑M " + numtostr(MK - MD,2) )
- TXT_SetStyle( value7, 0, 0 )
- TXT_SetColor(Value7,Red)
- Else
- Value7 = Txt_New(Date,Time,55,space(15) + "↓M " + numtostr(MK - MD,2) )
- TXT_SetStyle( value7, 0, 0 )
- TXT_SetColor(Value7,Green)
- End IF
- TXT_Delete(Value8)
- IF MK > MD
- Then
- Value8 = Txt_New(Date,Time,90,space(15) + "↑L " + numtostr(LK - LD,2) )
- TXT_SetStyle( value8, 0, 0 )
- TXT_SetColor(Value8,Red)
- Else
- Value8 = Txt_New(Date,Time,90,space(15) + "↓L " + numtostr(LK - LD,2) )
- TXT_SetStyle( value8, 0, 0 )
- TXT_SetColor(Value8,Green)
- End IF
-
-
複製代碼 |
|