Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]学习了几天,轮回等老大们帮忙检查下这个系统的问题

1楼
wujk815 发表于:2010/9/21 20:47:03

我写了个三均线的系统ma5、13、62

当13上穿62时做多,13上穿5时平多仓,5上穿13时再次开多仓,13上穿5时再次平多仓。。。依次循环

当13下穿62时做空,13下穿5时平空仓,5下穿13时再次开空仓,13下穿5时再次平空仓。。。依次循环

下面是我写的,求各位大佬帮忙看看哪里出错,谢谢各位!

ma5:ma(c,5);
ma13:ma(c,13);
ma62:ma(c,62);
BPK :=CROSS(ma13,ma62);
bp:=cross(ma13,ma5);
SPK :=CROSS(ma62,ma13);
sp:=cross(ma5,ma13);
 
if BPK THEN
BUY(bpk,1,THISCLOSE);
if close>ma62 and bp then
sell(bp,0,thisclose); 
if close>ma62 and sp then
buy(sp and close>ma62 ,1,thisclose);
if close>ma62 and bp then
sell(bp,0,thisclose);

if SPK THEN
BUYSHORT(spk,1,THISCLOSE);
if close<ma62 and sp then
sellshort(sp,0,thisclose); 
if close<ma62 and bp then
buyshort(bp and close<ma62 ,1,thisclose);
if close<ma62 and sp then
sellshort(sp,0,thisclose);

[此贴子已经被作者于2010-9-21 20:55:11编辑过]
2楼
redest 发表于:2010/9/22 10:21:14

ma5:ma(c,5);
ma13:ma(c,13);
ma62:ma(c,62);
BPK :=CROSS(ma13,ma62);
bp:=cross(ma13,ma5);
SPK :=CROSS(ma62,ma13);
sp:=cross(ma5,ma13);
 

BUY((sp and (ma13>ma62 or close=ma62)) or bpk ,1,THISCLOSE);
sell(bp ,0,thisclose); 


BUYSHORT((bp and (ma13<ma62 or close=ma62)) or spk,1,THISCLOSE);

sellshort(sp ,0,thisclose); 

3楼
wattwei 发表于:2010/9/22 10:34:16
 二楼公式中条件close=ma62成立的可能性几乎为零
4楼
wujk815 发表于:2010/9/22 21:39:42
谢谢redest兄和wattwei兄,祝两位节日快乐!
5楼
redest 发表于:2010/9/23 12:36:47

2楼有误,

 

ma13>ma62 or ma13=ma62及ma13<ma62 or ma13=ma62分别为一组合条件,

与收盘价无关,谢谢3楼


BUY((sp and (ma13>ma62 or ma13=ma62)) or bpk ,1,THISCLOSE);
sell(bp ,0,thisclose); 

BUYSHORT((bp and (ma13<ma62 or ma13=ma62)) or spk,1,THISCLOSE);
sellshort(sp ,0,thisclose); 

6楼
蔡宛宏 发表于:2012/2/2 14:34:57
这个模型太理想化了  很难用啊
共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.