![]() ![]() # insert your public and secret keys here ![]() Now that we’ve walked through each element of the script step-by-step, it’s time to put everything together. This will look something like the following chart. fig = go.Figure(data=[go.Candlestick(x=dates,Ĭalling fig.show() displays the graph. Use the Plotly library to create the chart that we will display, then display the chart. Generate Figureįinally, it’s time to generate the figure. The result of this step is each individual candlestick will be broken out into a list which holds the individual component of every candlestick. To do this, we will go through the candlesticks we collected from Shrimpy and assign each of the candlestick components to an element of the candle. Once the data has been collected from Shrimpy, we want to convert the data to the format which is accepted by the plotting library Plotly. The supported time intervals for each candle include the following: Observe how we are able to change each of these parameters to configure the data we want to access. Just make sure to pass in the exchange, trading pair, and interval you wish to access. Use the client to call the endpoint for retrieving the candlesticks. It’s time to get our candlestick data from Shrimpy. client = shrimpy.ShrimpyApiClient(public_key, secret_key) Get Candles The client will then conveniently handle the signing of each request, so you can focus on accessing the data and building tools with the data. To create the client, pass in the public and secret keys which were assigned in the previous step. public_key = '8x71n32d8cfbnnn1xzimjustkeyboardmashing8xn1t8jyv5098' For now, let’s just assign them for later use. This requires us to pass in our public and private keys. Import aph_objects as go Assign Keysīefore we can access any data from Shrimpy, we need to make sure we correctly sign our requests. Import these libraries into your script so we can collect our data and graph it. This will provide a convenient way for us to get up and running without much effort. In this script, we will be using the Plotly Library. The script for this article will collect candlestick market data from the exchange we specify, organize it in a way that’s understandable for the plotting library, and display it. We’re now ready to begin writing our first script. Make sure to securely store your public and secret keys. These keys are used to sign requests to Shrimpy and access crypto market data. It’s free and takes only a few seconds to sign up.Īfter signing up, generate your master key. These are the APIs which provide the exchange data. Pip install plotly=4.1.0 Generate API KeysĪfter installing the necessary libraries, sign up for a Shrimpy Developer API account. If you use pip, this can be done simply by running the following commands. There is no complex configuration or development.īefore we get started writing the script, we need to install a few libraries. This article will describe how to set up your first script to access live market data from any exchange, normalize it into a cohesive format, and plot it. An API which you can freely use to access historical and live data. Thankfully, the Universal Crypto Exchange APIs normalize this data for us. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |