Jump to content
Michael P

Journal software

Recommended Posts

 

Hello BearBull Traders. I have created some journaling software that I have found useful. I call the program Structjour, as in a Structured Daily Trade Review Tool. It is meant for Day Traders in Stock Equities (who use DAS and/or IB). I have been working and using this program for about a year. Its sill a pre-release (version 0.9.9-Alpha). The design has been inspired by members of BBT (Thanks Pete, William, Robert and too many others to list). Anything I got wrong is all mine. I am seeking feed back in bug-reports, requests, suggestions and assistance in any form that you believe will help make this more useful.  It has only ever run on my system and I am expecting un-planned-for bugs and oversights. Its alpha software and the installation is a bit geeky. If you don't mind that, I would appreciate your feed back for bugs, user interface suggestions, features and whatever.

The features of the program include:

Import from DAS Trader Pro or Interactive Broker Statements. If requested I plan to include other brokers' statements.

Tickets are divided into trades and displayed showing entries, exits, PnL, and the diff between initial entry and exit and some other stuff.

A place to enter your initial target and stoploss can detect when the stop is violated and figures the lost PnL. The loss amount can be edited to reflect loss of real or potential PnL due to breaking your rules.

For your trade review, there is a strategey dropdown to choose from, a location to describe entrances/exits, a location to analyze, and a location to summarize which will be included in your daily summary.

The strategy dropdown box on the main page can add new strategies to your list. Strategies are supported by the strategy browser where you can define your strategies and check whether to include them in the dropdown box on the front page. In the Strategy browser, you can define your strategy and provide a couple images for each strategy. Additionally you can add and view web pages that relate each strategy.

I have an idea that some people may want to provide a 'strategy package', a group of defined strategies that can be uploaded into the Structjour database.

Charts can be 1) automatically generated 2) copied from the clipboard or 3) loaded from a file. Data for automatic chart generation has three possible sources. Alphavantage and Barchart (free APIs) and Interactive Brokers python API using IB Gateway or Trader Work Station. If you have all three APIS setup, structjour will choose one based on availability and your set preference. The setup for Alphavantage and Barchart requires you get an API key (very simple and available to everyone). The ibapi data (setup more complicated) has the advantage of providing after hours data and long historical availability. Automatic chart generation can include Moving averages and VWAP. All charts are stored in a directory for that day providing easy access.

Input files are limited to DAS Trader PRO exports and IB statements (Activity, Trade and Flex statements). At some point in the future, other brokers' statement formats may be added (depending on interest)

Review suport includes setting your original target and stop loss. Exceeding your stop loss will trigger an amount lost to be shown. The Amount lost can be edited used to display and explain missing potential income from not following yhour rules. Each trade has a notes and analysis section.

Navigation between days is done with a date widget. Just Change the date and click read or load to read a new file or load saved data.

The daily summary has a place to store notes that refer to the whole day. A summary of Wins and losses is displayed that includes the summary made for each trade.

Everything is stored in a light-weight sqlite database

The entire day can be exported to an excel file which includes the easy to read forms for each trade and the charts.

All of your trades can be exported to an excel file (a tweak of 'DisciplinedTrader.xlsx) which shows monthly and yearly statistics

This software is free and I plan for it to remain free for BBT

Installation instructions:

From any shell that runs python 3.6 or greater type

pip install structjour

The program will be installed in your python scripts directory.  Click on it, create a shortcut or run it from the command line.

Features of the program

structjour.png

  • Import from DAS Trader Pro or Interactive Broker Statements. 
  • Tickets are divided into trades and displayed showing entries, exits, PnL, the diff between inital entry and exit and some other stuff
  • A place to enter your initial target and stop loss can detect when the stop is violated and figures the lost PnL. The loss amount can be edited to reflect real or potential PnL loss.
  • There is a strategy dropdown box to choose  from, a location to describe your trade, a location to analyze your trade, and a location to summarize your trade. The summary will be included in a daily summary.
  • The strategy dropdown box on the main page can add new strategies to your list. Strategies are supported by the strategy browser where you can define you playbook and determine which strategies should be included in the front page dropdown box. In the strategy browwer youo can describe your strategy in detail, provide a couple images. Additionally you can add web and view pages that describe your strategy.
  • Charts can be 1) automatically generated that include entries, exits and moving averages, 2) Copied from the clipboard, or 3)Loaded from a file. The data for the automatic chart generation has three possible sources, Alphavantage and Barchart (free APIs) and Interactive Brokers python API using IB Gateway or Trader Work Station. If you have all three APIs setup, structjour will choose one based on availability, time of day and preference. The setup for Alphavantage and Barchart requires an APIKEY (very simple and available to everyone) The IB data  requires an Interactive Brokers account to be effective.
  • Navigation between days is done by entering the date in the date widget.
  • The daily summary provides a place to store notes that refer to the entire day. It also gives a summary of wins, losses, average win/loss, max win and loss and provides a traditional table based view of the day's trades
  • All the data is stored in a local sqlite database which is represented as a file in your machine.
  • Export the entire day to Excel. They are shown with a similar form as structjour including all your charts and analysis
  • Export all your trades to Excel to show longer term, monthly and yearly statistics.

dailysummary.png

strategybrowser.png

Edited by Michael P
Simplified install
  • Like 3

Share this post


Link to post
Share on other sites

That's great. But wait for an update to download. (or re-download) There is  an initialization problem. Should be ok in a couple hours. I'll post here when its ready

  • Like 1

Share this post


Link to post
Share on other sites

This is great, I will try it out in the next days!  Trustworthy local data storage instead of web services; exactly what I was looking for. Seems like you open sourced the app, do you mind potential pull-requests in future?

Edited by luke

Share this post


Link to post
Share on other sites

Testing this out now, to install in windows 10. I just had to run this command from command prompt to get going:

 

python -m pip install structjour

 

Share this post


Link to post
Share on other sites

What file should I be looking for from DAS to import? I attempted to export a bunch of .csvs from DAS and import them but structjour just crashes.

 

Edit: I am using BBT SIM version, unsure if this version works or generates the correct file I need to import into structjour..

Edited by PilotFish

Share this post


Link to post
Share on other sites

You need to export the Trades window from DAS. 

There is a bit of setup required. In Structjour, open file->file settings. At the top left choose a journal location. Click the next four buttons to get default settings. 

On the top right, choose a database name (any name is fine and the two database files can be the same file) 

Finally click the Create journal directories for the current month.

Now from DAS export your trades window to your journal directory. If you used default settings, name the file trades.csv. From Structjour import it by selecting DAS import radio button and the 'Read File'

I will be glad to help with what ever else you need. If you are running this from the command line and it crashes, I would appreciate the stack trace it prints.

Edited by Michael P

Share this post


Link to post
Share on other sites

Hi Michael, I tried setting my default folder and exporting my trades.csv file to it, structjour crashed and now when I try and load structjour I get this error:

C:\Users\AppData\Local\Programs\Python\Python36-32\Scripts>structjour.exe
Traceback (most recent call last):
  File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\view\sumcontrol.py", line 848, in theDateChanged
    self.loadFromDate()
  File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\view\sumcontrol.py", line 903, in loadFromDate
    statementDb = StatementDB()
  File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\statements\ibstatementdb.py", line 62, in __init__
    self.createTradeTables()
  File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\statements\ibstatementdb.py", line 80, in createTradeTables
    conn = sqlite3.connect(self.db)
TypeError: argument 1 must be str, not None

 

 

 

Edited by PilotFish

Share this post


Link to post
Share on other sites

Thank you, that was very helpful and will be able to prevent it in future versions. The problem seems to be there is no database file listed. While that should not have crashed the program (future will have a dialog box with instructions), it has left structjour in a state. 

I can reproduce the error by removing the databases in my filesetting dialog. It can be fixed by running the the file-settings dialog as its own program and setting file names for the database files. The following command should work on your system:

python C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\view\filesetcontrol.py

Unless you have multiple versions of python on your system. You could be more specific with something like:

C:\Users\AppData\Local\Programs\Python\Python36-32\python.exe   C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\structjour\view\filesetcontrol.py

Choose file names for the two database files in the top right of this dialog. Any name is fine and they can be the same file.  Then open  structjour  again. Should work.

 

image.png.c58e425e9b86d40160a51a9c558662c8.png

Share this post


Link to post
Share on other sites

Hi Michael, I ran the command however it appears to just hang after this output:

 

[directory structure removed for brevity]

python filesetcontrol.py
Cannot locate directory 202001_January/_0120_Monday/".
Cannot locate directory 202001_January/_0120_Monday/".

 

Edited by PilotFish

Share this post


Link to post
Share on other sites

The  dialog does not  fire up?

I placed a new version on pypi 

pip uninstall structjour
pip install structjour

should be version 0.9.91a23

Edited by Michael P

Share this post


Link to post
Share on other sites

Hey Mike, I have the new version installed,

So I guess I was just a little confused, I assumed the program itself would automatically create the necessary folder structure for me. I created my directory for January and now my 'Directory Naming Scheme' shows green when I hit Set Default. Question about uploading DAS export files..is there a way to just upload a database file so I don't have to constantly upload trade export files? Is it daily I need to upload those export files? Trying to understand the normal 'flow' of how I would need to move data from DAS to Structjour day in and day out..Thanks for taking the time to help!

Share this post


Link to post
Share on other sites

Hello PilotFish,

The program does create the necessary folder structure but it requires you to initiate it. Look at the dialog png  a couple posts up. On the right side of the dialog  see the bit where it says 

"Create journal file directories for the month of ...."

Choose the month and year and click the "Create Dirs" button. 

The green directory indicates the directory exists for the chosen date.

Suggestions on how I can simplify this procedure? Maybe it should be completely automatic triggered by the system date and opening the dialog or something.

Each DAS import file must be uploaded. DAS resets the trades positions window every day. Its not possible to have a multi-day import from DAS. I don't know how to access DAS programmatically. Its probably possible but would require me to purchase a subscription to the DAS API. But the import should be relatively seamless. Incidentally you can import ib statements of any length, monthly, yearly, whatever. 

Capture.jpg.2a43ffdaca2de62aa5b382e4e2cdd523.jpgThis is part of the main window.

With DAS import checked, use the date widget to locate the files exported from DAS. Files that exist will be in green. If no trades.csv exists for a particular date, it will show red. Click on Read File to import into structjour. (The date widget lets you tab from month to year to day. Using the arrow keys on your keyboard will increment. ) Then click Database and Save. 

This UI evolved from my usage. While it seems intuitive to me, I may be the only one.  I would like to make this pre-alpha software completely seamless and bullet proof. Anything is possible for the interface if you have any suggestions. Your shared experience is very valuable. Thank you.

Edited by Michael P

Share this post


Link to post
Share on other sites

Hey Mike, I got a BarCharts API and set it in structjour, however, when I click 'Update' on one of the chart windows, the command prompt shows:

QWindowsWindow::setGeometry: Unable to set geometry 2560x1429+0+29 (frame: 2578x1476-9-9) on QWidgetWindow/"MainWindowWindow" on "\\.\DISPLAY2". Resulting geometry: 2560x1361+0+29 (frame: 2578x1408-9-9) margins: 9, 38, 9, 9 minimum size: 1834x1429 MINMAXINFO maxSize=0,0 maxpos=0,0 mintrack=1852,1476 maxtrack=0,0)
QWindowsWindow::setGeometry: Unable to set geometry 2560x1433+0+29 (frame: 2578x1480-9-9) on QWidgetWindow/"MainWindowWindow" on "\\.\DISPLAY2". Resulting geometry: 2560x1361+0+29 (frame: 2578x1408-9-9) margins: 9, 38, 9, 9 minimum size: 1938x1433 MINMAXINFO maxSize=0,0 maxpos=0,0 mintrack=1956,1480 maxtrack=0,0)
QWindowsWindow::setGeometry: Unable to set geometry 2560x1437+0+29 (frame: 2578x1484-9-9) on QWidgetWindow/"MainWindowWindow" on "\\.\DISPLAY2". Resulting geometry: 2560x1361+0+29 (frame: 2578x1408-9-9) margins: 9, 38, 9, 9 minimum size: 1675x1437 MINMAXINFO maxSize=0,0 maxpos=0,0 mintrack=1693,1484 maxtrack=0,0)
QWindowsWindow::setGeometry: Unable to set geometry 2560x1441+0+29 (frame: 2578x1488-9-9) on QWidgetWindow/"MainWindowWindow" on "\\.\DISPLAY2". Resulting geometry: 2560x1361+0+29 (frame: 2578x1408-9-9) margins: 9, 38, 9, 9 minimum size: 1834x1441 MINMAXINFO maxSize=0,0 maxpos=0,0 mintrack=1852,1488 maxtrack=0,0)
QWindowsWindow::setGeometry: Unable to set geometry 2560x1445+0+29 (frame: 2578x1492-9-9) on QWidgetWindow/"MainWindowWindow" on "\\.\DISPLAY2". Resulting geometry: 2560x1361+0+29 (frame: 2578x1408-9-9) margins: 9, 38, 9, 9 minimum size: 1938x1445 MINMAXINFO maxSize=0,0 maxpos=0,0 mintrack=1956,1492 maxtrack=0,0)

My stocks for the day on the left panel are successfully showing however no chart shows and Structjour is also unresponsive.

 

Edit: I added 'bc' to my preferences at the bottom of the stock api window and it seems to have worked..I see my chart!

Edited by PilotFish

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.