Function that returns the number of consecutive wins

 
Hi guys!

I’m looking for a function that returns the number of consecutive profitable trades until X victories. When the number of profitable trades hits the X value, so the count is restarted.

If someone can help me... thx!!!
 
JHenry:
Hi guys!

I’m looking for a function that returns the number of consecutive profitable trades until X victories. When the number of profitable trades hits the X value, so the count is restarted.

If someone can help me... thx!!!
Simply calculate the modulo (this is modulo : https://en.wikipedia.org/wiki/Modulo_operation) of all your consecutive wins
Reason: