tag:blogger.com,1999:blog-261139923818144971.post3273369877720397362..comments2024-03-27T07:58:49.946+00:00Comments on This Blog is Systematic: Playing with Docker - some initial results (pysystemtrade)Rob Carverhttp://www.blogger.com/profile/10175885372013572770noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-261139923818144971.post-288799379662236302021-11-02T11:26:46.880+00:002021-11-02T11:26:46.880+00:00ok, thanksok, thanksdr1verhttps://www.blogger.com/profile/07207779413866318164noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-17435579725246542082021-11-02T11:02:54.145+00:002021-11-02T11:02:54.145+00:00No this post is as far as I got.No this post is as far as I got.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-25744848894284980082021-11-02T10:54:31.236+00:002021-11-02T10:54:31.236+00:00Hi Rob,
Are you still using Docker? If not, why d...Hi Rob,<br /><br />Are you still using Docker? If not, why did you not go ahead with it?<br />From a personal perspective, I'm thinking of using Docker as I'm doing Dev on a Windows 10 machine, thinking of deploying on Linux, plus pysystemtrade is tested on Linux rather than Windows.dr1verhttps://www.blogger.com/profile/07207779413866318164noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-82624162781581830212017-04-10T17:50:54.891+01:002017-04-10T17:50:54.891+01:00While it's not clear they use it for front off...While it's not clear they use it for front office systems, your former employers competitor posted recently about containerised services recently. Clearly smart minds think alike!!<br /><br />https://tech.winton.com/blog/2017/04/continuous-deployment-of-containerised-microservicAnonymoushttps://www.blogger.com/profile/09293911372417560867noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-84368085628136239942017-02-28T06:31:56.138+00:002017-02-28T06:31:56.138+00:00That's a really interesting article. I guess t...That's a really interesting article. I guess the key takeaway for me is not to build something that relies on docker being present; or to put it another way to create services that can run inside or outside of a container. I'd planned to do this anyway, as I'm releasing everything open source I don't think its fair to force a particular architecture on other users. I'm using Linux Mint which is Ubuntu based FWIW. I'd also always planned to create daily copies of the data normally inside any docker volumes on to a real file system somewhere, since I never really trusted the idea of a docker volume wholeheartedly.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-50113572300339949882017-02-27T21:29:29.384+00:002017-02-27T21:29:29.384+00:00There's a recent discussion thread over at nuc...There's a recent discussion thread over at nuclearphynance about Docker, and seems the sentiment about its actual ease of deployment is mixed, and one comment linked to this blog (a fellow Londoner, Rob, got to count for something right): https://thehftguy.com/2017/02/23/docker-in-production-an-update/<br /><br />Seems he's quite sour to Debian/Ubuntu, Cent OS, and so on.<br /><br />My dedicated server is running CentOS7 due to RHEL-only Linux support for Rithmic API...I'd considered using Docker but abandoned the idea until later...maybe Xen/LXD would be a good alternative?Chad Bhttps://www.blogger.com/profile/13026562498196984544noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-31580884736882802302017-01-26T06:16:11.065+00:002017-01-26T06:16:11.065+00:00This comment has been removed by the author.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-5196961998787581922017-01-25T22:25:03.613+00:002017-01-25T22:25:03.613+00:00So, I've been trying this entire day to make t...So, I've been trying this entire day to make this work, unfortunately I cannot figure this out. I know your very busy and have more important things to do but I can I email you my code snippet n sample of the data I am working with for some help? <br /><br />This is an act of desperation.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-38667547864633862132017-01-25T18:03:07.480+00:002017-01-25T18:03:07.480+00:00Thank you so much. It is more than appreciated.Thank you so much. It is more than appreciated.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-82454147540433583572017-01-25T17:21:21.035+00:002017-01-25T17:21:21.035+00:00YesYesRob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-56485634719302469052017-01-25T17:11:51.054+00:002017-01-25T17:11:51.054+00:00Okay great. Then each day during the month its jus...Okay great. Then each day during the month its just multiplying the # of contracts by the contract values?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-22447001321678737812017-01-25T16:42:58.267+00:002017-01-25T16:42:58.267+00:00Position = how many actual shares or futures contr...Position = how many actual shares or futures contracts you hold.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-13526297136795664302017-01-25T16:06:00.535+00:002017-01-25T16:06:00.535+00:00Pardon my naivete, but what do you mean by positio...Pardon my naivete, but what do you mean by positions?<br /><br />Thank you for responding, btw.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-3882566473288773072017-01-25T16:01:44.385+00:002017-01-25T16:01:44.385+00:00The code is correct. You need to forward fill your...The code is correct. You need to forward fill your positions, not your weights. Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-26079207830381409062017-01-25T15:54:20.837+00:002017-01-25T15:54:20.837+00:00Yes, but isn't that just daily rebalancing. Fo...Yes, but isn't that just daily rebalancing. For instance, if I rebalance on 1/30 to a weight of 50% for market A and 50% for market B and I have $100, for example. Then on 2/1 the price for market A goes up 10% and market B is flat. So market A is now $50 * 1.1 = $55 and market B is still $50. So now my weight for market A is $55 / $105($55 + $50) is ~52% and market B is ~48%. Using your method it would say 50%/50% which is just daily rebalancing. <br /><br />Maybe I asked poorly. But I am trying to simulate what my weights and returns would be on a daily basis if I rebalance once a month without rebalancing at all between those periods. <br /><br />Using the example above, for instance, on 2/1 to find out what my weights "should" be I would see 52%/48% not 50%/50% and the returns for 2/2 would be based on the 52%/48% weights at EOD 2/1.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-21779719666043027852017-01-25T15:35:44.793+00:002017-01-25T15:35:44.793+00:00import pandas as pd
positions=pd.DataFrame(...mon...import pandas as pd<br /><br />positions=pd.DataFrame(...monthly...)<br />prices=pd.DataFrame(...daily...)<br /><br />positions=positions.reindex(prices.index, method="ffill")<br /><br />Will work for any day of rebalancing.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-90072349211517413002017-01-25T15:30:21.467+00:002017-01-25T15:30:21.467+00:00Thank you for your response.
I hate to be a pest,...Thank you for your response.<br /><br />I hate to be a pest, but would you mind demonstrating how this is done in python? There's nothing on the internet about how to do this(atleast that I've found). It would be greatly appreciated. It also gets tricky because I don't rebalance on the end of each month e.g the 10th trading day of the month.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-10663052112033208462017-01-25T09:26:09.777+00:002017-01-25T09:26:09.777+00:00A: Simulate it mark-to-market on a daily basis.
...A: Simulate it mark-to-market on a daily basis. <br /><br />Otherwise you'll be changing the behaviour of your strategy. <br /><br />You basically want to forward fill your positions from month start to month end after matching them against the data frame of prices.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-51970587733061792622017-01-25T03:41:48.370+00:002017-01-25T03:41:48.370+00:00Hi Rob,
Great article!
Just a basic question abo...Hi Rob,<br /><br />Great article!<br /><br />Just a basic question about backtesting strategies, particularly monthly rebalanced strategies. <br /><br />Say you have a strategy that gets rebalanced the last day of each month. Typically, you just run the weights on next months returns and have a monthly returns stream. However, what if you'd wanted insights about how the strategy performed on a daily basis. To do that would you simulate it as though you rebalanced daily using the most recent weights? Or would you simulate it mark-to-market on a daily basis?<br /><br />If the latter, is there an efficient way to do this?<br /><br />Thank you so much.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-32223489989386660192017-01-24T11:09:14.399+00:002017-01-24T11:09:14.399+00:00What I wanted to say is that you can treat your in...What I wanted to say is that you can treat your infrastructure as disposable and you throw it way and rebuild it anytime you like. "Pets vs. Cattle"<br /><br />As opposed to manually installing the OS, manually installing the software, manually configuring the software, time consuming installation and setup process, dependent on one server and that is seen as being fragile and need be careful taken care of.Anonymoushttps://www.blogger.com/profile/02134903814759067759noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-88095576378707049092017-01-24T10:58:45.607+00:002017-01-24T10:58:45.607+00:00I would object. Using Docker and following the par...I would object. Using Docker and following the paradigm of "Infrastructure as Code" brings a lot of benefits and flexibilty. Using a build tool like make/cmake/ansible/ant/puppet/etc to automatically manufacture your container and uploading it to a remote registry, you are then able to run your software from anywhere in the world on any computer, cluster or cloud supporting Docker. Not only good from a development standpoint but aklso great from a disaster recovery perspective if you physical machine goes down you will be rapidly up and running on some other place with minimal downtime.Anonymoushttps://www.blogger.com/profile/02134903814759067759noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-44290735502014866122017-01-22T18:08:18.594+00:002017-01-22T18:08:18.594+00:00Thanks for commenting; I guess I'll be able to...Thanks for commenting; I guess I'll be able to evaluate when I start using it in anger.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-62274371575843865082017-01-22T11:58:59.674+00:002017-01-22T11:58:59.674+00:00As someone who works with docker daily, I'd re...As someone who works with docker daily, I'd recommend against it in this case. You have a mostly static environment and the added complexity well just add to your maintenance work. My recommendation would be a solid config management tool like ansible to provision your servers and for you to standardise on an os, like centos 7.Sunyinhttps://www.blogger.com/profile/15389008462988647770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-64842403076411858822017-01-20T13:18:07.575+00:002017-01-20T13:18:07.575+00:00Thanks. This is obviously the best solution.Thanks. This is obviously the best solution.Rob Carverhttps://www.blogger.com/profile/10175885372013572770noreply@blogger.comtag:blogger.com,1999:blog-261139923818144971.post-84702048620971909942017-01-20T12:58:05.230+00:002017-01-20T12:58:05.230+00:00Problem: running as a specific USER gives me permi...Problem: running as a specific USER gives me permission issues<br /><br />I believe this is due to UNIX filesystem access rights. User and group ownership of the directories and files is not the same on the host as in the container.<br /><br />This is solved by setting the same numeric user id and group id on the directories and files on the host filesystem as the user have in the container. You can change it recursively on the host filesystem with: chown -R : , the uid and gid numbers you can find by logging into the container with "docker exec" and issueing "id ", the actual info is stored in /etc/group and /etc/passwd text files.<br /><br />Another way to do it is to make the directories and files on the host filesystme writable for everyone, chmod -R o+w , this is of course less good from a security standpoint, but it will solve your problem.Anonymoushttps://www.blogger.com/profile/02134903814759067759noreply@blogger.com