Coder Social home page Coder Social logo

data interval about pgportfolio HOT 8 CLOSED

zhengyaojiang avatar zhengyaojiang commented on August 16, 2024
data interval

from pgportfolio.

Comments (8)

AhmMontasser avatar AhmMontasser commented on August 16, 2024

i think it's not hard coded, there is a file called constants.py which contains declarations for more time intervals. Although the 5 minutes constant is given as a default value, you can change it while declaration.

from pgportfolio.

dexhunter avatar dexhunter commented on August 16, 2024

Can it be configured for 1 minute or 1 hour / day by using other data sources?

Sure, you can integrate broker's api to our framework. Replace pgportfolio/marketdata/poloniex.py with your desired broker. And change period at HistoManager from globaldatamatrix

from pgportfolio.

ZhengyaoJiang avatar ZhengyaoJiang commented on August 16, 2024

Please note that 5 minutes is how the programme store the data, which is the minimum data interval of candle stick data on poloniex.
You can easily configure the interval of trading and observation by setting the "global_period" attribute in "net_config.json". The "global_period" should be a integer of multiple of 300.

from pgportfolio.

laci84 avatar laci84 commented on August 16, 2024

I have ohlc data with 1 min resolution in csv. How can I train a network on it? Custom loader, param config?

from pgportfolio.

ZhengyaoJiang avatar ZhengyaoJiang commented on August 16, 2024

I have ohlc data with 1 min resolution in csv. How can I train a network on it? Custom loader, param config?

In that case, you just need to rewrite the globaldatamatrix (in particular, the get_global_data_panel method).
I think that won't be too difficult, just load csv using pandas and then transform it into a panel. While If you want to keep the functionality of assets selection work, you might also need to modify the select_coins method.

from pgportfolio.

pisiiki avatar pisiiki commented on August 16, 2024

Hello, thanks for sharing the code.

I wonder if the self.__checkperiod call inside get_global_panel is not too restrictive.
Would period%300 == 0 work or does it need more db code, sums, etc.?

Regards.

from pgportfolio.

ZhengyaoJiang avatar ZhengyaoJiang commented on August 16, 2024

I wonder if the self.__checkperiod call inside get_global_panel is not too restrictive.
Would period%300 == 0 work or does it need more db code, sums, etc.?

Yes, the self.__checkperiod is already out of date.
I think period%300 == 0 should work on the new code.

from pgportfolio.

redzhepdx avatar redzhepdx commented on August 16, 2024

I want to ask a question about this sql query in the part of getting data from DB to pandas panel:
I think this query takes datas in range : [start_date + 300 sec, end_date - 300 sec]
It is ok for backtesting but I think need to update for real time testing, isn't it ?

sql = ("SELECT date+300 AS date_norm, close FROM History WHERE"
                               " date_norm>={start} and date_norm<={end}" 
                               " and date_norm%{period}=0 and coin=\"{coin}\"".format(
                               start=start, end=end, period=period, coin=coin))

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.