A time series

This guide works through eight days of closing prices for one stock. It finds the day-to-day changes, running totals, moving averages, the running high and the worst drop from it, and it puts dates on the days.

prices := [100, 103, 103, 106, 106, 100, 103, 109]

Garo works on the whole series at once, like pandas or NumPy. There is no loop over the days.

Day-to-day changes

The local family, ㅎ, works on a sliding window. Its parameter is the window's width, and each output covers the window that ends at that position. With the bare form 하, you give the function for each window. For a window of 2, x is yesterday and y is today:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
{y - x}하 2 prices
⇒ [`none, 3, 0, 3, 0, -6, 3, 6]Try it

The first day has no yesterday, so its change is absent. In pandas this is prices.diff(), which puts NaN there.

Running totals

랃 is the running sum, and 랑 is the running mean. Here is the total of the daily changes so far, which is how far the price has moved since the first day. 닢 drops the absent first change before the scan:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
랃 닢 {y - x}하 2 prices
⇒ [3, 3, 6, 6, 0, 3, 9]Try it

Read it from the right: the changes, keep the present ones, then the running sum. The last value, 9, is 109 − 100.

Moving averages

항 w is the mean of each window of w, a moving average:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
항 3 prices
⇒ [`none, `none, 102.0, 104.0, 105.0, 104.0, 103.0, 104.0]Try it

That is pandas' prices.rolling(3).mean(). The first two days have no full window, so they are absent rather than a mean of fewer days. Garo will not quietly answer a different question. If you want those cells filled, say so with 깊:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
깊 0 (핟 3 prices)
⇒ [0, 0, 306, 312, 315, 312, 309, 312]Try it

핟 is the window sum. The other finals give the window's largest (학), smallest (한), product (할) and count (함).

The running high and the drawdown

락 is the running maximum: the highest price so far.

prices := [100, 103, 103, 106, 106, 100, 103, 109]
락 prices
⇒ [100, 103, 103, 106, 106, 106, 106, 109]Try it

The drawdown is how far the price sits below that high. Subtract:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
prices - 락 prices
⇒ [0, 0, 0, 0, 0, -6, -3, 0]Try it

The worst drawdown is the smallest of those:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
단 (prices - 락 prices)
⇒ -6Try it

As a fraction of the high, so a drop of 6 from 106 is about 5.7%:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
단 (prices - 락 prices) ÷ 락 prices
⇒ -0.05660377358490566Try it

Up days

A comparison gives a Bool per day, and 닞 (select, index) gives the positions of the true ones:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
닞 ({y - x}하 2 prices) > 0
⇒ line 2: !type: the criterion is absent for some unit: skip absent elements first (닢) or fill them (깊) (D47.5)Try it

That failed because the first change is absent, so its comparison is absent too, and 닞 needs a plain Bool for every day. Fill the absent change with 0 first:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
닞 (깊 0 ({y - x}하 2 prices)) > 0
⇒ [1, 3, 6, 7]Try it

The price rose on days 1, 3, 6 and 7, counting from 0.

Dates

Garo has a Date type. You make a date with Date [year, month, day] and a span of days with Days n. A date plus a span is a date:

(Date [2026, 11, 2]) + Days 30
⇒ Date [2026, 12, 2]Try it

The parentheses matter. Without them, the line would read from the right as Date ([2026, 11, 2] + (Days 30)).

To date the series, add 0, 1, 2 and so on days to the first day. 튿 n gives the whole numbers 0 up to n − 1:

start := Date [2026, 11, 2]
{start + Days x}기 (튿 8)
⇒ [Date [2026, 11, 2], Date [2026, 11, 3], Date [2026, 11, 4], Date [2026, 11, 5], Date [2026, 11, 6], Date [2026, 11, 7], Date [2026, 11, 8], Date [2026, 11, 9]]Try it

The day of the highest close is the date at the position of the largest price. 엄 0 샂 깃 prices is that position, as in the neural network guide:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
dates := {(Date [2026, 11, 2]) + Days x}기 (튿 8)
엄 (엄 0 샂 깃 prices) dates
⇒ Date [2026, 11, 9]Try it

And 앰 looks a price up by its date, with the dates as keys:

prices := [100, 103, 103, 106, 106, 100, 103, 109]
dates := {(Date [2026, 11, 2]) + Days x}기 (튿 8)
앰 (Date [2026, 11, 7]) dates prices
⇒ 100Try it

One date minus another is a span of days. Dates sort, and 닥 and 단 give the latest and earliest:

dates := {(Date [2026, 11, 2]) + Days x}기 (튿 8)
(닥 dates) - 단 dates
⇒ Days 7Try it

Garo has no time of day yet, only whole dates.

What you used

StepGaropandas
change from the day before{y - x}하 2 pp.diff()
running sum, running max랃 p, 락 pp.cumsum(), p.cummax()
moving average항 3 pp.rolling(3).mean()
fill or drop missing깊 0 p, 닢 pp.fillna(0), p.dropna()
positions where true닞 bnp.flatnonzero(b)
a date, a span of daysDate [y, m, d], Days npd.Timestamp, pd.Timedelta