Created
January 6, 2020 22:46
-
-
Save BetterProgramming/db4cbc673d919e84cb02250b4e15eaea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (let i = 0; i < numOfDays; i += freqInDays) { | |
const coinPrice = priceArr[i].price; | |
coinAmount += amountToInvest / coinPrice; | |
totalInvested += amountToInvest; | |
const total = coinAmount * coinPrice; | |
dataArr.push({ | |
TotalInvested: totalInvested, | |
CoinAmount: coinAmount, | |
CoinPrice: coinPrice, | |
Total: total, | |
date: priceArr[i].date, | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment