# Option (indicator) module template One Python file, same sandbox rules as idea files (numpy/pandas/math only, no files/network, no names starting with `_`). ```python NAME = "moving_averages" # lowercase english id: letters, digits, _ (used as opt.(df) in idea files) TITLE = "متوسطات متحركة" # short Arabic label shown on the site DESCRIPTION = "EMA/SMA بأطوال مختلفة. المخرجات: ma1, ma2" # Arabic: what it does + the output keys PARAMS = {"len1": {"default": 9, "min": 1, "max": 1000, "label": "الطول 1"}, "kind": {"default": "ema", "choices": ["ema", "sma"], "label": "النوع"}} # every parameter needs a default (number, string or bool) OVERLAY = True # True = drawn on the price chart (same scale as price); False = separate panel (e.g. RSI, volume) OUTPUTS = ["ma1"] # names of the returned arrays import numpy as np import pandas as pd def compute(df, len1=9, kind="ema"): # keyword arguments = PARAMS keys, same defaults # df columns: time (UTC), open, high, low, close, volume, ticks - closed bars of the chosen timeframe # return a dict of 1-D arrays, each the same length as df, CAUSAL (row i uses rows <= i only; no shift(-1), no centered windows) ... return {"ma1": values} ```