开仓条件:尾盘2:59,价格除了都在日线级别的5日线跟20日线之上的时候,其他时候都在尾盘做空。
止盈条件:1、如果第二天低开10个点以内的时候直接止盈。2、如果低开超过10个点,就一直拿着等涨回到10个点止盈,要是今天没涨回到10个点,就一直持有到第二天,第二天就按最开始的方式处理,低开10个点以内直接止盈,10个点以上等回10个点的时候止盈。就这样一直持续下去。
止损条件:1、高开5个点之内,直接止损。2、高开5个点以上,等再涨20个点的时候止损,不然就等回成本价平仓。
//自己在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);
他这个意思是需要你修改下系统或者自己编写的ma指标里面的内容。
就是加一个新定义的变量,以方便进行调用。

此主题相关图片如下:temp.png

不是5日线大于20日线。我的想法是,比如说今天2点59分的价格只要不同时在5日线跟20日线之上的时候开空
1.交易周期是什么周期
2.除了做空之外的情况 就做多是吗?还是单纯只做空。
[此贴子已经被作者于2020/1/16 15:38:50编辑过]
我的目的就是尾盘买入,看第二天开盘情况,做的什么周期我自己也说不上来,只是做空
先按照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编辑过]