Skip to content

Commit

Permalink
2.2.1 - Update ATH every time it's lower than 24h high.
Browse files Browse the repository at this point in the history
  • Loading branch information
transilvlad committed May 8, 2021
1 parent 6989a6f commit 62f52db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ _Please do keep in mind at this point there are a lot of differences between thi
- Fixed ATH not updating when using CryptoCompare API.
- Made flux fall-back to CryptoCompare API if CoinGecko API request failed.

- Version 2.2.1
- Update ATH every time it's lower than 24h high.


## Planned updates
- Automatically add coin when adding trade.
Expand Down
12 changes: 6 additions & 6 deletions source/CoinsUpdate.gs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ function updateCoins() {
}
if(market[ticker].hasOwnProperty("ath")) {
sheet.getRange("K" + r).setValue(market[ticker]["ath"]);
} else { // Update ATH if CryptoCompare API high_24h is greater than current ATH since it lacks ATH.
var high = sheet.getRange("J" + r).getValue();
var ath = sheet.getRange("K" + r).getValue();
if (high > ath) {
sheet.getRange("K" + r).setValue(high);
}
}
// Update ATH if CryptoCompare API high_24h is greater than current ATH since it lacks ATH.
var high = sheet.getRange("J" + r).getValue();
var ath = sheet.getRange("K" + r).getValue();
if (high > ath) {
sheet.getRange("K" + r).setValue(high);
}
if(market[ticker].hasOwnProperty("price_change_24h")) {
sheet.getRange("M" + r).setValue(market[ticker]["price_change_24h"]);
Expand Down

0 comments on commit 62f52db

Please sign in to comment.