欢迎光临
我们一直在努力

9.3 整数类型枚举值

ENUM_ACCOUNT_INFO_INTEGER

枚举值说明数据类型
ACCOUNT_LOGIN登录账户IDlong
ACCOUNT_TRADE_MODE账户类型ENUM_ACCOUNT_TRADE_MODE, 0为模拟账户, 1为竞争账户, 2为真实账户
ACCOUNT_LEVERAGE当前杠杆倍数long
ACCOUNT_LIMIT_ORDERS最大持仓量int
ACCOUNT_MARGIN_SO_MODE保证金计算模式ENUM_ACCOUNT_STOPOUT_MODE, 0为百分比计算, 1为货币方式计算
ACCOUNT_TRADE_ALLOWED是否允许算法交易bool,允许为:true, 不允许为false
ACCOUNT_TRADE_EXPERT是否允许EA交易bool,允许为:true, 不允许为false
ACCOUNT_MARGIN_MODE账户交易计算模式ENUM_ACCOUNT_MARGIN_MODE
ACCOUNT_CURRENCY_DIGITS当前账户的小数点位数int,比如9999.99,就是两位数小数点
ACCOUNT_FIFO_CLOSE平仓排序规则bool,默认从最早订单开始往现在进行平仓
void OnStart()
  {
    // 帐号ID
    // long id = AccountInfoInteger(ACCOUNT_LOGIN);
    int id = (int)AccountInfoInteger(ACCOUNT_LOGIN);
    printf("账户的ID: %d", id);
    
    // ENUM_ACCOUNT_TRADE_MODE trade_mode =  AccountInfoInteger(ACCOUNT_TRADE_MODE);
    int trade_mode = (int)AccountInfoInteger(ACCOUNT_TRADE_MODE);
    printf("当前账户的类型: %d",trade_mode);
    string trade_mode_str = "";
    switch(trade_mode)
    {
      case 1:
        trade_mode_str = "竞争账户";break;
      case 2:
        trade_mode_str = "真实账户";break;
      default:
        trade_mode_str = "模拟账户";
     }
     printf("当前账户类型: %d %s",trade_mode, trade_mode_str);
     
     // 当前杠杆倍数
     int leverage = (int)AccountInfoInteger(ACCOUNT_LEVERAGE);
     printf("当前账户杠杆倍数: %d 倍",leverage);
     
     // 最大持仓的手数
     int limit_orders = (int)AccountInfoInteger(ACCOUNT_LIMIT_ORDERS);
     printf("最大持仓的手数: %d 手",limit_orders);
     
     // 保证金计算模式
     int so_mode = (int)AccountInfoInteger(ACCOUNT_MARGIN_SO_MODE);
     printf("保证金计算模式: %d ",so_mode);
     
     // 是否允许算法交易
     bool trade_allowed = AccountInfoInteger(ACCOUNT_TRADE_ALLOWED);
     printf("是否允许算法交易: %d ",trade_allowed);
     
     // 是否允许EA交易
     bool trade_expert = AccountInfoInteger(ACCOUNT_TRADE_EXPERT);
     printf("是否允许EA交易: %d ",trade_expert);
     
     // 账户交易计算模式
     int margin_mode = (int)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
     printf("账户交易计算模式: %d ",margin_mode);
     
     // 当前账户的小数点位数
     int digits = (int)AccountInfoInteger(ACCOUNT_CURRENCY_DIGITS);
     printf("当前账户的小数点位数: %d ",digits);
     // 操作平仓的排序规则
     bool fifo_close = (bool)AccountInfoInteger(ACCOUNT_FIFO_CLOSE);
     printf("操作平仓的排序规则: %d ",fifo_close);
     
  }
 收藏 (0) 打赏

您可以选择一种方式赞助本站

支付宝扫一扫赞助

微信钱包扫描赞助

未经允许不得转载:瓜皮猫量化编程 » 9.3 整数类型枚举值
分享到: 生成海报

评论 抢沙发

  • QQ号
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

瓜皮猫量化交易编程

QQ群: 492653640微信: guapitcom
切换注册

登录

忘记密码 ?

切换登录

注册

我们将发送一封验证邮件至你的邮箱, 请正确填写以完成账号注册和激活