设为首页收藏本站

 找回密码
 注册
查看: 3704|回复: 4
打印 上一主题 下一主题

求高手帮忙把MC改成TB谢谢! [复制链接]

Rank: 5Rank: 5

精华
0
UID
38411
积分
669
帖子
160
主题
17
阅读权限
60
注册时间
2011-5-8
最后登录
2023-10-4
跳转到指定楼层
1#
发表于 2011-12-8 08:43:28 |只看该作者 |倒序浏览
inputs: FastLength( 5 ), SlowLength( 12 ), MACDLength( 7 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) ;

var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;

condition1 = CurrentBar > 2 and var2 crosses over 0 ;
condition2 = CurrentBar > 2 and var2 crosses under 0 ;
condition3 = FastLength crosses over SlowLength ;
condition4 = FastLength crosses under SlowLength ;
condition5 = condition1 and condition3;
condition6 = condition2 and condition4;

if marketposition= 0 then

if condition5 then
Buy ( "MacdLE" ) next bar at (high+low)/2 stop ;
if condition6 then
Sell Short ( "MacdSE" ) next bar at (high+low)/2 stop ;
if marketposition= 1 and condition3 then
sell next bar at market ;
if marketposition= -1 and condition4 then
Buytocover next bar at market ;
一事无成

Rank: 5Rank: 5

精华
0
UID
85182
积分
849
帖子
302
主题
11
阅读权限
60
注册时间
2011-12-8
最后登录
2013-10-28
2#
发表于 2011-12-10 15:02:22 |只看该作者
这个怎么这么熟悉啊,我敢向毛主席发誓 ,我绝对看过这个code
http://qpic.cn/NifLLplMk若能一切随它去,便世间自在人。
      ---Derivatives

使用道具 举报

Rank: 4

精华
0
UID
8063
积分
279
帖子
200
主题
9
阅读权限
50
注册时间
2010-4-2
最后登录
2017-9-15
3#
发表于 2013-3-2 20:00:39 |只看该作者
CurrentBar > 2 是什么含义?另外

condition3 = FastLength crosses over SlowLength ;
condition4 = FastLength crosses under SlowLength ;

参数之间穿越?这个代码应该是有问题把

使用道具 举报

Rank: 4

精华
0
UID
8063
积分
279
帖子
200
主题
9
阅读权限
50
注册时间
2010-4-2
最后登录
2017-9-15
4#
发表于 2013-3-2 20:00:48 |只看该作者
CurrentBar > 2 是什么含义?另外

condition3 = FastLength crosses over SlowLength ;
condition4 = FastLength crosses under SlowLength ;

参数之间穿越?这个代码应该是有问题把

使用道具 举报

Rank: 4

精华
0
UID
8063
积分
279
帖子
200
主题
9
阅读权限
50
注册时间
2010-4-2
最后登录
2017-9-15
5#
发表于 2013-3-3 02:33:29 |只看该作者
这个就是个MACD的金叉死叉系统呀

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-5 05:32

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部