Rss & SiteMap

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

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

标题:[求助]请帮忙写一个例子

1楼
yohooo00 发表于:2017/5/12 9:10:18
满足条件A时,为买入参考信号,出现信号时的价位为参考信号价位1。当价格自参考信号价位1回落X价位时买入,止损幅度为实际买入价和参考信号价1的价差。
满足条件B时,为卖出参考信号,出现信号时的价位为参考信号价位2.当价格自参考信号价位2上升X价位时卖出,止损幅度为实际卖出价和参考信号价2的价差。
这实际上是一个回调买入的策略思路。搜了一下论坛没有找到类似的参考,所以想麻烦你们给写一个作为参考。谢谢。
2楼
pyd 发表于:2017/5/12 9:25:21
图表交易吗?图表取不到实际买入价,只能取图上虚拟买入价位enterprice
3楼
yohooo00 发表于:2017/5/12 9:28:02
enterprice即可。仅作参考。
4楼
pyd 发表于:2017/5/12 9:58:33
VARIABLE:n=0,m=0;
if a then n:=c;
if n-l>=x and holding=0 then buy(1,1,marketr);
if enterprice-c>=abs(enterprice-n) and holding>0 then sell(1,1,marketr);
if b then m:=c;
if h-m>=x and holding=0 then buyshort(1,1,marketr);
if c-enterprice>=abs(enterprice-m) and holding<0 then sellshort(1,1,marketr)
共4 条记录, 每页显示 10 条, 页签: [1]


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