PortfolioBackTesting_Quantity_CashAllocation
简述
数量类套利类组合资金分配,按照最新剩余资金、最新持仓个数和资金分配方法,确定每个准备买入证券所分配的资金
PortfolioBackTesting_Quantity_CashAllocation(Cash:Real;NewestNumber:Integer;NumberOfWillBuying:Integer;MaxNumer:Integer;MinNumber:Integer;MethodType:Integer;Number:Integer;CashPerUnit:Real);
名称 | 类型 | 说明 |
---|
Cash | Real | 实数,可用资金 |
NewestNumber | Integer | 整数:最新持有个数 |
NumberOfWillBuying | Integer | 整数,符合买入条件的个数 |
MaxNumer | Integer | 整数,最多允许持有个数 |
MinNumber | Integer | 整数,最少持有个数 |
MethodType | Integer | 整数,资金分配方法,取值为0表示固定最大持有个数法,取值为1表示最少持有个数法 |
Number | Integer | 整数,实际可买入个数 |
CashPerUnit | Real | 实数,每个所分配的资金 |
返回 | | 实际可买入个数以及每个可分配的资金 |
PortfolioBackTesting_Quantity_CashAllocation(10000000,5,4,10,5,0,Number,CashPerUnit);
return array('实际可买入个数':Number,'分配资金':CashPerUnit);
//结果: