diff options
-rw-r--r-- | config.cc | 8 | ||||
-rw-r--r-- | ledger.texi | 3 | ||||
-rw-r--r-- | valexpr.cc | 7 | ||||
-rw-r--r-- | walk.cc | 8 |
4 files changed, 10 insertions, 16 deletions
@@ -586,16 +586,16 @@ OPT_BEGIN(average, "A") { } OPT_END(average); OPT_BEGIN(deviation, "D") { - config.total_expr = std::string("DM") + config.total_expr; + config.total_expr = std::string("t-M") + config.total_expr; } OPT_END(deviation); OPT_BEGIN(trend, "X") { - config.total_expr = std::string("MDM") + config.total_expr; + config.total_expr = std::string("M(t-M") + config.total_expr + ")"; } OPT_END(trend); OPT_BEGIN(weighted_trend, "Z") { - config.total_expr = (std::string("MD(M(") + config.total_expr + - ")/(1+(((m-d)/(30*86400))<0?0:((m-d)/(30*86400)))))"); + config.total_expr = (std::string("M(t-(M(") + config.total_expr + + ")/(1+(((m-d)/(30*86400))<0?0:((m-d)/(30*86400))))))"); } OPT_END(weighted_trend); } // namespace ledger diff --git a/ledger.texi b/ledger.texi index 4b854e8b..3d5acd26 100644 --- a/ledger.texi +++ b/ledger.texi @@ -967,9 +967,6 @@ Strips the commodity from the argument. @item M The median of the argument; @samp{Mx} is the same as @samp{x/n}. -@item D -The deviation of the argument; @samp{Dx} is the same as @samp{x-x/n}. - @item P The present market value of the argument. The syntax @samp{P(x,d)} is supported, which yields the market value at time @samp{d}. @@ -505,13 +505,6 @@ value_expr_t * parse_value_term(std::istream& in) node->left = parse_value_term(in); break; - case 'D': { - node.reset(new value_expr_t(value_expr_t::O_SUB)); - node->left = parse_value_term("a"); - node->right = parse_value_term(in); - break; - } - case 'P': node.reset(new value_expr_t(value_expr_t::F_VALUE)); if (peek_next_nonws(in) == '(') { @@ -38,8 +38,10 @@ void sort_transactions::flush() for (transactions_deque::iterator i = transactions.begin(); i != transactions.end(); - i++) + i++) { + transaction_xdata(**i).dflags &= ~TRANSACTION_SORT_CALC; (*handler)(**i); + } transactions.clear(); @@ -405,8 +407,10 @@ void walk_accounts(account_t& account, sort_accounts(account, sort_order, accounts); for (accounts_deque::const_iterator i = accounts.begin(); i != accounts.end(); - i++) + i++) { + account_xdata(**i).dflags &= ~ACCOUNT_SORT_CALC; walk_accounts(**i, handler, sort_order); + } } else { for (accounts_map::const_iterator i = account.accounts.begin(); i != account.accounts.end(); |