Advertisement
dcuddihy-acr-me

kewr.acr.lan.issues.183

Aug 7th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. #
  2. # [kewr.acr.lan.issues.183](https://bitbucket.org/autonomy/kewr.acr.lan/issue/183)
  3. #
  4. set -x
  5.  
  6. echo "Started: " $(date)
  7.  
  8. source /etc/portion.env
  9. source /etc/profile.d/runtime-context.sh
  10.  
  11. echo $RUNTIME_CONTEXT
  12. echo $PYTHONPATH
  13. export PATH=$PATH:/opt/bbthyme/current/bin
  14. export TERM=xterm
  15.  
  16. export TEND='20140730'
  17.  
  18. #
  19. # https://bitbucket.org/autonomy/knyc.acr.lab/issue/338/november-delete-defunct-symbols-and-series
  20. #
  21. python << END
  22.  
  23. import mint.rest.RestClientKit as RC
  24. import pandas as pd
  25. from StringIO import StringIO
  26. import thyme.tx.TxResourceKit as TRK
  27. from thyme.tx.ResourceErrorKit import ResourceError
  28.  
  29. rc = RC.make()
  30. resp = rc.get_csv('http://rest.kewr.acr.lan:8080/tx/symbols?page=0&size=100000').text
  31. symbols_data = pd.read_csv(StringIO(resp))
  32. for symseries_name, dataframe in symbols_data.groupby('symbol-series-name'):
  33. symseries = TRK.SYMBOL_SERIES.read_by_name(name=symseries_name)
  34. if symseries.name.startswith('vol-smile'):
  35. for token in dataframe['token']:
  36. symbol = TRK.SYMBOLS.read_by_token(token=token, symbol_series=symseries)
  37. TRK.SYMBOLS.delete(symbol)
  38. TRK.SYMBOL_SERIES.delete(symseries)
  39.  
  40. END
  41.  
  42.  
  43.  
  44.  
  45.  
  46. #
  47. # https://bitbucket.org/autonomy/knyc.acr.lab/issue/358/november-backfill-new-event-series
  48. #
  49. cat > /tmp/new-deals << EOD
  50. /ticker/bccdbae index
  51. /ticker/ihni3m curncy
  52. /ticker/euri3m curncy
  53. /ticker/hkdi3m curncy
  54. /ticker/thbi3m curncy
  55. /ticker/trni3m curncy
  56. EOD
  57.  
  58. cat >/tmp/new-indexes << EOD
  59. /ticker/sp1 index
  60. /ticker/la1 comdty
  61. /ticker/co1 comdty
  62. /ticker/cc1 comdty
  63. /ticker/kc1 comdty
  64. /ticker/lp1 comdty
  65. /ticker/c 1 comdty
  66. /ticker/ct1 comdty
  67. /ticker/fc1 comdty
  68. /ticker/qs1 comdty
  69. /ticker/gc1 comdty
  70. /ticker/ho1 comdty
  71. /ticker/kw1 comdty
  72. /ticker/ll1 comdty
  73. /ticker/lh1 comdty
  74. /ticker/lc1 comdty
  75. /ticker/ng1 comdty
  76. /ticker/ln1 comdty
  77. /ticker/si1 comdty
  78. /ticker/s 1 comdty
  79. /ticker/sb1 comdty
  80. /ticker/xb1 comdty
  81. /ticker/w 1 comdty
  82. /ticker/cl1 comdty
  83. /ticker/lx1 comdty
  84. /ticker/la2 comdty
  85. /ticker/co2 comdty
  86. /ticker/cc2 comdty
  87. /ticker/kc2 comdty
  88. /ticker/lp2 comdty
  89. /ticker/c 2 comdty
  90. /ticker/ct2 comdty
  91. /ticker/fc2 comdty
  92. /ticker/qs2 comdty
  93. /ticker/gc2 comdty
  94. /ticker/ho2 comdty
  95. /ticker/kw2 comdty
  96. /ticker/ll2 comdty
  97. /ticker/lh2 comdty
  98. /ticker/lc2 comdty
  99. /ticker/ng2 comdty
  100. /ticker/ln2 comdty
  101. /ticker/si2 comdty
  102. /ticker/s 2 comdty
  103. /ticker/sb2 comdty
  104. /ticker/xb2 comdty
  105. /ticker/w 2 comdty
  106. /ticker/cl2 comdty
  107. /ticker/lx2 comdty
  108. /ticker/bcc2la0p index
  109. /ticker/bcc2co0p index
  110. /ticker/bcc2cc0p index
  111. /ticker/bcc2kc0p index
  112. /ticker/bcc2lp0p index
  113. /ticker/bcc2cn0p index
  114. /ticker/bcc2ct0p index
  115. /ticker/bcc2fc0p index
  116. /ticker/bcc2go0p index
  117. /ticker/bcc2gc0p index
  118. /ticker/bcc2ho0p index
  119. /ticker/bcc2kw0p index
  120. /ticker/bcc2ll0p index
  121. /ticker/bcc2lh0p index
  122. /ticker/bcc2lc0p index
  123. /ticker/bcc2ng0p index
  124. /ticker/bcc2ln0p index
  125. /ticker/bcc2si0p index
  126. /ticker/bcc2so0p index
  127. /ticker/bcc2sb0p index
  128. /ticker/bcc2rb0p index
  129. /ticker/bcc2wh0p index
  130. /ticker/bcc2cl0p index
  131. /ticker/bcc2lz0p index
  132. /ticker/spgsia index
  133. /ticker/spgsbr index
  134. /ticker/spgscc index
  135. /ticker/spgskc index
  136. /ticker/spgsic index
  137. /ticker/spgscn index
  138. /ticker/spgsct index
  139. /ticker/spgsfc index
  140. /ticker/spgsgo index
  141. /ticker/spgsgc index
  142. /ticker/spgsho index
  143. /ticker/spgskw index
  144. /ticker/spgsil index
  145. /ticker/spgslh index
  146. /ticker/spgslc index
  147. /ticker/spgsng index
  148. /ticker/spgsik index
  149. /ticker/spgssi index
  150. /ticker/spgsso index
  151. /ticker/spgssb index
  152. /ticker/spgshu index
  153. /ticker/spgswh index
  154. /ticker/spgscl index
  155. /ticker/spgsiz index
  156. /ticker/gddlit index
  157. /ticker/gddlsw index
  158. /ticker/gddlas index
  159. /ticker/gdletcf index
  160. /ticker/gdlesia index
  161. /ticker/gdlesthf index
  162. /ticker/gdlestk index
  163. /ticker/gecu2yr index
  164. /ticker/gnor2yr index
  165. /ticker/gecu5yr index
  166. EOD
  167.  
  168. bbg-update -m /tmp/new-indexes -b 19500101 -e ${TEND} -q index
  169. bbg-update -m /tmp/new-deals -b 19500101 -e ${TEND} -q deal
  170.  
  171.  
  172. #
  173. # https://bitbucket.org/autonomy/knyc.acr.lab/issue/364/november-backfill-new-deal-event-series
  174. #
  175. cat > /tmp/new-deals << EOD
  176. /ticker/bccdbae index
  177. /ticker/ihni3m curncy
  178. /ticker/euri3m curncy
  179. /ticker/hkdi3m curncy
  180. /ticker/thbi3m curncy
  181. /ticker/trni3m curncy
  182. EOD
  183. bbg-update -m /tmp/new-deals -b 19500101 -e ${TEND} -q deal
  184.  
  185.  
  186.  
  187.  
  188. echo "Finished: " $(date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement