打印本文打印本文 关闭窗口关闭窗口

求老师帮我编写一个程序

作者:金字塔 来源:cxh99.com 发布时间:2014年04月13日
  • 咨询内容: 求老师帮我编写一个程序,条件是
    1》kdj死叉  空开仓   金叉  空平仓  。 
    2》成交之后以成交价为准自动止损5个点,止赢10个点。   3》下午2:55之前强行平仓 [此贴子已经被作者于2014/2/12 13:02:57编辑过]

     

  • 金字塔客服:

    {1》kdj死叉  空开仓   金叉  空平仓  。


    2》成交之后以成交价为准自动止损5个点,止赢10个点。 
     
    3》下午2:55之前强行平仓}
    k:stkindi('','kdj.k',0,1);
    d:stkindi('','kdj.d',0,1);
    t1:=time<145500;
    t2:=time>=145500;
    if cross(d,k) and t1 then buyshort(holding=0,1,thisclose);
    if cross(k,d) and t1 then sellshort(1,0,market);

    if t1 and h>enterprice+5*mindiff and enterbars>0 then sellshort(1,0,market);//止损
    if t1 and l<enterprice-10*mindiff and enterbars>0  then sellshort(1,0,market);//止盈

    if t2 then sellshort(1,0,market);// 强平

     

  • 用户回复:

    谢谢老师的答复,我是新人第一次接触程序化交易,真心谢谢老师!!我试试看看能不能行。再次真心谢谢老师!

打印本文打印本文 关闭窗口关闭窗口