question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Monthly Liquidate - EOM issue

See original GitHub issue

The monthlyLiquidateRebalanceStrategy has an issue with the _end_of_month() function.

the statement end_day = calendar.monthrange(cur_time.year, cur_time.month)[1]will miss any month where the last day of the month is not a trading day. Taking the example of AGG, it would have missed July 2016 completely, since the last trading day was 29.07. while EOM was 31.07.

So the way I understand (or not understand, maybe it´s my issue) it, _end_of_month()only fires if the last trading day of the month is equal to the last day of the month. A possible fix would be to trigger on the first day of the new month, comparing the current event’s month with the month in the last event (if change, then new month).

What do you think? Should we build a more robust trading calendar functionality?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rsheftelcommented, Jan 25, 2017

Hello, its the author of pandas_market_calendars . I created this package because I had the exact needs you guys seem to have which was my motivation for creating it. I forked the code from the zipline project because their implementation was heavily interwoven with the entire zipline project, so I just pulled out the most essential pieces to keep this package lightweight.

The goal is a standard package for all global exchanges, OTC products, and allow holidays even by specific futures contracts (for example on the CME different contracts have different holidays or early-closes). Something similar to pytz for time zones, a single go-to package.

It would be great to work with you guys to make the package usable for both of our needs, that would keep more eyes on it and increase the reliability and completeness.

As for the Python3, I only cared about python 3 so I tested it on that, I don’t think there is anything major in here that would prevent it from running on python 2, and if so it would probably be a small change to make it work on both 2 and 3.

0reactions
rsheftelcommented, Mar 31, 2017

If you guys are still interested in the pandas_market_calendars it has been updated to support Python 2.7 in addition to Python3 now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Closer Look at Liquidation Timelines in MIAC's CORE ...
In the latest edition of MIAC Perspectives, we take a closer look at our methodology for handling Liquidation timelines.
Read more >
Complete Liquidations and Related Problems - CORE
Under principles to be exam- ined, the corporation ordinarily recognizes neither gain nor loss on the distribution of its assets in complete liquidation...
Read more >
Vanguard Capital Preservation Strategy: Effect Of Trade Day ...
It is shown that the best trade days are end-of-month (EOM) and first day of the next month (EOM+1). Trading on other days...
Read more >
BBBY - EOM announcement. How likely it is to ... - Reddit
So everyone is speculating about the EOM announcement of BBBY and at this point ... This means that they are not going bankrupt...
Read more >
STDCUSAC: CASA Account Balance Does Not Match ...
The issue can be reproduced at will with the following steps: 1. Have an IC product with Monthly liquidation
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found