Giter VIP home page Giter VIP logo

Comments (3)

htpeter avatar htpeter commented on June 15, 2024 3

@datatalking I wrote my own blotter.py script but its essentially the same as the examples file.

Blotter defaults to using Interactive Broker's TWS/Gateway so you'll need that up and running first. I also believe it may require MySQL be running locally.

The Blotter class has the following arguments and default values (I just copy pasted these below from the library's code).
I include this list so that you can make sure your IBKR TWS/Gateway is available on the expected Port and expected Client ID (you just have to make these values match between the API Settings in TWS and the Python code).

# Arguments you can include when instantiating `Blotter()` to make it work with TWS.
bport=4001, 
ibclient=999, 
ibserver="localhost",
# Arguments you can include when instantiating `Blotter()` to make it work with MySQL
dbhost="localhost", 
dbport="3306",
dbname="qtpy",
dbuser="root", 
dbpass="", 

And just for reference, here is the most basic version of blotter.py with some of the details I listed above explicitly added. Once everything is running, just run python blotter.py. If you run into errors related to IBKR connection or MySQL, double check those other pieces of software are configured as expected.

# blotter.py
from qtpylib.blotter import Blotter

class MainBlotter(Blotter):
    pass # we just need the name

if __name__ == "__main__":
    blotter = MainBlotter(
              bport=4001, 
              ibclient=999, 
              ibserver="localhost",
              dbhost="localhost", 
              dbport="3306",
              dbname="qtpy",
              dbuser="root", 
              dbpass="", 
    )
    blotter.run()

from qtpylib.

htpeter avatar htpeter commented on June 15, 2024

Hi @thesupershan, I too ran into this issue recently when trying to install via pip. My suggested solution, which it sounds like you have stumbled upon, is cloning and installing locally via python setup.py install. Feels safe to assume there may not be a fix pushed for this so you'll have to find a more permanent workaround in your own workflow. The maintainer is busy building other great software for us :).

More Info About the Error:
The pip installation error seems to be an existing issue that must be worked around. The cause is due to an unexpected value for the package_data in setup.py. The below thread includes individuals discussing it a bit more detail if curious.

#141 (comment)

from qtpylib.

datatalking avatar datatalking commented on June 15, 2024

@htpeter Once you did that. Instruction #1 says to create blotter.py.

The blotter script is the same one located in qtpylib/examples/blotter.py
Did you just cd examples then run blotter from there?

from qtpylib.

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.