Skip to content

Instantly share code, notes, and snippets.

@hmanish
Last active August 29, 2015 14:10
Show Gist options
  • Save hmanish/4b86ad49624ac09bdc16 to your computer and use it in GitHub Desktop.
Save hmanish/4b86ad49624ac09bdc16 to your computer and use it in GitHub Desktop.
pos reverse lookup
=> (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}
}
}
=> (gen-lookup pos-data trade)
=> {["NG NYMEX" nil] {111111111 {:long [123]}
222222222 {:long [123]}
}
["IF For LD1 CG" nil] {111111111 {:short [123]}
222222222 {:short [123]}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment