- 精华
- 0
- 在线时间
- 2 小时
- UID
- 252953
- 积分
- 5
- 帖子
- 2
- 阅读权限
- 10
- 注册时间
- 2017-6-23
- 最后登录
- 2018-1-28
- 精华
- 0
- UID
- 252953
- 积分
- 5
- 帖子
- 2
- 主题
- 1
- 阅读权限
- 10
- 注册时间
- 2017-6-23
- 最后登录
- 2018-1-28
|
//------------------------------------------------------------------------
// 简称: tbhz280
// 名称:
// 类别: 公式应用
// 类型: 用户应用
// 输出:
//------------------------------------------------------------------------
Params
Numeric Lots(1);
String Sys("L30");//交易策略标志
Numeric yingxian(7);//上影线长度平仓设置
Numeric juliang(279000);//巨量成交平仓设置
Numeric rbzy(92);//螺纹止盈点数
Vars
NumericSeries MA5;
NumericSeries MA60;
NumericSeries MA120;
NumericSeries MA25;
NumericSeries Zhisun;
NumericSeries Zhiying;
Bool Bfangliang;
Bool Sfangliang;
Begin
MA5 = Average(C,5);
MA60 = Average(C,60);
MA120 = Average(C,120);
MA25 = Average(C,25);
PlotNumeric("MA5",MA5,0,Red);
PlotNumeric("MA60",MA60,0,Blue);
PlotNumeric("MA120",MA120,0,Rgb(255,0,255));
PlotNumeric("MA25",MA25,0,Yellow);
IF((o<=ma25 && o<=ma5 ) && ( c > ma5 and c > ma25 ) )
{
Buy(Lots,o);
buyprice = o;
buybar = CurrentBar;
}
IF((o>ma25 && o>ma5 ) && ( c < ma5 and c < ma25 ) && MA5<MA25 && MA25>MA60)
{
SellShort(lots,o);
sellprice = o;
sellbar = CurrentBar;
}
If( h - buyprice>zhiying && CurrentBar>buybar)
{
Sell(lots,buyprice+zhiying);
Commentary("100点止盈");
}
If( sellprice-l>zhiying && CurrentBar>sellbar)
{
BuyToCover(lots,sellprice-zhiying);
Commentary("100点止盈");
}
end//------------------------------------------------------------------------ |
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|