Funding Rate Coding

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' if funding_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'
DGM Payment - AltCoin_SMC_60

LET’S KEEP IN TOUCH!

We’d love to keep you updated with our latest news and offers 😎

We don’t spam! Read our privacy policy for more info.

LUV IT -

Written by 

🎮 Daily Game Moments âŦ‡ī¸ 🔒 | Register as An Author đŸŽŦ Account To Publish Your Trading Journal Daily. âŦ‡ī¸âŦ‡ī¸ Why you want to do that? Keep it simple so that we can learn more efficiently and effectively by posting out our weaknesses and failures should be celebrated. Every failure is one step toward your success and DGM can set your course for success. âŦ‡ī¸âŦ‡ī¸âŦ‡ī¸ ACTION MORE 🕹ī¸ A Day Without Gaming 🤠, Staking 😇 or Trading 🤓 Is A Day Wasted đŸ†đŸŽ¯ @DailyGameMoments has Infinite Possibility

Leave a Reply