Skip to content

Instantly share code, notes, and snippets.

@hmanish
Last active August 29, 2015 14:09
Show Gist options
  • Save hmanish/080d8fe7b6bcf3508e8e to your computer and use it in GitHub Desktop.
Save hmanish/080d8fe7b6bcf3508e8e to your computer and use it in GitHub Desktop.
Sample outputs of calling computePosition on different trade types
(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)
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Sample Outputs ;;;;;;;;;;;;;
;; sample output for a gas trade
{["NG NYMEX" nil] {1232132142 {:long 4000}
2342342344 {:long 2000}
...
...
...}
}
;; sample output for a power trade
{["PJM WH RealTime" "Peak 2x16"] { 3453453453 {:short 50000}
34235345 {:short 20000}
...
...
...
...}}
;; sample output for trades with multiple indexes
{["NG FP for GDD Malin" nil] {436346346 {:long 30000}
346346454 {:long 250000}
...
...
...
}
["PJM WH RealTime" "Peak 2x16"] {346234464 {:short 50000}
346346456 {:short 30000}
..
...
...}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment