To enhance and simplify your code, you can eliminate redundancy and improve readability. Hereâs a more concise version:
funding_rate_float = round(float(funding_rate), 3)
self.funding_rate_signal = 'SELL' if funding_rate_float > 0 else 'BUY'
This version achieves the same functionality:
- Rounds
funding_rate_float
to three decimal points. - Sets
self.funding_rate_signal
to'SELL'
iffunding_rate_float
is positive, and'BUY'
if it’s negative or zero.
If you want to treat zero as neutral (i.e., no signal), you could add a condition for zero:
funding_rate_float = round(float(funding_rate), 3)
self.funding_rate_signal = 'SELL' if funding_rate_float > 0 else 'BUY' if funding_rate_float < 0 else 'NEUTRAL'
Futures and Options Trading Strategies
XXXXXXXXXXXXXXXXXXX
Crypto Payment
Strike or Paypal Payment
XXXXXXXXXXXXXXXXXXX
Trading is the best business
XXXXXXXXXXXXXXXXXXX
JumpStart Options & Crypto Games with DGM at $1971 USD one time payment solution. DGM Winning Trades.
Alternatively, you can join DGM business affiliate program to earn 50% commission when you sign up a paid customer.
DGM Affiliate Program
Here is an example of what an affiliate URL will look like after you have signed up for your affiliate link:
https://XXXXXX–daily.thrivecart.com/dgm-trading-futures-options-affiliates/
Replace the X’s with your affiliate ID to make a functional link for your trading business. You will get 50% commission from your referrals after 7 days in which they have made their payment through your affiliate link.
XXXXXXXXXXXXXXXXXXX