Modified Heikin-Ashi指標 | Futu heikin ashi

FUTUREATM跳到主文尋找聖杯之路部落格全站分類:收藏嗜好相簿部落格留言名片Nov15Thu201202:09ModifiedHeikin-Ashi指標以上的兩圖是比較Mod-HAPaintBarStudy的不同,上圖在HTS裡可以找到code,而下圖是在TradeStation的supportcenter裡KAHUNA所改寫的.可以顯見的,KAHUNA多了個警告訊號的黃色,我自己還沒認真看過HTS的userquide所以還沒能改寫成適合HTS的code,日後有空再試試.....以下貼上KAHUNA的ModHA2PaintBar的code和兩個內含的function......有TS2000的同好可以運用.有誰改寫成STRATEGY的記得分享一下{ModHA2PaintBarStudy4/10/04DeterminesHAColorsfortwo(Min/Max)numberofComparebarsanddisplaystheUpColor(UpColor)iftheyaggreeintheUpdirection,displaystheDownColor(DnColor)iftheyaggreeintheDowndirection,anddisplaystheWarningColoriftheydonotagree.............KAHUNA}Inputs:UpColor(green),DnColor(red),WarnColor(yellow),MinCompBars(6),MaxCompBars(20),nPlotWidth(2);Vars:haClose(0),haOpen(0),haMinDir(0),haMaxDir(0),Color(0);{GetHADirectionforMin/MaxCompareBars}haMinDir=fModHAKahuna(MinCompBars,haOpen,haClose);haMaxDir=fModHAKahuna(MaxCompBars,haOpen,haClose);{LoadDisplayColor}ifhaMinDir=1andhaMaxDir=1thenbeginColor=UpColor;end;ifhaMinDir=2andhaMaxDir=2thenbeginColor=DnColor;end;ifhaMinDir<>haMaxDirthenbeginColor=WarnColor;end;{PaintBar}PlotPB(haOpen,haClose,"ModHA2",Color);SetPlotWidth(1,nPlotWidth);SetPlotColor(1,color);-------------------------------------------------------------------------------------FUNCTION:fModHAKahuna{ModHAValueFunction-4/10/04comparescurrentbaropentocloserangewithpriorbars...ifcurrentiswithinpriorthenUp/Downvalueremainsthesame}Inputs:CompBars(numericsimple),oOpenVal(numericref),{Output:HAOpenPrice}oCloseVal(numericref){Output:HAClosePrice};Vars:haClose(0),haOpen(0),haHigh(0),haLow(0),Index(0),UpVal(1),{Constant:UphaDirvalue}DownVal(2),{Constant:DownhaDirvalue}Return(0);ifBarNumber=1thenbeginhaOpen=open;haClose=(O+H+L+C)/4;haHigh=MaxList(high,haOpen,haClose);haLow=MinList(low,haOpen,haClose);endelse{BarNumber>1}beginhaClose=(O+H+L+C)/4;haOpen=(haOpen[1]+haClose[1])/2;haHigh=MaxList(High,haOpen,haClose);haLow=MinList(Low,haOpen,haClose);ifhaClose>haOpenthenReturn=UpValelseReturn=DownVal;forIndex=1toCompBarsbeginifhaOpen<=MaxList(h


常見投資理財問答


延伸文章資訊