[原创]请问 波段单子遇到重要数据 该怎么处理?
发表于:2016-09-20 00:55只看该作者
21楼 电梯直达
给你分享一下我用到的跟踪止损方式
public double BuyStopLoss
{
get
{
return BuyStopLoss2AvgVolatility
.GetBig(BuyStopLossAdjustment)
.GetBig(BuyStopLossStrongUpK)
.GetBig(BuyStopLossBigK)
//.GetBig(BuyStopLossFromHigh)
.GetBig(BuyStopLossByProfitRate)
.GetBig(ReachHighStopLoss)
.GetBig(BuyInsideStopLoss)
.GetBig(BuyTwoSmallKStopLoss)
;
}
}
其中止损和头寸多少和获利大小相关的代码是, 主要的思路是,赚的越多所允许返回给市场的幅度越小。
public double BuyStopLossByProfitRate
{
get
{
if (_testK.Adjustment == null)
{
if (_activeTrading.Count >= 5)
return (_testK.K.High - 0.3 * _testK.AverageVolatility);
else if (_activeTrading.Count >= 4)
return (_testK.K.High - 0.5 * _testK.AverageVolatility);
else if (ProfitRateToAvgVolatility > 3 || _activeTrading.Count >= 3)
return (_testK.K.High - 0.8 * _testK.AverageVolatility);//.GetBig(_testK.K.Close - _testK.Tester.StopLoss);
else if (ProfitRateToAvgVolatility > 2 || _activeTrading.Count >= 2)
return (_testK.K.High - 1.2 * _testK.AverageVolatility);
}
return 0;
}
}
仅供参考
发表于:2016-09-20 01:00只看该作者
22楼
大狮子,我只是分享一段代码,你也审核这么久
正确的思考模式是交易系统的灵魂。没有灵魂的交易系统,华而不实 ...