Code Monkey home page Code Monkey logo

wxstocks's Introduction

wxStocks is no longer functional, I would recommend OpenBB instead.

wxStocks

This program is now in beta (let's be honest, it'll always be in beta until i write some tests), but i'm still happy to accept any pull requests or suggestions if you want to help out.

Disclaimer: This program comes as is, and probably has some errors in it. This software should not be used as financial advice or financial analysis, it is for educational use only. Consult a financial advisor before, after, and even while using this software. Double check any calculations done by this software, and review all the code for errors before using. By using this software you release the author(s) from any liability regarding the use of this software. Please don't sue me. Sorry about the massive disclaimer, but finance programs are fairly litigious business.

wxStocks is a investment analysis program that could help teach you to scrape, screen, sort, and prepare a portfolio for learning about buying and selling equities.

The biggest new feature is XBRL support!

Built using wx as its framework (specifically wxPython3.0-osx-cocoa-py2.7), and pyql as its scraping tool.

Requirements: Python 3, wxPython 4, NumPy, Requests, bs4, and some other stuff i should probably list here but you can get them with pip

Recommended: python cryptography, xlrd

License: AGPL

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Installation:

Python:

If you are running a mac or linux Python 3. To check, open your terminal and just type "python", which should lead to a prompt that looks like ">>>". You can then quit by typing "quit()". If that doesn't work, go here: https://www.python.org/downloads/

If you are running windows, i've found it's better to install 64-bit python if you're on a 64-bit processor for this program, go here and install python 3, ideally the latest release: https://www.python.org/downloads/

wxPython:

http://www.wxpython.org/download.php

Just use pip: $ pip install wxpython

Numpy:

$ pip install numpy

http://docs.scipy.org/doc/numpy/user/install.html

Python cryptography library (not required, but highly recommended):

$ pip install cryptography

xlrd:

$ pip install xlrd https://pypi.python.org/pypi/xlrd

Older Screenshots:

OS X (Yosemite) Portfolios Custom Analysis Sale Prep

Linux (Mint) Linux

Windows (10) Windows

wxstocks's People

Contributors

scoofy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wxstocks's Issues

logging.info in Gui Position Index

Hi, thanks for putting this together. Still figuring it out.
When I ran this under windows I had to comment out lines 23 and 24 in wxStocks_gui_position_index.py:
#if config.ENCRYPTION_POSSIBLE and (config.OS_TYPE_INDEX != 0): # if encryption and not on mac
# logging.info("FINISH THIS TEMPORARY RESTRUCTURING TO WORK CROSSPLATFORM")
because it threw an error about "logging" on my Windows machine:

Traceback (most recent call last):
File "wxStocks.py", line 85, in
main()
File "wxStocks.py", line 82, in main
import wxStocks_modules.wxStocks_gui as gui
File "D:\wxstocks\wxStocks_modules\wxStocks_gui.py", line 23, in
from wxStocks_modules import wxStocks_gui_position_index as gui_position
File "D:\wxstocks\wxStocks_modules\wxStocks_gui_position_index.py", line 20, in
class WelcomePage(object):
File "D:\wxstocks\wxStocks_modules\wxStocks_gui_position_index.py", line 24, in WelcomePage
logging.info("FINISH THIS TEMPORARY RESTRUCTURING TO WORK CROSSPLATFORM")
NameError: name 'logging' is not defined

But then it seemed to work fine.

ubuntu 14.04 Install issue

Hi scoofy,

I got the following issue when installing:

Startup may take a few moments...
File: wxStocks_db_functions.py
Line 156:

Loading GLOBAL_STOCK_DICT: this may take a couple of minutes.If this is your first time opening wxStocks, please ignore the following exception, otherwise, your previously saved data may have been deleted.

File: wxStocks_db_functions.py
Line 166: [Errno 2] No such file or directory: 'wxStocks_data/all_stocks_dict.pk'

File: wxStocks_db_functions.py
Line 186: Loading GLOBAL_ATTRIBUTE_SET
If this is your first time opening wxStocks, please ignore the following exception, otherwise, your previously saved data may have been deleted.
File: wxStocks_db_functions.py
Line 194: [Errno 2] No such file or directory: 'wxStocks_data/all_attributes_set.pk'
File: wxStocks_db_functions.py
Line 54: Loading GLOBAL_TICKER_LIST
File: wxStocks_db_functions.py
Line 58: [Errno 2] No such file or directory: 'wxStocks_data/ticker.pk'
File: wxStocks_db_functions.py
Line 503: config.ENCRYPTION_POSSIBLE False
File: wxStocks_db_functions.py
Line 510: attempting to load 0 possible portfolios
File: wxStocks_db_functions.py
Line 207: Loading GLOBAL_STOCK_SCREEN_DICT
File: wxStocks_db_functions.py
Line 211: [Errno 2] No such file or directory: 'wxStocks_data/screen_dict.pk'
File: wxStocks_db_functions.py
Line 257: Loading SCREEN_NAME_AND_TIME_CREATED_TUPLE_LIST
File: wxStocks_db_functions.py
Line 261: [Errno 2] No such file or directory: 'wxStocks_data/screen_names_and_times_tuple_list.pk'
Traceback (most recent call last):
File "wxStocks.py", line 92, in
main()
File "wxStocks.py", line 90, in main
gui.MainFrame().Show()
File "/home/kaini/fintech/wxStocks/wxStocks_modules/wxStocks_gui.py", line 50, in init
self.welcome_page = WelcomePage(self.notebook)
File "/home/kaini/fintech/wxStocks/wxStocks_modules/wxStocks_gui.py", line 239, in init
self.encryption_hardness_field.SetHint("default = 8")
AttributeError: 'TextCtrl' object has no attribute 'SetHint'

It appears that wx installed by ubuntu apt-get is not compatible.
Any known solution on Ubuntu/Debian?

A suggestion for pulling stock symbols

def get_stock_urls(exchanges=["nyse", "nasdaq"]) : # from nasdaq.com
headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,;q=0.3',
'Accept-Encoding': 'none',
'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,
/*;q=0.8'
}
for exchange in exchanges :
yield "http://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=%s&render=download" % exchange, headers

def invoke_url(url,headers) :
import urllib.request
response = urllib.request.Request(url, headers=headers)
page = urllib.request.urlopen(response)
return page.read()

def parse_csv_stock_symbol_symbols(csv):
lines = csv.splitlines()
rr = range(0,len(lines))
for r in rr :
if r == 0 : continue
ret = lines[r].decode('utf-8').split(',')
if len(ret) == 0 : continue
yield ','.join(map(lambda x : x.replace('"',''), ret))

this allows me to do this

for url, headers in get_ticker_urls() :
csv = invoke_url(url,headers)
for stock in parse_csv_ticker_symbols(csv) :
print(stock)

or this

for url, headers in get_stock_urls(['amex']) :
csv = invoke_url(url,headers)
for stock in parse_csv_stock_symbol_symbols(csv) :
print(stock)

new

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

If tou want, Please read the readme , and in case of any problem you can contact me ,
If you are convinced try to install it with the documentation.
https://github.com/Leci37/LecTrade/tree/develop I appreciate the feedback

Stock Screener

Hi.
Please help me!
I need a stock screener to scan stocks listed in KSE-100 index and return me only those stocks in which 6EMA line has crossed above 18EMA line recently (within a period of 7 days).
My email Address: [email protected]
I shall be really grateful.

wxStocks_gui TypeError: TopLevelWindow.SetSizeHints(): arguments did not match any overloaded call:

Hey Matt.
Project looks great and i am trying to install on ubuntu 22.10.
After installing the dependencies from your documentation, I also found I had to install;

  • feedparser
  • zodb
  • fake-useragent

Having done that, after running and setting the password i get;
Startup may take a few moments...
Enter your wxStocks encryption password:
---- wxStocks_db_functions.py|688 ----
Validating your password, this may take a moment...
---- wxStocks_db_functions.py|533 ----
attempting to load 0 possible portfolios
---- wxStocks_db_functions.py|326 ----
Loading GLOBAL_STOCK_SCREEN_DICT
---- wxStocks_db_functions.py|355 ----
Loading SCREEN_NAME_AND_TIME_CREATED_TUPLE_LIST
---- wxStocks_gui_position_index.py|24 ----
FINISH THIS TEMPORARY RESTRUCTURING TO WORK CROSSPLATFORM

Traceback (most recent call last):
  File "/home/user/python/wxStocks/wxStocks.py", line 85, in <module>
    main()
  File "/home/user/python/wxStocks/wxStocks.py", line 83, in main
    gui.MainFrame().Show()
  File "/home/user/python/wxStocks/wxStocks_modules/wxStocks_gui.py", line 33, in __init__
    self.SetSizeHints(gui_position.MainFrame_SetSizeHints[0],gui_position.MainFrame_SetSizeHints[1])
TypeError: TopLevelWindow.SetSizeHints(): arguments did not match any overloaded call:
  overload 1: argument 1 has unexpected type 'float'
  overload 2: argument 1 has unexpected type 'float'

any ideas please?

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.