首页 > > 详细

帮做TB程序化公式、公式选股代做、开拓者盈多亏交易策略源码-开拓者公式



//------------------------------------------------------------------------
// 简称: JY
// 名称:盈多亏少
// 类别: 公式应用
// 类型: 用户应用
// 输出:
//------------------------------------------------------------------------
Params
Bool bInitStatus(false);

Numeric InitMP(0);
Numeric MidLinel(5600);
Numeric MidLineLength(250);
Numeric FirstGrid(3);
Numeric TotalGrids(10);
Numeric GridInterval(3);
Numeric WinGrid(3);

Numeric EveryLots(1);

Numeric MidLineWeieht(1);
Numeric ExitOnCloseMins(14.50);

Vars
Numeric MidLineWeight;
NumericSeries midline;

Numeric MinPoint;

Numeric AvgOfClose;

Numeric AskLine;

Numeric BidLine;

NumericSeries RealMidLine;

Numeric MyRealMp(0);

Numeric TmpGridIndex;

Numeric TmpPrice;
Numeric TmpPriee;
Numeric OpenDPrice;

Begin
penDPrice= opend;
if(dayday[1])
{
midline=OpenDPrice;
}Else
{
midline=midline[1];
}
MinPoint=MinMove*PriceScale;
MyRealMp=GetGlobalvar (0);
AvgOfClose =AverageFC(Close, MidLineLength);

If (BarStatus== O)
{
If(MyRealMp == InvalidNumeric || bInitStatus)
{
MyRealMp=InitMP;
SetGlobalVar(0,MyRealMp);
}Else
If(BarStatus==2A_AccountID!="")
{
If(Q_AskPrice RealMidLine+FirstGrid*MinPoint)
{
TmpPrice=RealMidLine+FirstGrid*MinPoint+Abs (MyRealMp)* (GridInterval*MinPoint);
TmpPriee=Ceiling (TmpPrice, Minpoint);

Commentary ("开仓价="+text (TmpPrice));

TmpGridIndex=1- IntPart ((BidLine-RealMidLine -FirstGrid*MinPoint)/(GridInterval*MinPoint));
If(TmpGridIndex=-1*TotalGrids)
{
MyRealMp=MyRealMp-1;
A_SendOrder (Enum_Buy, Enum_Entry, EveryLots, BidLine);
}//来源:
}Else
If(MyRealMp>=0 AskLineMyRealMp TmpGridIndexO)
{
TmpPrice=RealMidLine-FirstGrid*MinPoint - (Abs (MyRealMp) -1) * (GridInterval*MinPoint) +WinGrid*MinPoint;
TmpPrice = Ceiling(TmpPrice, MinPoint);
Commentary ("平仓价 ="+Text (TmpPriee));

}Else
If (MyRealMpMyRealMp)
{
MyRealMp=MyRealMp+1;
A_SendOrder (Enum_Sell, Enum_Exit, EveryLots,AskLine);

TmpGridIndex=1+IntPart((RealMidLine-FirstGrid*MinPoint+WinGrid*MinPoint-BidLine)/(GridInterval*MinPoint));

TmpGridIndex=max (0, TmpGridIndex);
}
If(TmpGridIndex ExitOnCloseMins/100)
{
If(MyRealMp>0)
{
MyRealMp=MyRealMp-1;
A_SendOrder(Enum_Sell,Enum_Exit,EveryLots,BidLine);
}Else
If(MyRealMp0.145000 and CurrentTime<0.150000)
{
A_SendOrder(Enum_Sell,Enum_Exit,1,Q_BidPrice);
A_SendOrder(Enum_Buy,Enum_Exit,1,Q_AskPrice);
}
End
//------------------------------------------------------------------------
// 编译版本GS2010.12.08
// 用户版本2012/09/10 11:16
// 版权所有
// 更改声明TradeBlazer Software保留对TradeBlazer平台
//每一版本的TrabeBlazer公式修改和重写的权利
//------------------------------------------------------------------------

联系我们 - QQ: 88652583
© 2014 www.93stock.com
代写选股公式网!
声明:警惕假冒分子冒充本站提供证券咨询服务,选股公式网为非证券咨询机构,本站不提供有关股评、投资分析报告、股市预测,证券咨询等服务。本站仅提供股票、期货、黄金、外汇的软件技术交流与分享。本站文章为互联网文章,其仅供参考,并不构成投资建议。