I have the following problem using SQL Alchemy: I want to rank the stocks according to a relation between two fundamental values. As the size of the resultset is limited, the ranking should be done in the query itself. Now the problem is that I cannot find any information in the SQL Alchemy documentation (or the Quantopian documentation) on implementing something like
"SELECT (x - y) AS z
FROM table_name
ORDER BY z DESC"
without using the text function (and pure sql) which causes an import error.
Any help on this issue is greatly appreciated as it completly blocks my development at the moment.