Count function
2 replies
SimonO
2 years ago #274087
Hello,
I would like to request, if possible, a count function, that could count for how many bars a certain condition is true, so that we can store that info into a variable. For instance, how many bars a condition C1>C2 is true over last n-bars(period).
I am using algowizard inside of strategyquantX if that is of relevance.
SqX is a wonderful tool, well worth the money and I think, that such a count function would enable even more possibilities.
Thank you.
tomas262
2 years ago #274121
Hello,
you can simply setup a counter that will be increased by +1 with each time the condition is valid.
You also setup another condition that negates this and reset counter to 0.
You can then setup a condition like : if ‘counter’ > 20 then: buy / sell for example
SimonO
2 years ago #274147
Thank you, but I tried that already when I read about similiar problems on this forum. My problem is however not solvable like that. I honestly believe that a simple implementation of a count function such as in easylanguage, would greatly improve strategy building for price action strategies.
Viewing 2 replies - 1 through 2 (of 2 total)