NagarajuGunda / PyAlgoMate

114 stars 69 forks source link

How to use this module? #1

Closed Morakhiyasaiyam closed 10 months ago

Morakhiyasaiyam commented 10 months ago

Hey I have successfully installed this module as your readme instructions ! But how to access it ? What is starting point ? many script throwing error for invalid path of backtest module which is not currently present in backtest folder ? And also there is streamlit folder with files ? But how to operate them ? I can start streamlit server app but its doing nothing?

NagarajuGunda commented 10 months ago

I am glad you asked. I will be adding more steps to READ me on how to use it. Meanwhile you can explore the following things for you to get started

There are two ways you can run a backtest.

  1. By doing changes to backtest.py (I will be removing this file in coming days)
  2. By CLI way, running the strategy file directly

Since, I will be removing the first method, let me talk about second method

Before running the following command, one needs to set an environment variable called PYTHONPATH so that the pyalgomate module can be found by python

export PYTHONPATH=path to pyalgomate directory on Unix set PYTHONPATH=path to pyalgomate directory on Windows

After this, you can run any strategy file which has CLI capability in the following way

python pyalgomate/strategies/SuperTrendRSIV1.py backtest --data "path to parquet file" --underlying BANKNIFTY

You can see what are the other options that the CLI supports by running

python pyalgomate/strategies/SuperTrendRSIV1.py --help python pyalgomate/strategies/SuperTrendRSIV1.py backtest --help

image

NagarajuGunda commented 10 months ago

@Morakhiyasaiyam I have updated the README as well. Let me know if you still face any issues