编码帮助 - 页 299

 
mladen:
AZRUL

将此:

static datetime lastUpdated = 0; if ((TimeCurrent()-lastUpdated) < PERIOD_M5*60) return(0); lastUpdated=TimeCurrent() 。

作为启动程序的第一行,启动程序的其余代码将被执行,两个连续的执行之间至少有5分钟的延迟。

亲爱的MLADEN先生。

我将尝试把这些代码放在ONLY....。

非常感谢您的时间和专业知识,.... 第5个学分

你真正的

AZRUL...

 

如果我在编译这段代码时使用 "strict",我会得到"数组超出范围"。

if (RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

if (RSI4 RSI1) drawArrow(i,Tomato,234,true);

[/PHP]

This works with no errors but of course there are arrows on every candle

if (RSI4 > RSI1 ) drawArrow(i,Aqua,233,false);

if (RSI4 < RSI1 ) drawArrow(i,Tomato,234,true);

This appears to be the problem as soon as the +1 is added.

[PHP]RSI4 > RSI1

有什么办法可以解决这个问题吗?

 
cja:
如果我在编译这段代码时使用 "strict",我会得到 "数组超出范围"。

if (RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

if (RSI4 RSI1) drawArrow(i,Tomato,234,true);

[/PHP]

This works with no errors but of course there are arrows on every candle

if (RSI4 > RSI1 ) drawArrow(i,Aqua,233,false);

if (RSI4 < RSI1 ) drawArrow(i,Tomato,234,true);

[/PHP]

This appears to be the problem as soon as the +1 is added.

[PHP]RSI4 > RSI1
Is there a fix for this?

cja

试着像这样。

[PHP]if(i<(Bars-1))

{

如果(RSI4 > RSI1 && RSI4 < RSI1) drawArrow(i,Aqua,233,false);

如果(RSI4 RSI1) drawArrow(i,Tomato,234,true);

}

它应该可以工作

 

你好,我有一个指标斐波那契的问题,我想把它用在同一个图上,到1440和2280,就像这个图片一样。

(这就是我手动创建的原因)

问题是,我创建了第二个版本的指标到2天,但当我把它插入同一个图形上,我有1440版本的指标自动不再看到1440的线。我希望能在您的帮助下解决这个问题。

附加的文件:
 
dany84:
你好,我有一个指标fibonacci的问题,我想把它用在同一个图形上,到1440和2280,如图所示。

(这就是为什么我手动创建)

问题是,我创建了第二个版本的指标到2天,但当我把它插入我有指标的1440版本的同一图形上时,自动不再看到1440的线条。我希望能在您的帮助下解决这个问题。

dany84

现在就试试吧:fibo_v9_1.mq4

将UniqueID参数设置为该指标每个新实例的唯一值,然后你就可以拥有你想要的众多实例了。

附加的文件:
fibo_v9_1.mq4  6 kb
 
mladen:
dany84

现在试试吧:fibo_v9_1.mq4

为指标的每个新实例设置UniqueID参数为唯一值,然后你就可以有任意多的实例了。

谢谢你,Mladen!!现在工作正常了

 

奇怪的错误!!!

I have the following string: " 99.40 "

double TakeProfit = StrToDouble("99.40");

Print("TakeProfit =", TakeProfit);

Print("or TakeProfit = ", NormalizeDouble(TakeProfit,2);

这就是输出。

TakeProfit =99.40000000000001

或TakeProfit =99.40000000000001

谁能给我解释一下这个奇怪的错误,我应该怎么做?

谢谢你!

 
sunshineh:
奇怪的错误!!!

I have the following string: " 99.40 "

double TakeProfit = StrToDouble("99.40");

Print("TakeProfit =", TakeProfit);

Print("or TakeProfit = ", NormalizeDouble(TakeProfit,2);

而这是输出。

TakeProfit =99.40000000000001

或者TakeProfit = 99.40000000000001

谁能给我解释一下这个奇怪的错误,我应该怎么做?

谢谢你!

sunshineh

你是如何通过打印得到 "00000000001 "部分的?

我在使用该代码时得到了这个结果。

附加的文件:
pribt.gif  21 kb
 

你好。

这是两个不同的metatrader账户的打印信息。

附加的文件:
 
sunshineh:
你好。

这是两个不同的metatrader账户的打印信息。

可能是构建

我使用build 660来测试这个问题