buyhold.m

来自「仿真人工金融市场Jackson代码」· M 代码 · 共 54 行

M
54
字号
//  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 + =
减小字号Ctrl + -
显示快捷键?