require "Color"
require "TIlib"

$Names[0] = "基準"
$Colors[0] = $Red
$Names[1] = "転換"
$Colors[1] = $Green
$Names[2] = "先行1"
$Colors[2] = $Pink
$Names[3] = "先行2"
$Colors[3] = $SkyBlue
$Names[4] = "遅行"
$Colors[4] = $Blue

if !$Ichimoku 
    $Ichimoku = Ichimoku_new(9, 26, 52)
    Candle_draw($White, $Blue)
    Indicator(0, $Ichimoku[1])
    Indicator(1, $Ichimoku[3])
    Indicator(2, $Ichimoku[5])
    Indicator(3, $Ichimoku[7])
    Indicator(4, $Ichimoku[9])
else
    Ichimoku_next($Ichimoku)
    Ichimoku_fillKumo($Ichimoku, $Colors[2], $Colors[3])
    {-1}Ichimoku_repairCandle($White, $Blue)
    Candle_draw($White, $Blue)
    Ichimoku_draw($Ichimoku, $Colors[0], $Colors[1], $Colors[2], $Colors[3], $Colors[4])
    Indicator(0, $Ichimoku[1])
    Indicator(1, $Ichimoku[3])
    Indicator(2, $Ichimoku[5])
    Indicator(3, $Ichimoku[7])
    Indicator(4, $Ichimoku[9])
end
