This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> (def trade {:id 123 :stl_idx_1 {}.....}) | |
=> (compute-positions trade) | |
=> {["NG NYMEX" nil] {111111111 {:long 10000} | |
222222222 {:long 10000} | |
} | |
["IF For LD1 CG" nil] {111111111 {:short 100000} | |
222222222 {:short 100000} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn compute-position | |
"returns a map | |
key is a vector -[ <settlement index name> <power primitive name>] | |
value is a map - {<Millis corresponding to yyyy-MM> {<:long|:short> <Double: the positon>} } | |
For non power trades, primitive name will be nil" | |
[trade] | |
;;compute postion code) | |