|
SwamiStochastics
請參考5分鐘K圖下方,黃色區域表示有轉折的機會,紅色區域應該看多,綠色區域則看空。
我把原本程式碼 (出處 http://www.amibroker.com/members/traders/03-2012.html)
紅和綠作修改(因為台灣是紅漲 綠跌),再加上Section 宣告而已。
程式碼如下:
_SECTION_BEGIN("SwamiStochastics");
Title = "SwamiStochastics";
for( N = 6; N <= 48; N++ )
{
indicator = StochK( N, 4 ) / 100; // Replace this line with the indicator of your choice, for example RSI( N )
green = IIf( indicator >= 0.5, 255 * ( 2 - 2 * indicator ), 255 );
red = IIf( indicator < 0.5, 255 * 2 * indicator, 255 );
blue = 0;
Color = ColorRGB( red, green, blue );
PlotOHLC( N, N+1, N, N, "", Color, styleCloud | styleNoLabel );
}
_SECTION_END();
|
|