Comments (7)
shouldn't it check at least whether any coin qty adjustment would cost more transaction fees than the expected value adjustment
I think it's a good suggestion, especially for the live-trading. What do you think @ZhengyaoJiang
from pgportfolio.
I could suggest an implementation but I don't understand the logic of calculate_pv_after_commission
and especially: mu1 = (1 - commission_rate * w0[0] - (2 * commission_rate - commission_rate ** 2) * np.sum(np.maximum(w0[1:] - mu1*w1[1:], 0))) / (1 - commission_rate * w1[0])
.
from pgportfolio.
@doxav The function is based on our paper.
More details are on 2.3 transaction cost
from pgportfolio.
I could suggest an implementation
Glad to hear your suggestion.
from pgportfolio.
Therefore, could you clarify the basis of this function:
In function (12): considering that factor u_t should already include all transaction fees, why do we multiply by (1 - Cs).
Same on function (13).
from pgportfolio.
Therefore, could you clarify the basis of this function:
For (12), let's consider only one asset that needs to sell. Before reallocation, you have total fund p', and p'.u after.
So the value of the asset in consideration is p'.w' before reallocation and p'.u.w after. You can think of p'.u.w as the target value want to achieve after selling.
Expression (12) without the (1-c) factor is then the difference between that asset's initial and target values. By performing this selling, we will get cash of an amount (1-c) times this difference.
If you do get (12), (13) follows the same logic.
from pgportfolio.
On further consideration, it really depends on RL behavior. There is no transaction on which fees would exceed per coin adjustment but the matter is on movements between coins. It is difficult to arbitrate among coins movements (the 2 lowest adjustment?), an obvious case is when the total portfolio adjustment costs more in fees than in expected gains. It would mean just to cancel adjustment when it lowers the capital at date ? On forecasted capital ? Still RL reco might anticipate a future capital growth with fees included. This is obviously what the loss function is doing.
from pgportfolio.
Related Issues (20)
- User Guide Plot HOT 2
- Three questions HOT 2
- Does your model support no-transction allowed periods
- Meaning of figures like 0.00900002 in SqlLite history table for ETH
- pandas panel HOT 3
- mu might be miscalculated
- A Error in data Processing HOT 1
- validation set and hyperparameters tuning
- question about decide_by_history
- Lower portfolio values for recent dates(e.g. "start_date":"2018/08/17", "end_date":"2020/11/19") HOT 1
- ERROR:root:the sqlite error happend HOT 1
- TypeError: object() takes no parameters HOT 1
- Conversion of globaldatamatrix panel to Dataframe (panel is deprecated) HOT 4
- Fix: train_summary.csv not generated
- Normalization on open price HOT 1
- Problem of dtype arguments
- How to run this agent
- KeyError: 'BTS_BTC' HOT 7
- when I download the data. KeyError: 'BTS_BTC' what is the problem? HOT 5
- non-resource variables are not supported in the long term HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pgportfolio.