Variable Length sub-function; Bars While True

Posted By: OptimusPrime

Variable Length sub-function; Bars While True - 11/04/18 11:45

Kind Sirs:

Do we have a variable length indicator or sub-function in Zorro? I am trying to write an external indicator (A Variable Length Stochastic ) in Zorro but it requires a variable lag. {solved)

BarsWhileTrue and BarsWhileFalse indicators would also be great. (solved)

Posted By: Spirit

Re: Variable Lag sub-function; Bars While True - 11/04/18 13:41

What is barswhiletrue?
Posted By: OptimusPrime

Re: Variable Lag sub-function; Bars While True - 11/04/18 14:34

BarsWhileTrue returns the number of bars that a given condition is true.

I can use the Zorro functions NumDn and NumUp as templates to create my own BarsWhileTrue test.

// return the number of falling bars
int NumDn(var* Data,int Period,var vThreshold)

// return the number of rising bars
int NumUp(var* Data,int Period,var vThreshold)

Zorro's Lowest Low (LL) and HighestHigh (HH) functions accept Period and Offset as parameters. These should provide the variable periodicity my Stochastic formula needs.
© 2024 lite-C Forums