Giter VIP home page Giter VIP logo

Comments (7)

dexhunter avatar dexhunter commented on June 23, 2024

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.

doxav avatar doxav commented on June 23, 2024

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.

dexhunter avatar dexhunter commented on June 23, 2024

@doxav The function is based on our paper.
screenshot_2017-12-09_01-08-29

More details are on 2.3 transaction cost

from pgportfolio.

ZhengyaoJiang avatar ZhengyaoJiang commented on June 23, 2024

I could suggest an implementation

Glad to hear your suggestion.

from pgportfolio.

doxav avatar doxav commented on June 23, 2024

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).

image

Same on function (13).

image

from pgportfolio.

kumkee avatar kumkee commented on June 23, 2024

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.

doxav avatar doxav commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.