日内交易策略:日内指数由最低至最高点振幅达到2%的时候,开空2手。亏损0.2%平仓,盈利0.8%平仓。
举例说明:白糖期货:SR1501 现价4650 则 振幅2% 为4650*0.02=93点 ; 0.02%为4650*0.002=9点 ;盈利0.8% 为4650*0.008=37.2=37点
最低点反弹至最高点达到2%的时候,开空白糖,9点止损,37点止盈。
以上策略如何写呢?【白糖是举例,最好是设定一个参数,这样在换其他品种也可以直接套入了】
ll:llv(l,TODAYBAR);
if (h-ll)/ll>=0.02 then buyshort(holding=0,1,market);
if (h-enterprice)/enterprice>=0.002 then sellshort(holding<0,holding,market);
if (enterprice-l)/enterprice>=0.008 then sellshort(holding<0,holding,market);
[此贴子已经被作者于2014/10/31 13:15:09编辑过]
程序我导入了,由于2%的最高最低点出现的几率比较低,所以改成1%了。 但是发现不对。你检查看看呢。
图片上传不了
我就简单阐述吧。 白糖今天最低4635.最高价4687. 最低4635波动1%位置是4635+46=4681 ; 0.2%止损是4690,0.8%止盈是4645.这样开来今天的交易应该是4681开空,4645开空平仓。 可是图示指标是开仓后很快止损了。

此主题相关图片如下:1.jpg
1,9:26是止损平仓
2,不是你说的这样计算的,4681是开仓条件,公式中的enterprice是9:27分的开盘价4677而不是2681.
为什么是4677而不是4681呢?这是由market决定的,图上开仓价是取次周期开盘价。
有关资料:http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=52160
日内交易策略:日内指数由最低至最高点振幅达到1%的时候,开空2手。亏损0.2%平仓,盈利0.8%平仓。举例说明:白糖期货:SR1501 现价4650 则 振幅2% 为4650*0.02=93点 ; 0.2%为4650*0.002=9点 ;盈利0.8% 为4650*0.008=37.2=37点
最低点反弹至最高点达到2%的时候,开空白糖,9点止损,37点止盈。
以上策略如何写呢?【白糖是举例,最好是设定一个参数,这样在换其他品种也可以直接套入了】 这是向上的策略。
向下的模型是不是这样写。。就是做低点至最高点达到1%,后面开多单,然后0.2%止损,0.8%止盈
ll:llv(l,TODAYBAR); if (ll)-h)/h>=0.01 then buyshort(holding=0,1,market); if (ll-enterprice)/enterprice>=0.002 then sellshort(holding<0,holding,market); if (enterprice-l)/enterprice>=0.008 then sellshort(holding<0,holding,market);
看看是这样吗----就是最高点至最低点
|
1,回复5,6楼勾选固定时间间隔
2,只是写一个范例,参数是您自己根据品种定的,不可能写出来一个策略适合所有品种
向上的策略:
ll:llv(l,TODAYBAR);
if (h-ll)/ll>=0.02 then buyshort(holding=0,1,market);
if (h-enterprice)/enterprice>=9 then sellshort(holding<0,holding,market);
if (enterprice-l)/enterprice>=37 then sellshort(holding<0,holding,market);
向下策略到底是要求开多还是开空?1楼说开空7楼又说开多
[此贴子已经被作者于2014/10/31 13:14:46编辑过]
哦这样的 , 从最低点至最高点运行1%之后开空;从最高点至最低点运行1%之后开多。
回复9楼:
ll:llv(l,TODAYBAR);//当天最低价
hh:hhv(h,todaybar);//当天最高价
if (h-ll)/ll>=0.01 and holding=0 then buyshort(1,1,market);
if (hh-l)/hh>=0.01 and holding=0 then buyshort(1,1,market)