Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Trade Logger

TODO

Includes

  • Ruby 3.0
  • Rails 6.14
  • Postgresql 13.3

Requirements

You need to setup an env file for heroku deployment

RACK_ENV=development
PORT=3000

TODO

overall part II

  1. UI
  2. make plan show page display word-wrap
  3. Give color coding to coins
  4. Make form inputs toggles (EVERY FORM)
  5. Plans
    1. Add Plans decorator
    2. Edit name inline
    3. Add paper flag
    4. Make flag copy to entries
    5. Copy plan button to edit page
  6. models
    1. Add to trade log analysis
      1. refactor to key/value analyses (likely full denormalized so we can see what we use more)
      2. more visual indicator for forms (toggles ideal)
      3. add moving averages (maybe jsonb)
      4. add pattern selections? (maybe not)
      5. make timeframes + plans association, enforce new analysis form (can constraint uniqueness on timeframe + plan)
    2. migrations
      1. migrate analysis filled to closed
      2. move cancelled out of status
    3. Use open and close for kinds in trade log
      1. change in trade log model
      2. change in trade entry mode
      3. change in trade log admin
      4. change in trade entry admin
      5. change in BIP tags
    4. add counter caches to trade log analyses
    5. trade log
      1. has one memo per
      2. add counter cache for memos
      3. add counter cache for analyses
      4. lock price after close
      5. lock amount after close

Bugs and Fixes

  1. Fix bug with bip_status not reloading (error in value)
  2. Fix calculation issue with profit $ and %
  3. Fix/Optimize excess db calls in model callbacks
  4. Fix bug with nil amount being compared in new trade entries
  5. Don't count cancelled logs for amount
  6. undefined method destroy! when removing destroy action. Check UseForm#destroy
  7. Allow forms to render errors on validation instead of throwing
  8. Use arel instead of raw query for BI dashboard

tags

  • should paper & stopped flags be tags?
  • should patterns be tags?
  • tags can have descriptions for strategies, used for searching later
    • example 1h 4h trading ranges with custom tag

Memos

  • Require memo every update?

prompt/warning after something happens

  • certain % gain/loss
    • consequctive
  • trades with red flags
    • no stop loss
    • before bed time
    • market orders

search by timeframe

  • persist profit and friends fields
  • advance query system
    • 4h:trend = 1h:trend
    • 1h:bbwp > 50
  • populate % success while entering trade

Another Overall round

  1. break this down further
  2. UI
    1. Fix NaN displayed in form
    2. Redirect to parent object after filling form (if directed from parent)
    3. paste entry system
    4. add counters and show memos from tradelog panel actions in trade entries
    5. Allow trade entries create action to redirect to show page
    6. Actual form validations (show errors instead of 500)
    7. Make margin global setting for new trades
  3. Models
    1. Could clean up some audit trail for important columns
    2. Could add guard against changing calculated columns
    3. Auto generate status on trade entry
    4. remove timeframe analysis
    5. consider performance of callbacks
    6. trade entries
      1. consolidate all memos into entries
      2. consolidate all analyses into entries
  4. Feature spec on all key admin pages
    1. show
    2. new
    3. edit

Analyses could take schema from global setting, so that future changes doesn't lead to db migration

Users

  • user level settings
    • margin
    • maker taker fees
    • user level login
  • roles

Nice to haves

Done

Base

  • add margin setting
  • add maker/taker fee setting
  • add paper trade boolean
  • best in place
  • Stopped?

Deployment

  • heroku

Models part I - refactor: trades should be just additions to entry

  • rebuild table trades into trade_logs
  • admin pages
  • audit trail
  • inline edits
  • add timeframe analysis

Memos

  • Memo on status change or just open, during, close memos

Trade Plans

  • detailed sections with text
  • Sidebar plan while creating in form

UI

  1. organize type of logs in entry panel
  2. organize type of analyses in log panel
  3. visual indicator for cancelled/opened/filled/closed
  4. refactor and remove some templating code if possible
  5. trade logs
    1. add cancelled as separate boolean
    2. add post button in trade logs panel
    3. sort by type then price in trade logs panel
  6. Quick changes
    1. add confirmation to form submit since its long
    2. index pages
    3. trade entry default to open and filled trades
    4. trade logs default to open trades
    5. Fix method_missing rubocop issue
  7. In place edits
    1. add lock logic into best_in_place_helper
    2. add styles to status_tags for specific method
  8. In place forms
    1. add quick link to open add position (longs buy / shorts sell)
    2. add quick link to close add position
  9. Index page
    1. fix NaN
    2. show paper prices
    3. show proper formatting of numbers
  10. Forms
    1. Always redirect back
    2. Add BIP in index pages
  11. side bar
    1. figure out why you have 2x sidebar
    2. make plan fetch new plan info when creating logs and entries
    3. make plan in side bar when filling out log
    4. make entry in side bar when filling out log

Models

  1. memos on trade entry
  2. normalize fields
    1. implement counter cache system
    2. profits should be counter cache and should persist
    3. amount should be counter cache and should persist
    4. fees should be on trade entry setting?
    5. margin should be on trade entry
    6. open|close on trade entry should be weighted average
    7. add refresh_explicit_counter_cache on trade logs
    8. clean up trade entry specs
    9. Fix why profits are negative for shorts
  3. Drop timeframe analysis

Deployment

You'll need heroku cli and our production.key. Set it with

heroku config:set RAILS_MASTER_KEY=<value in production.key>

Deployment

heroku login
heroku git:remote -a logit-69
heroku stack:set heroku-20

git push heroku master
heroku run rake db:migrate

Notes

Things that you can put as alerts when you enter a trade

  • on open position

    • is the market extra trendy (bearish/bullish)? if so, there is higher likely hood of being front ran
  • feeling like you can't close a position because it could turn your way? If it's a good position, exit and re-enter. If you still think its a good position to enter, then re-enter

  • Got a big win? Lost a lot in a row? Take a day (or two) off

  • Go into every trade with a Positive Mental Attitude. Expect to win, and all losses you incur is based on your current ability

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages