edtechre / pybroker

Algorithmic Trading in Python with Machine Learning

Home Page:https://www.pybroker.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question from the Rebalancing example

tsunamilx opened this issue · comments

So from the example https://www.pybroker.com/en/latest/notebooks/9.%20Rebalancing%20Positions.html

The rebalancing is handled in the "after_exec" func, but I am thinking should it be in the "before exec" func since it takes place at the beginning of the month (I assume it is the beginning of the first day of the month)?

Unless you particularly want the rebalancing happen at the end of the first day of the month.

Hi @tsunamilx,

Before exec and after exec will run for the same bar. The difference is one runs before all of the execution functions, and the other after.