FROM Table AS t WHERE t.Condition SELECT t.col1, t.col2, ...
might be more natural than the traditional SELECT t.col1, t.col2, ... FROM Table AS t WHERE t.Condition
If we compare it with how loop are described in programming languages: Loop -> SELECT-FROM-WHERE
Table -> Collection
AS t -> Loop instance variable
WHERE -> condition on instances
In Java and many other PLs, we write loops as follows: foreach x in Collection
if x.field == value:
continue
// Do something with x, for example, return in a result set
So we first define the collection (table) we want to process elements from. Then we think about the condition they have satisfy by using the instance variable. And finally in the loop body we do whatever we want, for example, return elements which satisfy the condition. for x in Collection:
Python list comprehension however uses the traditional order: [(x.col1, x.col2) for x in Collection if x.field2 == value]
Here we first specify what we want to return, then collection with condition. prosto.column_sql(
"CALCULATE Sales(quantity, price) -> amount",
lambda x: x["quantity"] * x["price"]
)
In this Column-SQL statement we define a new calculated column the values of which are computed in Python (as a sum of two columns). An advantage is that we can process data in multiple tables without joins or groupbys which is much easier than in the existing set-oriented approaches. Another advantage is that we can combine many statements by defining a workflow in an Excel-like manner.
https://github.com/asavinov/intelligent-trading-bot
It trains ML models based on historic data and custom features and then uses them to generate a kind of intelligent indicator between -1 and +1. This intelligent indicator is then used to make trade decisions. Frequency is a parameter and can vary from 1 minute for crypto trading to 1 day for normal exchanges.