天软金融分析.NET函数大全 > 金融函数 > 金融工程 > Dev

PortfolioCalcSys    

简述
交易策略测试(复杂参数,可选条件)
定义
PortfolioCalcSys(Sector:String;InitMoney:Real;StartDate:TDateTime;EndDate:TDateTime;CommissionCharge:Real;ScaleRestriction:Real;Negotiability:Real;BuyC:Expression;SellC:Expression;MinSell:Integer;MinBuy:Integer;BuyPrice:Expression;SellPrice: Expression;ValuePrice:Expression;MaxBuyRate:Real;MaxSellRate:Real;MinCommissionCharge:Real;BuyUnit:Integer;FreeZeRate:Real;BaseMoney:Real;ListDays:Integer): TableArray
参数
名称类型说明
SectorString字符串,市场板块
InitMoneyReal整数,初始资金
StartDateTDateTime日期型时间,开始时间
EndDateTDateTime日期型时间,截止时间
CommissionChargeReal实数,手续费
ScaleRestrictionReal实数,单支证券比例约束(0.1表示10%)
NegotiabilityReal实数,流通性(0.05表示5%)
BuyCExpression布尔表达式,买入条件
SellCExpression布尔表达式,卖出条件
MinSellInteger整数,最小卖出股数
MinBuyInteger整数,最小买入股数
BuyPriceExpression用户自定义,表达式,买入价格
SellPrice Expression用户自定义,表达式,卖出价格
ValuePriceExpression用户自定义,表达式,计算价值
MaxBuyRateReal实数,最大买入占的比例(和实际交易值比,0.1表示10%)
MaxSellRateReal实数,最大卖出比例(和真实交易相比,0.1表示10%)
MinCommissionChargeReal实数,最低手续费
BuyUnitInteger整数,买入单位
FreeZeRateReal实数,冻结比例(当日卖出得到的资金不准许买入的比例,1表示全部冻结)
BaseMoneyReal实数,最低操作资金(防止过多操作)
ListDaysInteger整数,起码上市天数
返回 TableArray交易策略测试(复杂参数,可选条件)
  • 范例

      Return PortfolioCalcSys(

    "申万煤炭开采",

    1000000,

    inttodate(20120825),

    inttodate(20121023),

    0,

    0.2,

    0.05,

    @(StockZF3()>8),

    @(StockZF3()<-3),

    100,

    100,

    @close(),

    @close(),

    @close(),

    0.1,

    0.1,

    5,

    100,

    1,

    10000,

    100);

    //结果:
相关