Replies: 1 comment 4 replies
-
Did you get to review the API reference, namely |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am new to the backtesting and trading field, however, this package is great! The center of my problem revolves around keeping a certain percentage of my portfolio always invested. I want to make normal trades based on moving averages, however, I never want my portfolio to own less than 20% of the asset. I understand the buy function allows me to buy based on a certain percentage of liquidity, however, I want to sell based on my percentage of assets. I know I am able to get the total equity, so if there was a way to track my asset amount, that would work great. In my code I have a variable
asset_value
which would solve my issue I believe, so the script is written like It is a valid variable. I would also like to know more about the sell function, what would happen if had a size < 1 like it would be in my code below? I would appreciate any advice for keeping a certain percentage invested, and how I should approach this. Thank you.Beta Was this translation helpful? Give feedback.
All reactions