Code Monkey home page Code Monkey logo

trader-dss's People

Watchers

James Cloos avatar  avatar

trader-dss's Issues

Too many curmbs left in the cookie

going to the login page should save your login name and destroy the session
then save the login name to a new session.

The current behavior would allow the next user (if they browser was left
open) to have the rest of the contents of the cookie (sql etc)

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 10:39

Simplify the requirements for a query

Shouldn't require the quotes table to be included. Since all quote and
indicator tables are keyed on 'symb' 'date' 'exch' it shouldn't be hard to
just require them.

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 9:58

highlite sell stops

A table of symbols that have exceed the portfolio sell stop should be
listed on their own on the booty page.

A portfolio could have a 'stop loss' percentage property to facilitate this.

Original issue reported on code.google.com by [email protected] on 1 Feb 2010 at 4:34

Williams %R needs more data to make good decisions

The wikipedia page for W%R says 

***********
Williams used a 10 trading day period and considered values below -80 as
oversold and above -20 as overbought. But they were not to be traded
directly, instead his rule to buy an oversold was

    *  %R reaches -100%.
    * Five trading days pass since -100% was last reached
    *  %R rises above -95% or -85%.
***********

To be able to select stocks that match this, we need to be able to use a
query something like

# oversold (os) stocks
select symb, exch, wpr_10 from indicators where wpr_10_os_80 = 5 and wpr_10
< -85 and date = 'xxxx-xx-xx';

Original issue reported on code.google.com by [email protected] on 19 Jan 2010 at 2:27

the input validation on queries.php is broken

This probably happened when I changed the file layout so that creating the
form was in a function. It's probably not sending the validation because
it's having the form created a second time and re-displayed. Portfolios was
like this too.

I don't much like quickforms. It's not much quicker than straight html and
the only thing you gain is simple validation rules. You lose all ability to
lay out the form though.

Original issue reported on code.google.com by [email protected] on 4 Feb 2010 at 10:44

allow buying

Have to be able to select quantity, must be less than the available funds

Not sure about other details!

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 10:05

update_gains works backwards

When working out how much a stock has gained, the function works backwards.

What is the expected output? 
  The 10, 20, 30, 50, 100, 200 day gains should contain how much the stock
has gained in that many days.

What do you see instead?
  It finds the quote 10, 20, etc. days ago and says how much it will gain
in the next 10, 20, etc. days. Like telling the future, only in the past!

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 12 Jan 2010 at 9:57

module documentation

Use PhpDocumentator to produce html module/function documentation

All the functions will need to be updated with the right headers.

This might be a good time to correct/standardize the function and variable
names and even move to only having one database object passed around by
reference. 

Original issue reported on code.google.com by [email protected] on 31 Jan 2010 at 9:50

Need a simple tabed header that allows switching between pages

Create using a table with links in it and coloured cells to start with.

Tabs should be...
Login: Only one selectable if $_SESSION['uid'] isn't set. Selecting it when
it is set should unset it (logout)

Portfolios: Create/delete or select a portfolio

Pot/Booty: Chart progress of portfolio and list the stocks in it. Should be
able to move backwards and forwards through the life of the portfolio from
there.

Search/Select: Run SQL queries to choose stocks and put them into the
cart/watch list. Should have integration with the portfolio when selected
stocks are already in it, also with the buy/watch lists.

Trade: Buy/sell, long/short stocks

Watch: manage your watch list.

Queries: manage your stored queries.

Original issue reported on code.google.com by [email protected] on 26 Jan 2010 at 9:02

implement the shopping cart

Implement the basic shopping cart.

Not the buying part, just the loading shares into it and displaying it part.

Original issue reported on code.google.com by [email protected] on 26 Jan 2010 at 8:51

Allow the user to manage a portfolio

The PHP needs to

o. check that the username is set, redirect to login if not
o. check that the portfolio is set, redirect to portfolio choose if not

o. show the portfolio details
o. allow deposit/withdrawal from portfolio
o. allow editing of defaults (parcel size etc)
o. display performance of portfolio to date (total value, pot value, shares
value, profit from shares.

o. have link to trading page

Original issue reported on code.google.com by [email protected] on 20 Jan 2010 at 1:04

create page to trade shares within a portfolio

Create a page that

checks if username is set otherwise redirect to login page
checks if portfolio is set, otherwise redirect to portfolio chooser

trading needs to:
o. allow entry of sql to select stocks (limit 10,100 etc.)
o. show tabulated query results
o. allow selection of stocks to chart/add to shopping cart/add to wish list
o. allow purchasing of shares in cart
o. allow moving on to the next trading day (if it exists)
o. ask for confirmation if moving on when stocks are in shopping cart
o. reset shopping cart for next day
o. preserve wish list between days

o. have a link back to the portfolio management page.

Original issue reported on code.google.com by [email protected] on 20 Jan 2010 at 1:07

functions should insert or update with their results

Currently most functions fail if the data's been calculated before because
they only use 'insert' and not update 'update'.

This enhancement is to replace inserts with this type of code

update X, X where Y, Y;
if not found
  insert X, X;
endif;

this shouldn't be much slower since it will always use an index

Original issue reported on code.google.com by [email protected] on 13 Jan 2010 at 12:52

the name of the query would be a better default comment than the protfolio

The default comment added to a share in the watch or buy list is '$pf_name,
$pf_working_date' It would be better to be '$select_name, $pf_working_date'
so that the query that selected it could be more readily identified.

Particularly since the buy/watch lists are associated with only one portfolio

Original issue reported on code.google.com by [email protected] on 30 Jan 2010 at 12:43

triggers should operate with a transaction

When a row is added to table 'quotes' a trigger fires and calls the
functions that update the derived tables.

Those functions should be called within a transaction so that they either
all work or none do

Original issue reported on code.google.com by [email protected] on 7 Feb 2010 at 9:54

Create a charts tab

Charts tab should allow development and saving of custom charts. These can
be selected and used to chart on all other tabs.

Original issue reported on code.google.com by [email protected] on 11 Feb 2010 at 11:15

provision for shorting needs to be made

The shopping cart and watch list should indicate if a share is to be bought
long or sold short. Table defs will need to be changed. Perhaps a field
called 'type' with allowed values of 'L' and 'S'

These should have a binary index on them

Original issue reported on code.google.com by [email protected] on 26 Jan 2010 at 8:53

delete a portfolio

Need to be able to delete a portfolio and have it clean up all the other
tables.

Trades, cart, watch, holdings and portfolios. Needs to be done in a
transaction.

Original issue reported on code.google.com by [email protected] on 1 Feb 2010 at 8:52

the portfolios table needs to be changed

It currently looks like this

trader=# \d portfolios
                                     Table "public.portfolios"
    Column    |          Type          |                         Modifiers

--------------+------------------------+----------------------------------------
-------------------
 pfid         | integer                | not null default
nextval('portfolios_pfid_seq'::regclass)
 name         | character varying(100) | not null
 exch         | character varying(6)   | not null
 uid          | integer                | not null
 parcel       | numeric(12,2)          | 
 start_date   | date                   | not null
 working_date | date                   | not null
Indexes:
    "portfolios_pkey" PRIMARY KEY, btree (pfid)
    "portfolios_uid_key" UNIQUE, btree (uid, exch, name)

It doesn't need the start_date in it because that's created in pf_summary
with the opening balance when the portfolio is created.

It should contain a field to tell if the stock names should be replaced
with their md5 hashes to stop you from learning them when doing practice
trading.

Original issue reported on code.google.com by [email protected] on 4 Feb 2010 at 8:47

lots of the tables with symb in them don't have exch

Will need something like this done to cart, trades, watch

alter table cart add column exch character varying(6);
update cart set exch = 'L';
alter table cart alter column exch set NOT NULL;
alter table cart drop  CONSTRAINT cart_pkey ;
alter table cart add constraint cart_pkey PRIMARY KEY (pfid, symb, exch, date);
ALTER TABLE ONLY cart ADD CONSTRAINT constraint_stocks FOREIGN KEY (symb,
exch) REFERENCES stocks(symb, exch) MATCH FULL;

Original issue reported on code.google.com by [email protected] on 8 Feb 2010 at 2:04

need a table to tell what stocks we currently hold

perhaps

holdings
 Column  |          Type          | Modifiers 
---------+------------------------+-----------
 pfid    | integer                | not null
 symb    | character varying(10)  | not null
 avgprice| numeric(9,2)           | not null
 volume  | numeric(12,0)          | not null

so that it's easier to work out what's currently in the portfolio.

Original issue reported on code.google.com by [email protected] on 30 Jan 2010 at 6:21

create a stock inspector

Create a page that will show lots of detail about a particular security. It
should give the current standard chart, plus charts based on all the
indicators and other data available for that security.

It needs to open in a new window or tab

Original issue reported on code.google.com by [email protected] on 26 Feb 2010 at 10:52

update-quotes.pl fails

[trader@hostname bin]$ ./update-quotes.pl 
[INFO][Seeking update to], 888 L 2005-09-29 2009-12-24
[INFO][inserting]888.L, 2009/12/29, 111.6000, 111.6000, 110.0000, 111.3000,
236400, 111.3000
DBD::Pg::st execute failed: ERROR:  null value in column "name" violates
not-null constraint
CONTEXT:  SQL statement "insert into stocks ( symb, exch, first_quote,
last_quote ) values (  $1 ,  $2 ,  $3 ,  $3 )"
PL/pgSQL function "update_stock_dates" line 7 at SQL statement
SQL statement "SELECT  update_stock_dates( $1 ,  $2 ,  $3 )"
PL/pgSQL function "update_derived_tables" line 4 at perform at
./update-quotes.pl line 69.
ERROR:  null value in column "name" violates not-null constraint
CONTEXT:  SQL statement "insert into stocks ( symb, exch, first_quote,
last_quote ) values (  $1 ,  $2 ,  $3 ,  $3 )"
PL/pgSQL function "update_stock_dates" line 7 at SQL statement
SQL statement "SELECT  update_stock_dates( $1 ,  $2 ,  $3 )"
PL/pgSQL function "update_derived_tables" line 4 at perform at
./update-quotes.pl line 69.

What is the expected output? What do you see instead?
should insert and calculate the derived tables


Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 16 Jan 2010 at 12:24

user id combined with query description (name) should be unique

Don't bother with updating a query definition in the queries table. Just
force the name to be unique for a user.

Then to modify a query all you do is give it a slightly different name and
save it. You can then delete the old one if you like. This will almost give
revision control to queries!

Original issue reported on code.google.com by [email protected] on 27 Jan 2010 at 10:10

update_gains works backwards


What is the expected output?
  The amount a share has gained in the last X days

What do you see instead?
  Update_gains works out how much the share will gain in the next X days


Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 12 Jan 2010 at 11:08

  • Merged into: #1

Chart old trades

The trades table contains old trades. It should be easy to create a page
that shows them so that you can easily revisit old trades to see what
happened after you sold them etc.

Original issue reported on code.google.com by [email protected] on 11 Feb 2010 at 2:14

stock last trade date doesn't get updated when the first trade is entered

What steps will reproduce the problem?
1. create a new stock (running update-share_names.pl will do this)
2. fetch quotes on that stock (update-quotes.pl)
3. If there's only one quote like (71IN.L, "GBL INV SP GDR-144A" on
2009-02-04) then stocks.first_quote will be populated, but
stocks.last_quote won't be.

What is the expected output? What do you see instead?

if last_quote is NULL then it should be set to first_quote

Please use labels and text to provide additional information.


Original issue reported on code.google.com by [email protected] on 24 Jan 2010 at 4:59

can't sell stock!

Selling should

1. add a trade for the -ve volume
2. remove volume from holdings
3. update pf_summary

Original issue reported on code.google.com by [email protected] on 1 Feb 2010 at 4:32

add database elements for multiple users, portfolios and a shopping cart

This is where the real fun starts.

Users will have multiple portfolios with independent current dates in the
past. They will use a shopping cart and various technical charts to trade
each day stepping through the history of the exchange, experimenting with
different queries on the database and trading strategies.

When stocks have been selected, they will commit all pending trades from
their shopping basket to their portfolio and progress to the next trading day.


Original issue reported on code.google.com by [email protected] on 16 Jan 2010 at 10:39

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.