TheOtherDavid / CoinCheck

A simple app that checks a crypto coin price and sends an SMS alert if there has been a big move recently.
1 stars 0 forks source link

Implement Price Move Alert logic #7

Closed TheOtherDavid closed 3 years ago

TheOtherDavid commented 3 years ago

Currently, the program just gets the price and sends it as a message. But realistically, this isn't very useful. What I really want is to have it compare the price to the last few prices and only send an alert if there was a price rise/fall of at least 10% (configurable) over the last 6 hours (configurable).

TheOtherDavid commented 3 years ago

10 Including the price move information in the text message. This isn't REALLY what I need, but it's a start.

I guess what I really need is a for loop to loop through the past six hours of prices, comparing them to the current price, calculating the percentage difference. Whenever the difference exceeds... let's go with 5% to start, but make it configurable, have it send a text message with that time. "BTC has gone up 5% since 11:00:00!"

TheOtherDavid commented 3 years ago

Pushed code to only send an SMS for a price move of X percent over the past Y hours.