require "Color"
require "TIlib"

$Names[0] = "EMA(5)"
$Colors[0] = $Red
$Names[1] = "EMA(25)"
$Colors[1] = $Green
$Names[2] = "EMA(75)"
$Colors[2] = $Blue

Candle_draw($White, $Blue)

if !$EMA5
    $EMA5 = EMA_new(5)
else
    EMA_next($EMA5)
    EMA_draw($EMA5, $Colors[0])
end
Indicator(0, $EMA5[1])

if !$EMA25
    $EMA25 = EMA_new(25)
else
    EMA_next($EMA25)
    EMA_draw($EMA25, $Colors[1])
end
Indicator(1, $EMA25[1])

if !$EMA75
    $EMA75 = EMA_new(75)
else
    EMA_next($EMA75)
    EMA_draw($EMA75, $Colors[2])
end
Indicator(2, $EMA75[1])
