Hi, I'm creating an algorithm where I try to scalp on certain signalbars. However, I would really like to clean op the code, so that I can check if the current bar is bearish or bullish.

The difficult way would be like so:

if currentBar.Close - currentBar.Open < 0:  #This means the bar i bearish.
# And if it has to be Bullish:
if curenBar.Close - CurrentBar.Open > 0: # Bar is bullish.

What I really want to do instead, is writing it so that I in an ‘if-statement’ can do like so:

if currentBar.isBear:

How do I go about making an Attribute to a TradeBar or QuoteBar. Or whatever what I am trying to do is called.

Hope someone can help me clean up my code.

Thanks in Advance:))