round c++

Posted By: leohermoso

round c++ - 04/02/20 00:45

Hello friends!

When trying to use the bar function for Renko Zorro provide this function

Code
int Renko1(vars Open,vars High,vars Low,vars Close)
{
  Open[0] = round(Close[1],BarRange);
  if(Close[0]-Open[0] >= BarRange) {
    Close[0] = Open[0]+BarRange;
    High[0] = Close[0];
    Low[0] = Open[0];
    return 1;
  }
  if(Open[0]-Close[0] >= BarRange) {
    Close[0] = Open[0]-BarRange;
    High[0] = Open[0];
    Low[0] = Close[0];
    return 1;
  }
  return 4;
}


however, there is no round function in c++ that takes two arguments, how to circumvent that??

Best regards

Leo Hermoso
Posted By: jcl

Re: round c++ - 04/02/20 08:00

In C++, use roundto(). That's a Zorro function.
Posted By: leohermoso

Re: round c++ - 04/02/20 11:56

Thank you, again!

Have a nice day
© 2024 lite-C Forums