gpt4 book ai didi

Getting error in mql5 code while converting to from pinescript 5(从Pinescrip 5转换为时在MQL5代码中出错)

翻译 作者:bug小助手 更新时间:2023-10-26 22:30:13 27 4
gpt4 key购买 nike



This is pine script 5 function,

这是PINE脚本5函数,


rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r :
x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
rngfilt
filt = rngfilt(source, smrng)

when i tried to convert this code to mql5, i am not able to understand what i am doing wrong.
here is what i did

当我试图将此代码转换为MQL5时,我不能理解我做错了什么。这就是我所做的


double RangeFilter(double x, double r)
{
static double rngfilt = 0.0;
//rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r : x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r

if (x > iClose(_Symbol,PERIOD_CURRENT,x))
{
/* if (x - r < xiClose(_Symbol,PERIOD_CURRENT,x) - rngfilt)
rngfilt = xiClose(_Symbol,PERIOD_CURRENT,x) - rngfilt;
else
rngfilt = x - r; */
}
else
{
if (x + r > xiClose(_Symbol,PERIOD_CURRENT,x) + rngfilt)
rngfilt = xiClose(_Symbol,PERIOD_CURRENT,x) + rngfilt;
else
rngfilt = x + r;
}

return rngfilt;
}

please help me with this

请帮帮我


i want to my code to be corrected please

我想要更正我的代码


更多回答
优秀答案推荐
更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com