if
, for
, while
int
, float
, bool
, str
@indicator
, @algorithm
and others)raise
-ing exceptionslist
, tuple
. Indie requires explicit typing of
the contained itemstry
..except
constructwith
..as
constructlist
and tuple
are implemented partially. The other ones e.g. dict
and set
are not yet
implementedContext.calc_on
actually accepts a function as one of it’s arguments… But you cannot
write your own custom functions that do the same thingint32
), which means they can only hold values in the range from -2,147,483,648 to 2,147,483,647.
int32
range, you can sometimes use float
instead, which provides 64-bit double precision and can handle much larger values (though with potential precision loss for very large integers).
if
-statements, for
-loop blocks, and while
-loop blocks are not local variables,
and stay in scope outside of the block. Indie, on the other hand, has ‘block-level’ scoping which is very similar to
such languages like C/C++, Java, Go. For example, in Python it’s normal to write (but will fail to compile in Indie):
res
will not exist after the if
..else
statements. Moreover res
of the if
block is a different
variable than the res
from the else
block. So this example in Indie should be rewritten into:
None
valuesNone
value to a variable of any arbitrary type (e.g. basic data types). But it is
allowed to do so with the help of indie.Optional[T]
class. Read more about this
here.
Main
function which transforms into a Main
class inherited from indie.MainContext
.@algorithm
(more info here) which transform into classes inherited from indie.Algorithm
.Algorithm.new()
static method (e.g. indie.algorithms.Sma.new()
).MutSeries[T].new()
static method.@sec_context
decorator which transform into classes (similar to Main
) inherited from indie.SecContext
.indie
,
like indicator
, algorithm
, sec_context
, Series[T]
, etc.indie.algorithms
,
like Sma
, Ema
, Highest
, Lowest
, etc.math.pow
math.sqrt
math.nan
math.isnan
statistics.mean
statistics.fmean
statistics.median
None
, NoneType
, False
, True
, abs()
, bool()
, dict()
, float()
, int()
, len()
, list()
,
min()
, max()
, range()
, round()
, str()
, sum()
, tuple()
.