doc: explain roi-unrealised.ledger, reference to cookbook
This commit is contained in:
		
							parent
							
								
									7bfbcde627
								
							
						
					
					
						commit
						18623ec287
					
				| @ -1,6 +1,34 @@ | |||||||
| ; Example from hledger mail list. | ; Example from hledger mail list. | ||||||
| ; roi usually shows rate of return based on realised gains.  | ; author of the mailing list post wrote: "roi usually shows rate of return based on realised gains.  | ||||||
| ; By adding some fake transactions you can make it show unrealised gains. | ; By adding some fake transactions you can make it show unrealised gains." | ||||||
|  | ;  | ||||||
|  | ; Note that you can record dividends with a three-posting transaction, which will yield simpler account structure: | ||||||
|  | ; | ||||||
|  | ; 2014-12-31 Initial Deposit | ||||||
|  | ;     Equity:Opening    -722.40 | ||||||
|  | ;     Assets:Cash | ||||||
|  | ;  | ||||||
|  | ; 2014-12-31 Buy Royal Bank of Canada @ 71.74 | ||||||
|  | ;     Assets:Trading:RY     10 RY @ 71.74 | ||||||
|  | ;     Assets:Cash    -722.40 | ||||||
|  | ;     Expenses:Fees      5.00 | ||||||
|  | ;  | ||||||
|  | ; 2015-01-22	0.75 Dividend | ||||||
|  | ;     Assets:Cash         7.50 | ||||||
|  | ;     Assets:Trading:RY   0 | ||||||
|  | ;     Income:Dividend:RY | ||||||
|  | ;  | ||||||
|  | ; 2015-04-21	0.77 Dividend | ||||||
|  | ;     Assets:Trading:Cash       7.70 | ||||||
|  | ;     Assets:Trading:RY         0 | ||||||
|  | ;     Income:Dividend:RY | ||||||
|  | ; | ||||||
|  | ; and so on. And then ROI could be computed thusly: | ||||||
|  | ; | ||||||
|  | ; hledger -f examples/roi-unrealised.ledger roi --inv Assets:Trading:RY -b 2015-01-01 -e 2019-01-01 --pnl Income --yearly --value=then | ||||||
|  | ; | ||||||
|  | ; See Cookbook -> (Return on Investment) for more info. | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| comment | comment | ||||||
| $ hledger -f examples/roi-unrealised.ledger roi --inv Assets -b 2015-01-01 -e 2019-01-01 --pnl  Income --yearly --value=then | $ hledger -f examples/roi-unrealised.ledger roi --inv Assets -b 2015-01-01 -e 2019-01-01 --pnl  Income --yearly --value=then | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user