quantitative-finance

FIX message delimiter

三世轮回 提交于 2019-11-30 08:00:57
问题 I am relatively new to FIX-Protocol. The delimiter for a FIX-Protocol message sometimes show ^ and other times |. Wikipedia for FIX-Protocol says [SOH] ( < Start of Header > for hex 0x01 ) being the character. Please explain the meaning of the same. For example a FIX-Protocol message can be visually represented as 8=FIX.4.4^9=122^35=D^34=215^49=CLIENT12^52=20100225-19:41:57.316^56=B^1=Marcel^11=13346^21=1^40=2^44=5^54=1^59=0^60=20100225-19:39:52.020^10=072^ or 8=FIX.4.4|9=122|35=D|34=215|49

Combining time-series objects and lists: Package “termstrc”

ぃ、小莉子 提交于 2019-11-29 23:00:57
问题 The R package "termstrc", designed for term-structure estimation, is an incredibly useful tool, but it requires data to be set in a particularly awkward format: lists within lists. Question : What is the best way to prepare and shape data, either outside R or inside R, in order to create the repeated sublist format required to run the function "dyncouponbonds"? The "dyncouponbonds" command requires data to be set in a repeated sublist, whereby a list of bonds and time-invariant features of

FIX message delimiter

蹲街弑〆低调 提交于 2019-11-29 05:50:28
I am relatively new to FIX-Protocol. The delimiter for a FIX-Protocol message sometimes show ^ and other times |. Wikipedia for FIX-Protocol says [SOH] ( < Start of Header > for hex 0x01 ) being the character. Please explain the meaning of the same. For example a FIX-Protocol message can be visually represented as 8=FIX.4.4^9=122^35=D^34=215^49=CLIENT12^52=20100225-19:41:57.316^56=B^1=Marcel^11=13346^21=1^40=2^44=5^54=1^59=0^60=20100225-19:39:52.020^10=072^ or 8=FIX.4.4|9=122|35=D|34=215|49=CLIENT12|52=20100225-19:41:57.316|56=B|1=Marcel|11=13346|21=1|40=2|44=5|54=1|59=0|60=20100225-19:39:52

Convert data to OHLC (Open, High, Low, Close) in JavaScript?

£可爱£侵袭症+ 提交于 2019-11-28 12:54:34
Similar to create an OHLC data from Date, time, price using C# , how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to this distinct case? var data = [{ "tid": 283945, "date": 1384934366, "amount": "0.08180000", "price": "501.30" }, { "tid": 283947, "date": 1384934066, "amount": "0.06110000", "price": "490.66" }, ... ]; function convertToOHLC(data) { // What goes here? } convertToOHLC(data); Here is the fiddle: https://jsfiddle.net/5dfjhnLw/ This is a working function for converting the data to OHLC: function convertToOHLC(data) { data

Convert data to OHLC (Open, High, Low, Close) in JavaScript?

我与影子孤独终老i 提交于 2019-11-27 07:18:08
问题 Similar to create an OHLC data from Date, time, price using C#, how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to this distinct case? var data = [{ "tid": 283945, "date": 1384934366, "amount": "0.08180000", "price": "501.30" }, { "tid": 283947, "date": 1384934066, "amount": "0.06110000", "price": "490.66" }, ... ]; function convertToOHLC(data) { // What goes here? } convertToOHLC(data); Here is the fiddle: https://jsfiddle.net

Calculate max draw down with a vectorized solution in python

吃可爱长大的小学妹 提交于 2019-11-27 00:31:42
问题 Maximum Drawdown is a common risk metric used in quantitative finance to assess the largest negative return that has been experienced. Recently, I became impatient with the time to calculate max drawdown using my looped approach. def max_dd_loop(returns): """returns is assumed to be a pandas series""" max_so_far = None start, end = None, None r = returns.add(1).cumprod() for r_start in r.index: for r_end in r.index: if r_start < r_end: current = r.ix[r_end] / r.ix[r_start] - 1 if (max_so_far