TODO
- Ruby 3.0
- Rails 6.14
- Postgresql 13.3
You need to setup an env file for heroku deployment
RACK_ENV=development
PORT=3000
overall part II
- UI
- make plan show page display word-wrap
- Give color coding to coins
- Make form inputs toggles (EVERY FORM)
- Plans
- Add Plans decorator
- Edit name inline
- Add paper flag
- Make flag copy to entries
- Copy plan button to edit page
- models
- Add to trade log analysis
- refactor to key/value analyses (likely full denormalized so we can see what we use more)
- more visual indicator for forms (toggles ideal)
- add moving averages (maybe jsonb)
- add pattern selections? (maybe not)
- make timeframes + plans association, enforce new analysis form (can constraint uniqueness on timeframe + plan)
- migrations
- migrate analysis
filledtoclosed - move cancelled out of status
- migrate analysis
- Use
openandclosefor kinds in trade log- change in trade log model
- change in trade entry mode
- change in trade log admin
- change in trade entry admin
- change in BIP tags
- add counter caches to trade log analyses
- trade log
- has one memo per
- add counter cache for memos
- add counter cache for analyses
- lock price after close
- lock amount after close
- Add to trade log analysis
Bugs and Fixes
- Fix bug with bip_status not reloading (error in value)
- Fix calculation issue with profit $ and %
- Fix/Optimize excess db calls in model callbacks
- Fix bug with nil amount being compared in new trade entries
- Don't count cancelled logs for amount
- undefined method
destroy!when removing destroy action. Check UseForm#destroy - Allow forms to render errors on validation instead of throwing
- 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
- break this down further
- UI
- Fix NaN displayed in form
- Redirect to parent object after filling form (if directed from parent)
- paste entry system
- add counters and show
memosfrom tradelog panel actions in trade entries - Allow trade entries create action to redirect to show page
- Actual form validations (show errors instead of 500)
- Make margin global setting for new trades
- Models
- Could clean up some audit trail for important columns
- Could add guard against changing calculated columns
- Auto generate status on trade entry
- remove timeframe analysis
- consider performance of callbacks
- trade entries
- consolidate all memos into entries
- consolidate all analyses into entries
- Feature spec on all key admin pages
- show
- new
- 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
- login
- database sync
- Auto delegate all methods (probably rename model)
- Some base class for admin decorators
- https://github.com/aasm/aasm
- emotional score
- Markdown
- ci? https://circleci.com/integrations/heroku
- autoloader Zeitwerk causing NameError in heroku deployment
- Actual heroku docker deployment
- AWS? (cheaper)
- Upgrade to Ruby 3.0.2
- ActiveAdmin auto reload helpers known bug
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
- organize type of logs in entry panel
- organize type of analyses in log panel
- visual indicator for cancelled/opened/filled/closed
- refactor and remove some templating code if possible
- trade logs
- add cancelled as separate boolean
- add post button in trade logs panel
- sort by type then price in trade logs panel
- Quick changes
- add confirmation to form submit since its long
- index pages
- trade entry default to open and filled trades
- trade logs default to open trades
- Fix method_missing rubocop issue
- In place edits
- add lock logic into best_in_place_helper
- add styles to status_tags for specific method
- In place forms
- add quick link to open add position (longs buy / shorts sell)
- add quick link to close add position
- Index page
- fix NaN
- show paper prices
- show proper formatting of numbers
- Forms
- Always redirect back
- Add BIP in index pages
- side bar
- figure out why you have 2x sidebar
- make plan fetch new plan info when creating logs and entries
- make plan in side bar when filling out log
- make entry in side bar when filling out log
Models
- memos on trade entry
- normalize fields
- implement counter cache system
- profits should be counter cache and should persist
- amount should be counter cache and should persist
- fees should be on trade entry setting?
- margin should be on trade entry
- open|close on trade entry should be weighted average
- add refresh_explicit_counter_cache on trade logs
- clean up trade entry specs
- Fix why profits are negative for shorts
- Drop timeframe analysis
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
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