以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请帮忙写个公式  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=173967)

--  作者:pgdy77716
--  发布时间:2020/1/14 10:55:39
--  请帮忙写个公式


1.5周期均线上穿150周期均线,做多;5周期均线下穿150周期均线,做空。

2.当价格低于买入价或高于卖出价1.008时止损。

3.当价格高于买入价或低于卖出价1.02时止赢。

4.当价格从买入或卖出后的最高价或最低价回撤20%时止盈。

5.每日收盘前3分钟清仓,加载在3分钟或5分钟K线。


--  作者:FireScript
--  发布时间:2020/1/14 11:11:05
--  
1.008” 这个是指的是当前价格浮动的百分比?还是指的价格相差的点数?

--  作者:pgdy77716
--  发布时间:2020/1/14 11:22:09
--  
价格差


--  作者:pgdy77716
--  发布时间:2020/1/14 11:22:55
--  
价格浮动百分比
--  作者:FireScript
--  发布时间:2020/1/14 13:19:49
--  
 “

2.当价格低于买入价或高于卖出价1.008时止损。

3.当价格高于买入价或低于卖出价1.02时止赢。

还有个地方需要明确下的。这里标记的地方是什么意思。高于上次卖出价 低于上次卖出价?

--  作者:pgdy77716
--  发布时间:2020/1/14 17:15:31
--  
卖空的价格
--  作者:yukizzc
--  发布时间:2020/1/14 19:49:41
--  

ma5:ma(close,5);
ma150:ma(close,150);
if cross(ma5,ma150) then
begin
 sellshort(1,1,marketr);
 buy(1,1,marketr);
end

if cross(ma150,ma5) then
begin
 sell(1,1,marketr);
 buyshort(1,1,marketr);
end

//止损
if close<enterprice*(1-0.008) and holding>0 then sell(1,holding,marketr);
if close>enterprice*(1+0.008) and holding<0 then sellshort(1,holding,marketr);

//止盈
if close>enterprice*(1+0.02) and holding>0 then sell(1,holding,marketr);
if close<enterprice*(1-0.02) and holding<0 then sellshort(1,holding,marketr);

//回撤
if close<hhv(close,enterbars)*(1-0.2) then sell(1,holding,marketr);
if close>llv(close,enterbars)*(1+0.2) then sellshort(1,holding,marketr);

if time = 150000 then
begin
 sell(1,holding,marketr);
 sellshort(1,holding,marketr);
end


--  作者:pgdy77716
--  发布时间:2020/1/14 22:04:57
--  
加载后,为什么开多的单根k线上会出现平多信号


--  作者:yukizzc
--  发布时间:2020/1/15 9:12:31
--  

//回撤
if close<hhv(close,enterbars+1)*(1-0.2) then sell(1,holding,marketr);
if close>llv(close,enterbars+1)*(1+0.2) then sellshort(1,holding,marketr);

 

回撤这类改下


--  作者:FireScript
--  发布时间:2020/1/15 9:24:14
--  
 按照代码逻辑是不会的这样的。你看下是不是收盘K或者是反手的操作的。可以提供下截图说明你这个信号情况。