错误、漏洞、问题 - 页 2310

 
ExpertRemove在优化模式下不能正常工作。
input int Range = 0; // 1 .. 10

bool FuncInit()
{
  ExpertRemove();
  
  return(true);
}

int Count = 0;

void OnTick()
{
  static const bool Init = FuncInit();
  
  Count++;
}

double OnTester()
{
  return(Count);
}


运行优化。你可以从代码中看到,所有的传递都应该由ExpertRemove来终止。但这并没有发生。

Core 5  pass 8 tested with error "expert removed itself in global initialization function" in 0:00:00.312
Core 5  pass 9 returned result 331851.00 in 0:00:00.125
Core 4  pass 6 tested with error "expert removed itself in global initialization function" in 0:00:00.265
Core 4  pass 7 returned result 331851.00 in 0:00:00.140
Core 1  pass 0 tested with error "expert removed itself in global initialization function" in 0:00:00.312
Core 1  pass 1 returned result 331851.00 in 0:00:00.125
Core 3  pass 4 tested with error "expert removed itself in global initialization function" in 0:00:00.296
Core 3  pass 5 returned result 331851.00 in 0:00:00.156
Core 8  pass 2 tested with error "expert removed itself in global initialization function" in 0:00:00.265
Core 8  pass 3 returned result 331851.00 in 0:00:00.140
Tester  optimization finished, total passes 10
Statistics      optimization done in 0 minutes 01 seconds
Statistics      shortest pass 0:00:00.125, longest pass 0:00:00.156, average pass 0:00:00.137
Statistics      local 10 tasks (100%), remote 0 tasks (0%), cloud 0 tasks (0%)

有一半的通行证都忽略了ExpertRemove。它是可重复的吗?


ZY这导致单次通过和优化之间的差异。

 
fxsaber:
typedef void (*FUNC)();
void f1() {};

void f2()
{
   f1();
}

void f2( FUNC g) 
{
   g();
}

这本质上与带有默认参数的单个函数相同。这通常是处理方式,所以这不是一个变通办法或拐杖,而是一个完全正常的解决方案。

 
TheXpert:

事实上,这和一个带有默认参数的函数是一样的。 这通常是解决方法,所以这不是一个变通或拐杖,而是一个完全正常的解决方案。

选择超载是可以理解的。但为每个功能创建这样的东西,一点也不灵活。你就不能在C++中也把它变得漂亮吗?

 
fxsaber:

选择超载是可以理解的。但为每个功能创建这样的东西,一点也不灵活。我们不能在C++中也把它变得很好吗?

我不知道,C++在常量方面更灵活,但我没有用函数指针作为默认参数工作过。

UPD g++会吃掉你的代码
 
TheXpert:

hz,C++在常量方面比较灵活,但我没有专门用函数指针作为默认参数工作过。

UPD G++飞快地吃下你的代码

谢谢你提供的信息!

 
fxsaber:

如何实现一个函数的输入参数的默认值?

你可以使用python风格的代码

typedef void (*FUNC)();

void f0() {Print(__FUNCSIG__);};
void f1() {Print(__FUNCSIG__);};

void f2( FUNC g = NULL ) {
   if (g == NULL){g = f1;}
   
   g();
}


void OnStart()
{
   f2();
   f2(f0);
}
 
Sergey Dzyublik:

你可以使用python风格的代码

谢谢,我不知道NULL的事。

 

在测试者报告中,当用CloseBy计算两个塌陷位置的数学期望值时,它被除以2,而不是1。因此,我们在报告中得到了错误的数值。


而报告中提到的CloseBy公司的这种意外事件


 

Привет

我租了这个[产品名称 市场已被版主删除]的一个我,我一直无法改变设置,位置三号 3最大

如何在同一时间改变多个买入和卖出头寸的数量

菲利普

 
foonet:

在论坛上禁止讨论市场产品,对不起。
在论坛上禁止讨论市场 产品,对不起。