2020-11-23 GnuCash IRC logs

00:07:45 *** angel has joined #gnucash
00:30:43 *** o01eg has joined #gnucash
00:33:31 *** chris-phone has quit IRC
00:35:39 *** chris-phone has joined #gnucash
00:35:39 *** ChanServ sets mode: +v chris-phone
00:41:43 *** angel has quit IRC
00:45:19 *** FH_thecat has quit IRC
00:55:13 *** Mechtilde has joined #gnucash
01:29:42 *** sbluhm has joined #gnucash
01:29:42 *** ChanServ sets mode: +v sbluhm
01:33:11 *** storyjesse has joined #gnucash
01:36:32 *** frakturfreak has quit IRC
01:39:03 *** fell has quit IRC
01:40:22 *** fell has joined #gnucash
01:40:22 *** ChanServ sets mode: +o fell
01:50:32 *** frakturfreak has joined #gnucash
01:50:32 *** ChanServ sets mode: +v frakturfreak
02:13:55 *** gjanssens has joined #gnucash
02:13:55 *** ChanServ sets mode: +o gjanssens
02:55:58 *** storyjesse has quit IRC
02:56:55 *** storyjesse has joined #gnucash
03:36:03 *** Aussie_matt has quit IRC
04:18:03 *** chris-phone has quit IRC
04:19:12 *** chris-phone has joined #gnucash
04:19:12 *** ChanServ sets mode: +v chris-phone
04:35:25 *** Mechtilde has quit IRC
04:36:01 *** Mechtilde has joined #gnucash
04:36:04 *** User has joined #gnucash
04:42:49 *** FH_thecat has joined #gnucash
05:04:25 *** chris-phone has quit IRC
05:05:03 *** chris-phone has joined #gnucash
05:05:03 *** ChanServ sets mode: +v chris-phone
05:05:46 *** chris-phone has quit IRC
05:05:55 *** chris-phone has joined #gnucash
05:05:56 *** ChanServ sets mode: +v chris-phone
05:09:05 *** chris-phone has quit IRC
05:10:43 <chris_> jralls: another issue is that lots probably don't understand stock splits
05:10:47 *** chris_ is now known as chris
05:11:35 *** David has quit IRC
05:11:40 *** David has joined #gnucash
05:12:03 <chris> CDB's magic formulas can handle stock splits easily; if he can come up with a similar tool for FIFO/LIFO capgains calculations then I'm sure it'll be much more robust
05:20:01 *** o01eg has quit IRC
05:37:11 *** User has quit IRC
06:03:33 *** Herbert has joined #gnucash
06:22:34 *** chris-phone has joined #gnucash
06:22:34 *** ChanServ sets mode: +v chris-phone
06:24:33 *** chris-phone has quit IRC
06:31:57 *** Aussie_matt has joined #gnucash
06:59:53 *** Aussie_matt has quit IRC
07:13:22 *** fell has quit IRC
07:13:43 *** fell has joined #gnucash
07:13:43 *** ChanServ sets mode: +o fell
07:59:09 *** Hamaryns has joined #gnucash
07:59:09 *** ChanServ sets mode: +v Hamaryns
08:05:30 *** storyjesse has quit IRC
08:07:03 *** fabior has joined #gnucash
08:10:06 *** CDB-Man_ has joined #gnucash
08:10:06 *** ChanServ sets mode: +v CDB-Man_
08:12:32 *** CDB-Man has quit IRC
08:12:38 *** CDB-PHONE has quit IRC
08:24:23 *** ramontjunior has joined #gnucash
08:51:47 *** Jimraehl1 has joined #gnucash
09:05:04 *** KaiForce has joined #gnucash
09:21:05 *** CDB-PHONE has joined #gnucash
09:21:06 *** ChanServ sets mode: +v CDB-PHONE
09:21:19 *** Robert847 has joined #gnucash
09:21:53 <CDB-PHONE> FIFO require logic that can't be done in Excel, because it requires a loop
09:29:02 <chris> hmm ok.
09:30:30 <chris> CDB: you can still suggest how FIFO logic can handle stock splits. In your own time.
09:34:15 *** Hamaryns has quit IRC
10:09:32 <CDB-PHONE> it can be something on the to-do list yeah
10:09:41 <CDB-PHONE> at a high level though, the steps are
10:09:59 <CDB-PHONE> 1. build an array of all purchases
10:10:08 <CDB-PHONE> 2. build an array of all sales
10:11:34 <CDB-PHONE> 3. iterate through the sales array. for each sale, iterate through the purchase array and Mark the number of sold units if sold units exceeds the amount remaining in current purchase, iterate to next purchase
10:11:56 <CDB-PHONE> [10:11] (+CDB-PHONE) 3. iterate through the sales array. for each sale, iterate through the purchase array and Mark the number of sold units.
10:12:01 <CDB-PHONE> 4.if sold units exceeds the amount remaining in current purchase, iterate to next purchase
10:13:30 <CDB-PHONE> essentially a nested for loop
10:14:28 <CDB-PHONE> when performing step 1 and building the purchase array, we need to insert a step 1.5 for splits and reverse splits
10:15:56 <CDB-PHONE> for all splits, double (triple, etc) the purchases dated prior to the split. if purchase date < split effective date, double units
10:16:00 *** David has quit IRC
10:16:05 *** David has joined #gnucash
10:16:09 <CDB-PHONE> problem is we need to check for sales first...
10:16:33 <CDB-PHONE> maybe splits are done with the sales loop
10:17:28 <CDB-PHONE> okay, instead of step 1.5, step 2 needs to be modified
10:17:47 <CDB-PHONE> 2. build an array of all sales, splits, and reverse splits
10:18:51 <CDB-PHONE> for splits, double the unsold amount remaining in each purchase lot dated < split date
10:19:01 <CDB-PHONE> same logic for reverse splits
10:19:33 <CDB-PHONE> except remainders need to create a new purchase entry
10:20:11 <chris> O_o
10:20:31 <CDB-PHONE> and said purchase entry is immediately sold for cash
10:20:55 <CDB-PHONE> so you also treat the reverse split as a sale
10:21:41 <CDB-PHONE> I'm probably missing stuff here
10:21:49 <CDB-PHONE> but this is high level what needs to be done
10:21:58 <CDB-PHONE> this is why FIFO lots are manual
10:23:44 <warlord> I don't see why they need to be manual.
10:24:10 <CDB-PHONE> [10:22] (+CDB-PHONE) this is why FIFO lots are currently** manual
10:24:12 <warlord> That logic is straightforward to implement.
10:24:40 <chris> warlord \o chris
10:24:46 <CDB-PHONE> agreed warlord, if the brokers can figure it out for the 1099-B, we can as well
10:25:27 <warlord> Honestly, I think policy.c already implements FIFO lots.
10:25:30 <warlord> doesn't it?
10:25:43 <CDB-PHONE> the basic 4 steps are more then sufficient absent any splits. it's splits that gives headaches
10:25:56 <CDB-PHONE> returns of capital also are annoying
10:26:27 <warlord> True, for a stock split you need to duplicate open lots at the time the split happens.
10:26:50 <CDB-PHONE> *only the open lots*
10:27:11 <CDB-PHONE> likewise with reverse splits and then dealing with remainder shares
10:27:29 <CDB-PHONE> and likewise with return of capital only affecting the basis of open lots
10:27:56 <CDB-PHONE> [10:26] (+CDB-PHONE) *only* the open lots -- **
10:28:59 <CDB-PHONE> [10:25] (@warlord) Honestly, I think policy.c already implements FIFO lots. -- I think Chris said something yesterday about the code in there being spaghetti and needing cleanup?
10:30:46 <chris> that was jralls and he's more involved in infrastructure and lowlevel major changes than stock right now I think
10:30:46 <warlord> Could be. Linas wrong it, IIRC.
10:30:51 <warlord> s/wrong/wrote
10:30:55 <warlord> *sigh*
10:31:17 <CDB-PHONE> perhaps he did also wrong it as well :)
10:31:22 <warlord> hehehe
10:31:53 <CDB-PHONE> not that I know who he is or the quality of his code
10:32:42 <chris> If I understand it all, lots mainly useful for calculating capgains; acb doesn't need lots; fifo/lifo shouldn't need lots either.
10:32:53 <CDB-PHONE> luckily for Chris, at least I can still speak in pseudo code from my computer science days over 10 years ago
10:33:11 <chris> as long as you have excel skills
10:33:32 <CDB-PHONE> well, the building of arrays in step 1, is basically constructing lots
10:33:33 *** fabior has quit IRC
10:33:41 <CDB-PHONE> just temporally rather than permanently
10:34:04 <warlord> CDB-PHONE, which is done at transaction enter time
10:34:04 <chris> exactly. build lots in-memory rather than in-file which is editable by user.
10:34:27 <CDB-PHONE> the benefit of doing it temporally (just in time processing) means one less list to maintain
10:34:29 <warlord> chris, I think it's better to store it in the data...
10:34:54 <warlord> Because if there is a separate policy, it lets you maintain that manually.
10:34:58 <warlord> (c.f. Lot Editor)
10:35:16 <warlord> whereas if it's temporary, the results could change over time if the calculation changes.
10:35:32 * chris has lost this argument if both warlord and jralls are in agreement
10:35:57 <chris> I'd thought FIFO/LIFO calculations are straightforward enough to be codified
10:36:34 * chris bails out now.
10:36:41 <CDB-PHONE> I also agree with warlord that temporally is a bad idea
10:36:46 * chris bails out now of this issue.
10:36:51 <CDB-PHONE> consumed lots should be static
10:37:15 <warlord> I dont understand why we would want to reproduce the same calculations over and over again? And those calculations would get longer and longer as one has more trades.
10:37:55 <warlord> I agree that the calculations are straightforward, but I dont see why not to store the results to speed up "the next transaction"?
10:39:01 <CDB-PHONE> I have a different reason for not doing it temporally
10:39:02 <chris> because I felt lots are not updated consisently eg stock-split ignores lots completely
10:39:09 <chris> because I felt lots are not updated consisently eg assistant-stock-split ignores lots completely
10:39:24 <warlord> Well, that's the bug ;)
10:39:44 <chris> ditto ROC
10:39:45 <CDB-PHONE> given that lots are reported to the tax authority, sold lots have permanence and should never be altered
10:40:16 <CDB-PHONE> Chris: sounds like those assistants need to be fixed, rather than making the entire exercise temporal
10:40:18 * chris has no idea how fifo/lifo lots are handled when shorting.
10:40:32 <CDB-PHONE> I have no reason or interest to get involved in lots
10:40:45 <chris> ^ me neither ^_^
10:40:46 <CDB-PHONE> you essentially create negative unit lots
10:41:09 <CDB-PHONE> let's just stick to our average cost machinations
10:42:02 *** fell has quit IRC
10:42:39 <CDB-PHONE> speaking of speeding up calculations
10:42:54 <CDB-PHONE> Chris, for the average cost tool, we need to add report date range
10:43:10 *** fell has joined #gnucash
10:43:10 *** ChanServ sets mode: +o fell
10:43:13 <CDB-PHONE> to limit the dates processed as necessarily
10:43:49 <CDB-PHONE> if I sold all units at a certain date before repurchasing, no need to compute anything prior if my goal is only for cost basis
10:44:15 <chris> you'll want end-date only rather than start+end-date
10:44:21 <CDB-PHONE> I would only be interested in prior if I wanted to see cumulative total return, and that's probably the least important part
10:44:37 <CDB-PHONE> no, I want both dates
10:44:57 <CDB-PHONE> I don't need the report reading 20 years of day trading on a stock
10:45:09 <CDB-PHONE> I only need it to read starting from last week when u
10:45:22 *** o01eg has joined #gnucash
10:45:23 <CDB-PHONE> when the # shares went down to zero
10:48:12 *** fabior has joined #gnucash
10:49:44 <warlord> gnucash does not support "shorting", so no need to think about it right now.
10:50:23 <chris> ^ CDB made it work...
10:50:43 <CDB-PHONE> no thanks :)
10:50:53 <CDB-PHONE> +for lots)
10:51:08 <CDB-PHONE> it works for average cost, warlord
10:51:20 <CDB-PHONE> at least with the report Chris is building with me
10:51:24 <CDB-PHONE> don't know about lots
10:51:50 <CDB-PHONE> I'm sure it might break in other places
10:51:53 <chris> https://github.com/christopherlam/gnucash/blob/maint-stock-editor/gnucash/report/reports/standard/average-cost-basis.scm will be the home for acb-tool for now - click "Raw" for raw file
10:52:10 <CDB-PHONE> now that I think about it, I never ran balance sheet with the short position open
10:53:09 <chris> gtg now
10:53:09 <CDB-PHONE> Chris can you run old balance sheet on the date that SPY was short in that example file, see if it still balances!
10:53:18 <CDB-PHONE> ?*
10:54:07 <chris> seems to...
10:54:13 <CDB-PHONE> warlord I know the Mike Alexander report didn't like shorts, if I recall correctly
10:54:41 <CDB-PHONE> mine does! and Chris is building it!
10:59:45 <warlord> ok
11:08:34 *** fabior has quit IRC
11:22:40 *** fabior has joined #gnucash
11:25:46 *** jcarl43 has joined #gnucash
11:25:47 *** ChanServ sets mode: +v jcarl43
11:43:51 *** fabior has quit IRC
12:20:08 *** Hamaryns has joined #gnucash
12:20:08 *** ChanServ sets mode: +v Hamaryns
12:40:52 *** jervin has joined #gnucash
12:41:56 *** TownsendHardware1 has joined #gnucash
12:42:41 *** TownsendHardware has quit IRC
12:42:41 *** TownsendHardware1 is now known as TownsendHardware
12:47:08 *** Hamaryns has quit IRC
13:06:01 *** Hamaryns has joined #gnucash
13:06:01 *** ChanServ sets mode: +v Hamaryns
13:16:12 *** sbluhm has quit IRC
13:19:04 *** angel has joined #gnucash
13:24:25 *** Mechtilde has quit IRC
13:26:40 *** Mechtilde has joined #gnucash
13:28:38 *** jervin has quit IRC
13:34:05 <jralls> chris, re stock splits I think you're correct that the lot scrubber doesn't understand stock splits, but that's an implementation failure, of which it has many.
13:38:01 <jralls> CDB-PHONE Not double, stock splits can be any real multiplier. AAPL recently split 7 for 1. But the stock split wizard doesn't work with multipliers anyway, it works with added or subtracted (in the case of a reverse split) shares. So the computation has to apportion those added shares to the various open lots.
13:38:23 <CDB-PHONE> jralls I'm aware
13:38:34 <CDB-PHONE> just using double as an example for simplicity
13:39:22 <CDB-PHONE> the worst split I've ever had to deal with was 7:3 split
13:40:32 <CDB-PHONE> easier to just write "double" than "double, triple, 5:3, etc" when on phone
13:45:19 <jralls> CDB-PHONE s/double/split-ratio/.
13:46:18 <CDB-PHONE> didn't come to mind at the time when shoveling snow! ¯\_(ツ)_/¯
13:50:27 <jralls> Snow, huh? Does that means you were giving chris a snow job? ;-)
14:04:38 *** sbluhm has joined #gnucash
14:04:38 *** ChanServ sets mode: +v sbluhm
14:10:19 *** jervin has joined #gnucash
14:11:54 *** bertbob has quit IRC
14:18:34 *** jervin has quit IRC
14:18:43 *** jervin has joined #gnucash
14:24:03 *** angel has quit IRC
14:30:18 *** bertbob has joined #gnucash
14:30:19 *** ChanServ sets mode: +v bertbob
14:32:17 <CDB-PHONE> heh
14:38:37 *** CDB-Work has joined #gnucash
14:38:37 *** ChanServ sets mode: +v CDB-Work
15:02:22 *** ramontjunior has quit IRC
15:04:56 *** Hamaryns has quit IRC
15:19:25 *** jervin has quit IRC
15:27:54 *** Hamaryns has joined #gnucash
15:27:54 *** ChanServ sets mode: +v Hamaryns
15:28:49 *** Hamaryns has quit IRC
15:31:17 *** PowaBanga has joined #gnucash
15:39:17 *** jw4 has quit IRC
15:39:40 *** jw4 has joined #gnucash
15:39:40 *** ChanServ sets mode: +v jw4
15:40:40 *** CDB-Work has quit IRC
15:41:05 *** CDB-Work has joined #gnucash
15:41:05 *** ChanServ sets mode: +v CDB-Work
15:45:37 *** halipaul has joined #gnucash
15:47:44 *** gjanssens has quit IRC
15:50:14 *** David has quit IRC
15:50:19 *** David has joined #gnucash
15:54:58 *** Agfarmer18 has joined #gnucash
16:18:42 *** Agfarmer19 has joined #gnucash
16:20:29 *** Agfarmer18 has quit IRC
16:20:29 *** Agfarmer19 is now known as Agfarmer18
16:23:02 *** Agfarmer18 has quit IRC
16:31:27 *** Agfarmer18 has joined #gnucash
16:31:38 *** sbluhm has quit IRC
16:31:55 *** Mechtilde has quit IRC
16:51:06 *** Aussie_matt has joined #gnucash
16:56:42 *** Agfarmer18 has quit IRC
18:06:20 *** chris has quit IRC
18:11:41 *** chris has joined #gnucash
18:11:41 *** ChanServ sets mode: +v chris
18:11:44 *** gncbot sets mode: +o chris
18:17:57 <chris> I'll give up on the 'in-memory lots' idea. In my mind 1 less data structure to maintain meant capgains could be verified using stock activity and stock->policy flag. With lots, capgains are derived from lots which are derived from stock. Let's say no more. <exit>
18:41:53 *** Agfarmer18 has joined #gnucash
18:44:09 *** Agfarmer18 has quit IRC
18:47:26 <chris> assistant-stock-split should offer option of specifying split-ratio instead of delta-splits
18:50:14 <chris> CDB if you can craft a Norbert gambit datafile it'll make my task much easier
18:56:06 <CDB-PHONE> I don't think it will add any value Chris
18:56:17 <CDB-PHONE> Norbert's gambit involves 2 commodities
18:56:59 <CDB-PHONE> what I can do though is change the way you identify the proceeds account, perhaps give you a pattern match rule that doesn't require specifically selecting 1 account
19:06:47 <chris> a small datafile only will be fine
19:07:01 <chris> avoids me inputting invalid data
19:07:17 <chris> and the resulting report output
19:24:21 *** jcarl43 has quit IRC
19:30:51 <chris> gtg
19:30:54 *** chris has quit IRC
19:33:24 *** David has quit IRC
19:33:30 *** David has joined #gnucash
19:48:47 *** Agfarmer18 has joined #gnucash
19:52:43 *** Agfarmer18 has quit IRC
21:20:25 *** Agfarmer18 has joined #gnucash
21:20:48 *** Agfarmer18 has quit IRC
21:25:19 <CDB-Work> @tell chris well basically I plan yo redesign and issue a 2.0 of the current datafile in the ticket
21:25:19 <gncbot> CDB-Work: The operation succeeded.
21:25:56 <CDB-Work> @tell chris along with more explanations on each transaction as to what you ought to be matching for. but i'll need time to really think through this, so a weekend where i have time
21:25:56 <gncbot> CDB-Work: The operation succeeded.
21:38:21 *** jervin has joined #gnucash
21:44:43 *** jervin has quit IRC
22:06:15 *** fell has quit IRC
22:09:57 *** fell has joined #gnucash
22:09:57 *** ChanServ sets mode: +o fell