分析家公式网,提供指标公式,股票软件 用户登录  |  用户 注册

软件名称:[B]开拓者指标:价差套利模型、一款免费的套利模型源码[/B]
软件类型:国产软件
运行环境:Win9X/Win2000/WinXP/Win2003/Win7/
软件语言:简体中文
授权方式:免费版
软件大小:0 Bytes
官方主页:Home Page
更新时间:2018-08-28 01:15:37
软件简介:

 公式简介:

 
套利、只听这个词我们就知道这是一个只赚不赔的买卖,今天再送上一款可自动下单的TB套利模型,参数里的两腿合约的套利值需要自已根据情况来修改,更重要的是套利时先设置叠加数据,套利模型的界面可见下图,在K线主图里还可以见到一个灰色的K线图表,这就是叠加的数据,策略会根据这两个数据的差值进行分析或下单操作.
 
实盘套利模型
 
该策略仅供大家学习交流,实站的话,它的可靠性还有很大的差距,因此源码里有很多细节的问题没有处理。

 
 
Params
     Numeric uprice1(100);
         Numeric uprice2(150);
         Numeric uprice3(200);
         Numeric dprice1(-100);
         Numeric dprice2(-150);
         Numeric dprice3(-200);
         Numeric lots1(1);
         Numeric lots2(2);
         Numeric lots3(4);   
Vars
        Numeric NO1(0);
    Numeric M;
    Numeric M1;
        NumericSeries buyprice;
        NumericSeries sellprice;
        BoolSeries Upline;
        BoolSeries Upline1;
        BoolSeries Upline2;
        BoolSeries downline;
        BoolSeries downline1;
        BoolSeries downline2;
Begin
     M=Data0.close-Data1.close;
     M1=(Data0.open)-(Data1.open);
          upline=CrossOver(M,uprice1);
          upline1=CrossOver(M,uprice2);
          upline2=CrossOver(M,uprice3);
          downline=CrossUnder(M,dprice1);
          downline1=CrossUnder(M,dprice2);
          downline2=CrossUnder(M,dprice3);       
 If(data0.MarketPosition !=-1 and (upline==true))
  { data0.SellShort(lots1,data0.close);
  data1.buy(lots1,data0.close); }
If(data0.MarketPosition==-1 and (upline1==true))
  { data0.SellShort(lots2,data0.close);
  data1.buy(lots2,data1.close);}
If(data0.MarketPosition==-1 and (upline2==true))
  {data0.SellShort(lots3,data0.close);
  data1.buy(lots3,data1.close); }
If(data0.MarketPosition!=1 and (downline==true) )
{data0.buy(lots1,data0.close);
data1.SellShort(lots1,data1.close);}
If(data0.MarketPosition==1 and (downline1==true) )
{data0.buy(lots2,data0.close);
data1.SellShort(lots2,data1.close);}
If(data0.MarketPosition==1 and (downline2==true) )
{data0.buy(lots3,data0.close);
data1.SellShort(lots3,data1.close);}
End
 
 
 

[url=http://www.70822.com/soft/sort013/sort083/down-127990.html]开拓者指标:价差套利模型、一款免费的套利模型源码[/url]

关于本站 | 网站帮助 | 广告合作 | 声明 | 友情连接 | 网站地图 |
分析家公式网声明:本站所有股票公式软件资料均网上公开收集,如侵权请联系删帖。站内所有广告,均与本站无关!
Copyright © 2003-2024 70822.Com. All Rights Reserved .
页面执行时间:62.50000 毫秒