如何让这个盈亏平衡公式发挥作用?

How to get this breakeven formula working?

我在盈亏平衡交易回测中使用了这个公式。

activation_floor_array = 1.02*EMA(Close, 50);
ApplyStop( stopTypeLoss, stopModePercent, 0, True, False, 0, 0, -1, ActivationFloor=activation_floor_array );

当我 运行 它时,我收到一条错误消息,提示 Activation Floor 参数需要一个数字,而不是一个数组。我试过 SelectedValue(activation_floor_array) 但发现 returns 号码不对。正确的数字是 activation_floor_array 中与交易输入栏重合的数字。 SelectedValue() returns 范围的最后一根柱线。

有人可以提供帮助或提供一些关于如何前进的提示吗?

谢谢。

您收到的错误消息非常self-explanatory。如果您查看 ApplyStop 的定义,您会看到参数 ActivationFloor 需要是一个数字(数量或百分比),它决定何时激活止损。

现在,您分享的这段代码可能被断章取义了。查看更多信息以确定如何进一步帮助您会很有帮助。