Rss & SiteMap

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

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

标题:【求助】帮忙写一个简单模型

1楼
shh66666 发表于:2020/1/16 9:50:21
开仓条件:尾盘2:59,价格除了都在日线级别的5日线跟20日线之上的时候,其他时候都在尾盘做空。

止盈条件:1、如果第二天低开10个点以内的时候直接止盈。2、如果低开超过10个点,就一直拿着等涨回到10个点止盈,要是今天没涨回到10个点,就一直持有到第二天,第二天就按最开始的方式处理,低开10个点以内直接止盈,10个点以上等回10个点的时候止盈。就这样一直持续下去。

止损条件:1、高开5个点之内,直接止损。2、高开5个点以上,等再涨20个点的时候止损,不然就等回成本价平仓。
2楼
yukizzc 发表于:2020/1/16 12:46:39

//自己在ma公式里定义好cond:ma5>ma20;

cond1:stkindi('','ma.cond',0,6,0);
if time=0259 and cond1 and holding=0 then buyshort(1,1,marketr);
if todaybar=1 and open>ref(close,1)-10 and open<ref(close,1) then sellshort(1,holding,marketr);
if todaybar>1 and ref(open,todaybar)<ref(close,todaybar+1)-10 and close>ref(close,todaybar+1)-10 then sellshort(1,holding,marketr);

if todaybar=1 and open<ref(close,1)+5 and open>ref(close,1) then sellshort(1,holding,marketr);
if todaybar>1 and ref(open,todaybar)>ref(close,todaybar+1)+5 and (close>ref(close,todaybar+1)+20 or close<=enterprice)  then sellshort(1,holding,marketr);

3楼
shh66666 发表于:2020/1/16 14:24:49

//自己在ma公式里定义好cond:ma5>ma20;


这句话什么意思?

4楼
FireScript 发表于:2020/1/16 15:09:40
 他这个意思是需要你修改下系统或者自己编写的ma指标里面的内容。
就是加一个新定义的变量,以方便进行调用。

图片点击可在新窗口打开查看此主题相关图片如下:temp.png
图片点击可在新窗口打开查看
5楼
FireScript 发表于:2020/1/16 15:26:39
 纠正下是:
cond:ma1>ma3;


ma1默认参数是5  ma3默认是20
6楼
shh66666 发表于:2020/1/16 15:27:44
不是5日线大于20日线。我的想法是,比如说今天2点59分的价格只要不同时在5日线跟20日线之上的时候开空
7楼
FireScript 发表于:2020/1/16 15:37:31
 1.交易周期是什么周期
2.除了做空之外的情况 就做多是吗?还是单纯只做空。
[此贴子已经被作者于2020/1/16 15:38:50编辑过]
8楼
shh66666 发表于:2020/1/16 15:48:46
我的目的就是尾盘买入,看第二天开盘情况,做的什么周期我自己也说不上来,只是做空
9楼
FireScript 发表于:2020/1/16 16:05:13
 先按照1分钟这种周期 去校验思路正确性吧。
ma1:stkindi('','ma1',0,6,0);
ma3:stkindi('','ma3',0,6,0);
cond:not(c>ma1 and c>ma3);//cond为1 则做空 反之不开仓
if time=165900 and cond and holding=0 then buyshort(1,1,marketr);//金字塔时间和北京时间相差4小时 下午2:59等效于金字塔时间165900。这个time判断是和周期有关的。所以周期变动,这个也是需要修改的,这里先按照1分钟处理。

if todaybar=1 and open>ref(close,1)-10*MINDIFF and open<ref(close,1) then sellshort(1,holding,marketr);
if todaybar>1 and ref(open,todaybar)<ref(close,todaybar+1)-10 and close>ref(close,todaybar+1)-10*MINDIFF then sellshort(1,holding,marketr);

if todaybar=1 and open<ref(close,1)+5*MINDIFF and open>ref(close,1) then sellshort(1,holding,marketr);
if todaybar>1 and ref(open,todaybar)>ref(close,todaybar+1)+5 and (close>ref(close,todaybar+1)+20 or close<=enterprice)  then sellshort(1,holding,marketr);
[此贴子已经被作者于2020/1/16 16:06:27编辑过]
10楼
shh66666 发表于:2020/1/16 16:11:39
好的,谢谢,我先测试下效果
共12 条记录, 每页显示 10 条, 页签: [1] [2]


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