Top CryptoCurrency with PowerShell
I have seen lot of people and fellow PowerShell bloggers and community contributors interest in CryptoCurrency with PowerShell console in recent months and I’m thinking add my 2 cents. So today in this blog post we going to discuss how to plot historical data (prices) of Top CryptoCurrency in the PowerShell console, where you can visualize the price trends of each cryptocurrency like BitCoin [BTC], Ethereum [ETH] etc with each other. But, let me tell you that: IT IS SUPER EASY! 🙂
Video Tutorial
Capturing the price trend of CryptoCurrency with PowerShell
First thing you need is the name and symbol of top crypto currencies in the world, so here is a list of some:
[table table=”{‹²›rows‹²›:‹º›{‹²›name‹²›:‹²›heading-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›},{‹²›name‹²›:‹²›default-row‹²›}‹¹›,‹²›cols‹²›:‹º›{‹²›name‹²›:‹²›default-col‹²›},{‹²›name‹²›:‹²›default-col‹²›}‹¹›,‹²›header_options‹²›:{‹²›table_purpose‹²›:‹²›tabular‹²›},‹²›content‹²›:‹º›‹º›{‹²›textarea‹²›:‹²›Name‹²›},{‹²›textarea‹²›:‹²›Symbol‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›LiteCoin‹²›},{‹²›textarea‹²›:‹²›LTC‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›Ethereum‹²›},{‹²›textarea‹²›:‹²›ETH‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›BitCoin‹²›},{‹²›textarea‹²›:‹²›BTC‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›ZCash‹²›},{‹²›textarea‹²›:‹²›ZEC‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›Dash‹²›},{‹²›textarea‹²›:‹²›DASH‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›Ripple‹²›},{‹²›textarea‹²›:‹²›XRP‹²›}‹¹›,‹º›{‹²›textarea‹²›:‹²›BitCoin Cash‹²›},{‹²›textarea‹²›:‹²›BCH‹²›}‹¹›‹¹›}” __fw_editor_shortcodes_id=”80ff588f38b999db9e125b0121af5f64″ _array_keys=”{‹²›table‹²›:‹²›table‹²›}” _fw_coder=”aggressive”][/table]Once we have the list of target currencies, then we have to figure out a way to retrieve historical data of each of these CryptoCurrencies. After little bit of googling I found a PowerShell module: Coin that can get the Price history of the CryptoCurrencies by leveraging the CryptoCompare API . This module is written by Matt McNabb and you can download this module from PowerShell Gallery using a PowerShell console with Administrative rights:
Install-Module Coin -Force
Now, if you use the the cmdlet: Get-CoinPriceHistory
from the module with a currency symbol like BTC, it returns the price trend in the given time frame. Then all you need to do is capture the value of the daily market closing price over a period of time, like in the following code sample:
Plotting CryptoCurrency with PowerShell
Next task is to store this daily closing price in an array variable and display it in a chart to actually visualize the price trend over a period of time. Good for you that I’ve written a Open-Source, Platform independent PowerShell module: Graphical , that has capability to consumes data points as input and plots them on a 2D graph [Scatter / Bar / Line] on the PowerShell Console/Terminal like in the below screen shot:
You can also install the module from PowerShell Gallery using the command: Install-Module Graphical
and then plot the data points we captured using the Show-Graph
cmdlet from the Graphical module
My New Book : PowerShell Scripting Guide to Python
This PowerShell Scripting guide to Python is designed to make readers familiar with syntax, semantics and core concepts of Python language, in an approach that readers can totally relate with the concepts of PowerShell already in their arsenal, to learn Python fast and effectively, such that it sticks with readers for longer time.
“Use what you know to learn what you don’t. ” also known as Associative learning.
Book follows a comparative method to jump start readers journey in Python, but who is the target audience? and who should read this book –
- Any System Administrator who want to step into Development or Programming roles, and even if you don’t want to be a developer, knowledge of another scripting language will make your skill set more robust.
- Python Developers who want to learn PowerShell scripting and understand its ease of user and importance to manage any platform.
Python is one of the top programming languages and in fast changing IT scenarios to DevOps and Cloudto the future – Data Science, Artificial Intelligence (AI) and Machine Learning Python is a must know.
But this PowerShell Scripting guide to Python would be very helpful for you if you already have some knowledge of PowerShell
NOTE! This is a Leanpub “Agile-published” book. That means the book is currently unfinished and in-progress. As I continue to complete the chapters, we will re-publish the book with the new and updated content. Readers will receive an email once a new version is published!
While the book is in progress, please review it and send any feedback or error corrections at prateek@ridicurious.com
Prateek Singh
Related posts
3 Comments
Leave a ReplyCancel reply
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,132,483 People Reached
WOW!
I don’t fully understand how “Show-Graph” can do this in automatic but I’m impressed. Do you think this can be used to retrieve SQL Server statistics?
Thank you
Yes this can be used to plot any statistics/datapoint on a 2D graph.
[…] Here is full write-up on this topic which you can read and get the code samples from: https://ridicurious.com/2018/12/03/visualizing-historical-data-of-top-cryptocurrency-with-powershell… […]