计算条件事件发生的次数
count how many times a conditional event occurs
我正在计算条件事件发生了多少次。
但是当我测试它时,它给了我不切实际的数字。
我认为我的编码不正确有人想帮助我吗??
for(i=0;i<Bars; i++)
{
//Condition I want met
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5]);
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;
Comment(x);
}
; if 语句的有效终止条件语句(因此 x=x+1 将不会根据条件正确执行)。
因此,请更改
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5]);
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;
至
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5])
{
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;}
我正在计算条件事件发生了多少次。 但是当我测试它时,它给了我不切实际的数字。 我认为我的编码不正确有人想帮助我吗??
for(i=0;i<Bars; i++)
{
//Condition I want met
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5]);
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;
Comment(x);
}
; if 语句的有效终止条件语句(因此 x=x+1 将不会根据条件正确执行)。
因此,请更改
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5]);
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;
至
if(Close[i+1]<Close[i+2]<Close[i+3]<Close[i+4]<Close[i+5])
{
//Add 1 each time condition is met for sum total when the for loop ends
x=x+1;}