Coder Social home page Coder Social logo

plutus-iv-org / plutus_backtest Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 1.0 423 KB

plutus_backtest is a python package for backtesting investment decisions using Python 3.6 and above.

License: Other

Python 100.00%
backtesting python stock-market portfolio trade daytrading finance risk-management accumulation stoploss-takeprofit

plutus_backtest's People

Contributors

illiaboloto avatar witmul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mariii333

plutus_backtest's Issues

Naming convention for buy and sell date

We probably gotta change the naming convention for buy and sell date, since we can also go shorting its meaning opposite buy is actually sell therefore we probably gotta switch it to start trade and end date (for example rows 51-52).

Clean code

Get rid of irrelevant functions that we are not going to use. (pricing, general view etc.)

Purchase stocks date (start_date)

When we ''purchase stocks" in all data frames the 1st row is 1 day before the start date. I may assume its the same issue as with close date.

Check Rows 80 & 82 if they are useless

We talked about it already yesterday, for now I leave them but I ll remove it in the future when we discuss about what I wrote

df_daily_returns["Total"] = df_daily_returns.sum(axis=1)
df_daily_returns["Cumulative return"] = (1 + df_daily_returns["Total"]).cumprod()

False values for close/open relationship

Buddy, please look carefuly the close(open)_first_row it has the values actually of the first line so basically we count correctly the close/open relationship only for 1st compny which is being started in our portfolio, others just have 0.

I may asume that we can resolve this one before creating pivots (for example we take the 1st row of each open dfs and add it to close dfs, then it will have 0 and 1 indexes having the same date but then the do pct_change and then after pivots, so pivot will already adjust all daily changes + close/open for the 1st day of the trading).

Issue with pip install

While installing library on jupiter (python 3.8.3) below issue appears:

Looking in indexes: https://test.pypi.org/simple/
Note: you may need to restart the kernel to use updated packages.

ERROR: Could not find a version that satisfies the requirement backt==0.1.0 (from versions: none)
ERROR: No matching distribution found for backt==0.1.0

SL TP downloader

To add the bottom allowing to download sl/tp dictionary if the dictionary isnt empty. Or if its even empty CSV file will contain only one line such as "No sl/tp lvls have been reached".

Functions are not linked together

I noted that general_statistic function will not work by itself.
self.final_portfolio need to be produced by running another (portfolio_construction) function.

We can include one function in another, so it will run relevant block of code automatically once called.

Optimisation of functions

Try to merge pricing, consolidated & consolidated_detailed functions into 1.

@IlliaBoloto mentioned - I think that creating 3 functions such as pricing, consolidated & consolidated_detailed doesn't really make a sense. I would rather make one big function. And would also help partially to solve the problem described in this issue .

3.0.0 Update

  1. Description to add
  2. Change calling function name
  3. Add separeted Accum return plot in calling function
  4. Create optiona parametr (full report - yes)
  5. Area to fix
  6. Check plotly express alternatives
  7. Set werkzeug as 2.0.0
  8. Html report to fix
  9. Delete download bottom
  10. Separate plots to different tabs
  11. Accum plot to diversify
  12. Readme
  13. Full check

Issue with 'open price' and 'close price' + 1st row

@IlliaBoloto mentioned that -

from row 45 we are loosing the conection b/w 'open price' and 'close price' since in Row 66 we take Adj close.

First line in daily returns (Row 81) was dropped which is not good. As the first line we need to add diff b/w close/open of the 1st trading day.

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.