📄 buyhold.m
字号:
// BuyHold.m// This file defines the method of stock valuation for// fundamental traders....// -- this trader just retains the initial endowment and// all periodic cash flow resulting from those positions.// -- we will use this individual to derive the fundamental// price//#import "BuyHold.h"// Implementation of a fundamental trader ..@implementation BuyHold- (double) getRiskyValue{ if (diagLevel & METHOD_ENTRY) printf("*** getRiskyValue (BuyHold) entry\n"); return (riskyValue);}-balancePort { // BASE BuyHold trader does NO rebalancing. return self;}-step { if ((diagLevel & METHOD_ENTRY) || (diagLevel & METHOD_SCHED)) printf("*** step (BuyHold) entry\n"); liqNeeds = [self getLiqNeeds]; wealth = [self getWealth]; if (diagLevel & TRADER_WEALTH) { printf("<%s> wealth is <%f>", [self getName], wealth); printf(" riskyU <%f> riskLU <%f> C <%f>\n", riskyUnits, riskLessUnits, cash); } [self balancePort]; return self;}@end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -