How do I check the Number of Bars SInce Last Trade Exit and New Trade?

@vishaldalvi Your code is flawed and your "Short" condition is wrongly coded.

But more importantly please follow the rules of this forum and properly format code. It is so easy to type three little "backtick" lines, ``` and then put in your code, and then type in three more backticks.

And read this entire thread,

What/where are those backtick's?
image

The are the lower case of the key that has the "tilde" as the uppercase. Yes I know these are words most people do not use in their everyday conversation.

Others have written this description,

(`/~) The tilde key, since the name for the unshifted "grave accent" or "backtick" character is not widely known. (This may also go by the "squiggle key" or "the key next to the 1 with the squiggle on it" for people who don't know the name for "tilde" either; neither are commonly used outside of programming