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

软件名称:[B]开拓者夹板交易策略源码(振荡交易模型)[/B]
软件类型:国产软件
运行环境:Win2000/WinXP/Win2003/WinVista
软件语言:简体中文
授权方式:共享软件
软件大小:0 Bytes
官方主页:Home Page
更新时间:2013-03-12 04:50:42
软件简介:

  • 内容: 夹板在实盘中是一个很常见的运用,用于吃住震荡行情。它有个上轨和一个下轨,行情突破上轨就做空;突破下轨就做多,在上下轨之间来回吃。

    OpenCoverFor2Lines函数代码

  • 源码:

    1. // 返回值: 1:有所动作,0:没有动作
       
    2. // 返回值为非零时,把当前要建立的头寸大小和方向写入needPosition,把以什么价咯去建立该头寸写入needPrice
       
    3. // 返回值: 1:有所动作,0:没有动作
       
    4. // 返回值为非零时,把当前要建立的头寸大小和方向写入needPosition,把以什么价咯去建立该头寸写入needPrice
       
    5.  
       
    6. Params
       
    7.         Numeric         currentPosition(0);                // 当前头寸,可正可负
       
    8.         Numeric        firstLots(0);
       
    9.  
       
    10.         Numeric         wantShort(120);                // 开空仓位置
       
    11.         Numeric         wantLong(8);                         // 开多仓位置
       
    12.        
       
    13.         Numeric        wantStopShort(0);                // 空头止损的位置
       
    14.         Numeric        wantStopLong(0);                // 多头止损的位置
       
    15.  
       
    16.        
       
    17.         // 注意:以下两个都是引用变量!!!!
       
    18.         NumericRef        needPosition;    // 经过计算后的当前头寸,正数:建立多仓,负数:建立空仓,零:平光所有头寸
       
    19.         NumericRef needPrice;              // 建立needPosition时的价咯
       
    20.        
       
    21. Vars
       
    22.         Numeric                         tem;
       
    23.        
       
    24. Begin
       
    25.  
       
    26.         // 14:55:00平掉当日所有头寸
       
    27.         if(time >= 0.1455 && currentPosition != 0)
       
    28.         {
       
    29.                 needPosition = 0;
       
    30.                 needPrice = close ;
       
    31.                 return 1;
       
    32.         }
       
    33.         if(currentPosition == 0)
       
    34.         {
       
    35.                 // 无仓,准备侍机开仓
       
    36.                 if(close <= wantLong)
       
    37.                 {
       
    38.                         // 多头 www.70822.com
       
    39.                         needPosition = firstLots;
       
    40.                         needPrice = wantLong;
       
    41.                         return 1;
       
    42.                 }
       
    43.                 if(close >= wantShort)
       
    44.                 {
       
    45.                         // 空头
       
    46.                         needPosition = -1 * firstLots;
       
    47.                         needPrice = wantShort;
       
    48.                         return 1;
       
    49.                
       
    50.                 }
       
    51.                 return 0;
       
    52.         }
       
    53.        
       
    54.         if(currentPosition > 0)
       
    55.         {
       
    56.                 // 持多仓,准备止损或反转
       
    57.                 if(close >= wantShort)
       
    58.                 {
       
    59.                         // 反转
       
    60.                         needPosition = -1 * firstLots;
       
    61.                         needPrice = wantShort;
       
    62.                         return 1;
       
    63.                 }
       
    64.                
       
    65.                 if(close <= wantStopLong)
       
    66.                 {
       
    67.                         // 止损
       
    68.                         needPosi
      [url=http://www.70822.com/soft/sort013/sort083/down-59402.html]开拓者夹板交易策略源码(振荡交易模型)[/url]

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