Bitcoin Price API: Bitcoin Ticker & Exchange Rate API ...

vectorbt - blazingly fast backtesting and interactive data analysis for quants

I want to share with you a tool that I was continuously developing during the last couple of months.
https://github.com/polakowo/vectorbt

As a data scientist, when I first started flirting with quant trading, I quickly realized that there is a shortage of Python packages that can actually enable me to iterate over a long list of possible strategies and hyper-parameters quickly. Most open-source backtesting libraries are very evolved in terms of functionality, but simply lack speed. Questions like "Which strategy is better: X or Y?" require fast computation and transformation of data. This not only prolongs your lifecycle of designing strategies, but is dangerous after all: limited number of tests is similar to a tunnel vision - it prevents you from seeing the bigger picture and makes you dive into the market blindly.
After trying tweaking pandas, multiprocessing, and even evaluating my strategies on a cluster with Spark, I finally found myself using Numba - a Python library that can compile slow Python code to be run at native machine code speed. And since there were no packages in the Python ecosystem that could even closely match the speed of my own backtests, I made vectorbt.
vectorbt combines pandas, NumPy and Numba sauce to obtain orders-of-magnitude speedup over other libraries. It builds upon the idea that each instance of a trading strategy can be represented in a vectorized form, so multiple strategy instances can be packed into a single multi-dimensional array. In this form, they can processed in a highly efficient manner and compared easily. It also integrates Plotly and ipywidgets to display complex charts and dashboards akin to Tableau right in the Jupyter notebook. You can find basic examples and explanations in the documentation.

Below is an example of doing in total 67,032 tests on three different timeframes of Bitcoin price history to explore how performance of a MACD strategy depends upon various combinations of fast, slow and signal windows:
import vectorbt as vbt import numpy as np import yfinance as yf from itertools import combinations, product # Fetch daily price of Bitcoin price = yf.Ticker("BTC-USD").history(period="max")['Close'] price = price.vbt.split_into_ranges(n=3) # Define hyper-parameter space # 49 fast x 49 slow x 19 signal fast_windows, slow_windows, signal_windows = vbt.indicators.create_param_combs( (product, (combinations, np.arange(2, 51, 1), 2), np.arange(2, 21, 1))) # Run MACD indicator macd_ind = vbt.MACD.from_params( price, fast_window=fast_windows, slow_window=slow_windows, signal_window=signal_windows, hide_params=['macd_ewm', 'signal_ewm'] ) # Long when MACD is above zero AND signal entries = macd_ind.macd_above(0) & macd_ind.macd_above(macd_ind.signal) # Short when MACD is below zero OR signal exits = macd_ind.macd_below(0) | macd_ind.macd_below(macd_ind.signal) # Build portfolio portfolio = vbt.Portfolio.from_signals( price.vbt.tile(len(fast_windows)), entries, exits, fees=0.001, freq='1D') # Draw all window combinations as a 3D volume fig = portfolio.total_return.vbt.volume( x_level='macd_fast_window', y_level='macd_slow_window', z_level='macd_signal_window', slider_level='range_start', template='plotly_dark', trace_kwargs=dict( colorscale='Viridis', colorbar=dict( title='Total return', tickformat='%' ) ) ) fig.show() 

https://reddit.com/link/hxl6bn/video/180sxqa8mzc51/player
From signal generation to data visualization, the example above needs roughly a minute to run.

vectorbt let's you
The current implementation has limitations though:

If it sounds cool enough, try it out! I would love if you'd give me some feedback and contribute to it at some point, as the codebase has grown very fast. Cheers.
submitted by plkwo to algotrading [link] [comments]

Should I use state or local storage for these variables in stock ticker component?

I am a somewhat familiar beginner with React and I am therefore confused on what exactly state is and if it is the right solution to my issue. I have a Bitcoin ticker app and I want it to display the current ticker, price, and percent change in the title of my chart. First I save the ticker in my local storage in the searchBar component:
const SearchBar = () =>{ const [name, setName] = useState(""); return( 
{setName(e.target.value); localStorage.setItem("ticker",e.target.value);}}className="materialize-textarea"/>
) }
As you can see I set it up to use state but I thought it might be easier to use local storage to keep the variable. Therefore right now it does both. Then in my chart component I store the price and percent change in local storage after a fetch request:
const getChartData = () => fetch("https://api.nomics.com/v1/currencies/sparkline?key=d8f9e3b4142198f5d8902c3bb6c&ids="+localStorage.getItem("ticker")+"&start="+convertDateFormat(lastWeek)+"T00%3A00%3A00Z&end="+convertDateFormat(today)+"T01%3A00%3A00Z", {}).then((res) => res.json()) .then((result) => { localStorage.setItem("price",result[0].prices[result[0].prices.length-1]); localStorage.setItem("percentChange", (result[0].prices[result[0].prices.length-1]-result[0].prices[0])/result[0].prices[0]) } 
Then I just pull from local storage in my main App component and put the variables above the chart:
{localStorage.getItem("ticker")}
${localStorage.getItem("price")}
{localStorage.getItem("percentChange")*100}%
With this method I have to press enter on my search bar twice before the price and percent change will update and I am not sure why. Would state be better for this and if not how do I fix this issue with local storage?
submitted by TheSlothJesus to reactjs [link] [comments]

Bitcoin price quote for Linux shell

I love to work with the Linux shell (bash; Linuxmint/Ubuntu) all day, and from time to time I want to know the current price of Bitcoin and Ether. So I created a simple Linux shellscript, which displays both cross-prices to USD and EUR within the shell after typing in "btc". I know that I could use the web for this task, but I like it this way and I also don't want to be constantly informed (i.e. with an app on the smartphone).
Here it is, let me know if you like it.
#!/bin/bash # this simple Linux shell script uses the "jq" command line # JSON data processor pls. install "jq" first (sudo apt # install jq) then save the skript with an editor as i.e. # "btc" under a path for executables, (i.e. ~/.local/bin/) # and make it executable ("sudo chmod +x btc"). The script # uses market data from the kraken api; pls. feel free to # use any other api. The script displays the current price # of Bitcoin and Ether in USD and EUR. If you don't like # the colors, try playing around with the "tput setaf x" # (color of characters) and "tput setab x" (background # color); you might find the information frome here: # https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux # useful. Enjoy! JSN1=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=XBTUSD") JSN2=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=XBTEUR") JSN3=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=ETHUSD") JSN4=$(curl -s "https://api.kraken.com/0/public/Ticker?pair=ETHEUR") QRAW1=$(echo $JSN1 | jq ".result.XXBTZUSD.c[0]") QRAW2=$(echo $JSN2 | jq ".result.XXBTZEUR.c[0]") QRAW3=$(echo $JSN3 | jq ".result.XETHZUSD.c[0]") QRAW4=$(echo $JSN4 | jq ".result.XETHZEUR.c[0]") RGX='\"\([0-9]\+\)\.[0-9]\+\"' Q1=$(echo $QRAW1 | sed "s/${RGX}$/\1/g") Q2=$(echo $QRAW2 | sed "s/${RGX}$/\1/g") Q3=$(echo $QRAW3 | sed "s/${RGX}$/\1/g") Q4=$(echo $QRAW4 | sed "s/${RGX}$/\1/g") RED=`tput setaf 1` GREEN=`tput setaf 2` WHITEBACK=`tput setab 7` CYANBACK=`tput setab 6` BOLD=`tput bold` RESET=`tput sgr0` echo "${WHITEBACK}${BOLD}${RED}Bitcoin: $""$Q1"" €""$Q2${RESET}"" ${BOLD}${CYANBACK}${GREEN}Ether: $""$Q3"" €""$Q4${RESET}" 
submitted by fatrattombala to Bitcoin [link] [comments]

BTC Conky script

I'm not sure if many of you use conky but for the few that do I hope you'll enjoy this little script to monitor BTC prices.
Here's how it looks. Apologies for the shitty image, its set up on a raspberry pi atm
#!/usbin/python3 import requests mycoin = #Enter how much BTC you own here, eg 'mycoin = 0.267567823' investment = #Enter how much you spent total eg 'investment = 632' url = "https://www.bitstamp.net/api/v2/tickebtcgbp/" #Replace "btcgbp" with your local fiat, supported values found here: https://www.bitstamp.net/api/ data = requests.get(url).json() print('%s%s' % ("BTC:".ljust(15),data[u'last'].rjust(0))) last = float(data['last']) mycoinfiat = mycoin * last net = mycoinfiat - investment totalfiat = format(mycoinfiat, '.2f') totalnet = format(net, '.2f') print("My Coin: " + totalfiat) print("Loss/Gain: " + totalnet) 
and add this to your conky config
# BTC ${color CC9900}BITCOIN TRACKER (GBP)${hr 2}$color ${exec python /home/pi/Documents/conky/btc.py} 
submitted by ItGonBeK to Bitcoin [link] [comments]

The Great Web of Slime

There is a web of invisible slime that reaches out from the artificial traditions of psychological think tanks, like The Tavistock Institute of Human Relations, whose roots trace back to the Vienna Psychology Club; a web that stretches across the entire world and inserts itself into your lives in intrusive, unethical and corrupt ways. Groups are deceiving you for a dollar, for a vote, for your personal information, for your labor; for your body and soul. This deception is carried out using every screen you look at, every song offered to you, every sign on a billboard, every popular book, magazine and newspaper.
If you want honest information; if you want to see past the slime, you are going to have to look hard for it. If you are just starting down your journey of being cognizant of the deception, the scope is difficult to believe but well borne out by the evidence. We all know the news is dishonest, but the common myth is that it is for the ratings and for the views. The ways in which the news is dishonest is what is really difficult for people to swallow and the “why” still very much in debate until you understand the framework by which they operate.
Systemic corruption is no exception to the march of modernization; more sophisticated than ever and more capable of staying hidden to the average person. Modern day slavers control the narrative and the reason it is a spiritual conflict between good and evil is because there are a very small group of people who believe that stealing your agency/free will/consciousness lends itself to their ability to become gods, in their own right.
Understanding that the elite have deep occult traditions is important, though often scoffed at. However, to advertise their power and influence, occult messages are constantly and publicly advertised back and forth between these groups. It is no theory that think tanks have studied and implemented cult behavior even going so far as to create artificial cults in which to entrap people.
Faceless, emotionless, unempathetic organizations that are merely constructed of words on paper are able to impose these cult tactics on you with impunity and in secrecy. This is the heart of the problem; when it comes to an organization, company, agency, church, etc., these abstract constructs are very much not human, at all. Their existence is alien and unknown to human instincts, who assign human attributes naturally and without conscious thought. These constructs take advantage of normal, honest, empathetic individuals by mimicking empathy, not by actually being empathetic.
There are more slaves, now, than ever in human history and the methods of enslaving are far more insidious than ever. Modern slavery networks and the corrupt political ecosystems that allow them to endure are the heart of mankind’s problems. If we, as a society, were able to address the corruption that keeps these networks alive, then we, as society, would solve a lot of problems surrounding organized crime, in general, not just the problem human trafficking.
How do we do that? It is very simple; “Zero Trust” policies in organizations and 100% government transparency. That’s it. A great deal of time, effort and money are spent making sure these issues never hit the ballot box and are never part of the platform of a candidate you are given the option to vote for. The movies you watch are constantly reminding you of dangers that allow a select group of idiots to maintain secrecy that is undeserved and clearly wielded for uses other than helping society.
Common sense solutions are not prioritized by the media and politicians. Don’t be a part of the destruction of common sense and common courtesy. Stop taking the bait. Stop taking the path of least resistance. We are all guilty, but pushing yourself to be better and do better has a ripple effect in the world around you. Being a terrible person also has a ripple effect. There are enough bad ripples.
The concept of an “epiphany” is an important one; where a person’s mind changes on a physical, neurochemical level to the extent that their world view changes. The moment a person is “red pilled” is an epiphany and it is very much the concern of media and Internet shills and their manipulative overlords because they do not want people to have the realization that the system is corrupt from top to bottom and that both sides of most narratives. But, if you do have that realization, there is a plan for you; to do nothing and sit idly by as corrupt forces continue their work. When you have an epiphany, the neurochemical storm actually is a moment where you are most suggestible and most ready to be manipulated.
If you manage to raise your level of awareness across multiple narratives, the system almost doesn’t need to care about you, anymore, as they have likely already moved you to inaction and made you unwilling to tell others the truth.
While there is a great deal of science that goes behind manipulating people, the tradition is as old as human history, itself; it’s origins, magical from the perspective of the ancients. Whether you call mass manipulation “hypnosis,” “psychology,” “magic” or “science,” the fact of the matter is that it is there in a more constant form than ever, impossible to avoid, and invisible to those who aren’t paying attention or willing to research and think for themselves.
Like the idea of dark matter, you cannot see it directly (at least, when done well), but should be able to test and compare data data in different circumstances to detect it. There are many confirmed real world examples of mass manipulation that people should be aware of, because it is very easy for people to believe that it is not happening to them.
Many say that is too big of a conspiracy to keep secret; though we already see how it works with a variety of leaks, court cases and plenty of proven real world examples. If you encounter this argument, you have probably encountered someone who is hypnotized into misunderstanding the word “conspiracy”, where a group of people work together to commit crimes.
One easy way to create a consensus across media organizations is to enter into “non disparagement agreements.” For example, HBO entered into a non-disparagement agreement with Michael Jackson’s attorneys. A recent court case established that the agreement remains in effect even after his death. This means, with the right law firm, someone can enter into many unknown non disparagement agreements with many companies.
It sounds weird, but this is like black magic. Occult literally means hidden. Secret words have been spelled out that the public is not aware of, but creates the illusion that there is a consensus about any given personality; like say a politician, a singer or an actor. A web of mutual non-disparagement agreements works as a form of forensic interruption, preventing people being held accountable for crimes.
Between non-disclosure agreements and non-disparagement agreements, there is a web of protected relationships where people, products and even governments are not allowed to be discussed in a negative light.
This has created an extortion racket by the media. If you don’t buy in, then you are fair game. Not only are you fair game, they will harass you until you buy in because they literally need something to do due to their lack of ability to speak negatively about their cohorts.
When you consider the nexus between government and media, the problem is compounded when you introduce the concept of keeping things secret for national security. Policy has created the circumstance that corporate and secret government interests are intertwined and they become aligned in keeping each other out of jail.
While a lot of this is managed at upper echelons, the system is merely taking advantage of human nature, which is why the government and media should be operating from a “zero trust” standpoint and not the other way around, like it currently is. There is and never has been any reason to trust the media or the government, and doubly so when their interests are aligned. There are many proven real world examples.
The first ingredient to modern mass hypnosis is saturation and repetition. Your first clue that the message is artificial is when many corporate, government and astroturfing battlegrounds all agree on the same thing.
Not only is a contrived message oft-repeated, it is generally very polarized; where, due to cognitive bias, it is designed for consumption by both sides with the ideal result of making one side feel schadenfreude and the other side feel outrage and injustice. Just being aware of this polarization tactic and allowing yourself to have more nuanced opinions that the black or white ones offered up to you, is incredibly effective at not taking the bait.
“Systems Psychodynamics” is the name of the psychological framework that is used to monitor and control people, primarily based on attacking and reforming “basic assumptions.” By controlling everyone’s basic assumptions using the repetitious push and pulling narratives, the levers of political and monetary behavior are controlled through “influencers.” This framework reads like it was written for social media, though, in reality, it is much older; social media merely enhances the effects.
One easy way to detect the agenda and the widespreadness of the corruption, without even knowing the finer points of mass persuasion techniques, is to see what is censored. Generally, the astroturfing campaigns seek to drown out good information that is contrary to their cause. However, when you find some information that is very damaging to their narrative, especially before they’ve scripted a response, it gets removed. Eventually, they will write up a standard response, but this takes time.
For this reason, I incubate a number of censorship experiments across multiple sites. While people easily get away with discussions about aliens and flat earth, conversations about modern slavery are shut down everywhere; particularly if you call people to action in reporting crimes. Sites that purport to be “free speech” will not allow you to openly hunt human traffickers and the “system” seems to hate vigilantes more than anything.
Most recently, the censorship around Covid “truth” is heaviest. Censorship of doctors has been swift and totalitarian. However, because I see generally what gets censored, first, I knew this was all a scam from Day One. The first SARS COV 2 tests, up until March, were merely SARS COV tests. Very literally. The SARS COV 2 tests hadn’t been invented, yet. Explaining that the body produces the CR3022 protein (what the antibody tests look for) for all human affecting coronaviruses was heavily censored. Even now, explaining this basic fact that exposes why a great deal of testing is fraudulent, is struck from both Right and Left astroturfing machines. If you really want a rabbit hole to dig through, search the coronavirus pandemic bonds that matured March 23, 2020.
Prior to that, the name “Eric Ciaramella” was one of the most censored things on the Internet. Censored, in that the information was deleted immediately. The motivations behind these multi-site censorship campaigns should have everyone concerned because it is consistently in support of Democrat and RINO narratives, politically, and always in favor of human traffickers.
However, even the Q Anon group will censor you with a variety of tactics if you speak of certain things in the wrong way or mention the possibility that they, themselves, are part of an astroturfing outfit. Fox News still won’t give a fair shake to the Uranium One/Skolkovo/Troika Laundromat evidence and it betrays them as controlled opposition/ a limited hangout, since it would destroy the Democrats.
Any “side” of politics you can be on, whether it’s fringe or mainstream or Right or Left, every group has limits to what truthful statements they will tolerate and the nexus where all the groups meet in alignment is when it comes to discussing modern day slavery and who is profiting from it.
Simply removing content is very overt and complaining about it to those who do it will usually earn you a mute or a ban. Running a “brand” across multiple platforms requires conformity to social media company ideologies, or you will be subjected to any and all means of censorship.
Covert means of censorship are also rampant. Upvotes.Club offers a service that not only promotes the content you want, but downvotes topics that run contrary to your marketing strategy. This is one of many astroturfing services. Shadow banning is another tactic that can be difficult to detect. “Deboosting” is common in social platforms, as well, where the number or type of viewers who see your content is limited. This breeds “echo chambers” across multiple Internet communities.
Out of frustration and curiosity, I began experimenting with different ways to engage with the shill communities. Very often, their own tactics work quite well against them. Years into this push and pull with these groups, my best strategy has evolved to monitor them as they often telegraph economic opportunity and subvert them from behind a layer of complexity a shill script can’t understand and is unable to deal with. When I noticed Bitcoin was being heavily shilled, I saw a signal to buy early. This was the catalyst for rethinking everything I was doing.
When I noticed that there was blatant fraud in the media about SARS COV 2, I noticed the exact same behavior I had seen before when I struck it rich with Bitcoin. I even went to my audience and said on a podcast, “the market will be back to normal levels in a month… six tops.” I bought the dip, knowing the numbers were fully overblown. My $TSLA experience has been quite enriching.
Every day, in the stock trading communities, shills are looking to pump and dump stocks and groups are spending money to illegally manipulate the stock market. However, you can use different ways to monitor social media to detect potential pumps and dumps. If you start seeing the same thing show up on different platforms, among different known shill groups, you know someone has paid for a pump and dump. So long as you have a set, small percentage to gain, you can avoid the pitfalls and get out early.
Right now, that is my “edge”, in trading. I don’t feel nearly as obligated to spread the truth to others, since I’ve realigned my priorities. These technological tools for being the first to news items, to new evidence, finding new ways of searching existing information; not only does it help you navigate past censorship, you can use it to make more “realistic” decisions about the world around you.
Politics and the stock market are inextricably linked. To be informed on one, is to be informed on the other. When you begin to pull in more intersecting information, like “systems psychodynamics” and overall agendas of differing groups, you are expanding your knowledge and your consciousness so that your intellect has more of a real world impact.
When you delve deep into ancient traditions, you will, eventually, learn of alchemy; usually the pursuit of endless wealth or the search for immortality. Day trading well is, essentially, modern day alchemy in that you are making money from thin air. Musicians transform what is in their mind into a product that can be sold. There are many forms of alchemy. Bitcoin is another great example of modern day alchemy. In my humble opinion, augmenting your own well-disciplined intellect with good computing practices can make you a modern day wizard; an alchemist.
Many people were saturated with pro-Nihilism marketing and ate it up with their Cheerio's while listening to Nirvana CDs. A couple of generations of nihilists later, combined with portable dopamine trap screens from waking moment 'til slumber, and people are literally having a hard time finding a reason to get out of bed in the morning.
Being a successful trader heals a lot of the damage from that consumerist propaganda and forces people to interact with the natural causes of their decision making.
The Market is not racist. The only color you have to worry about is green. The market does not celebrate your success or mock your failures. The opinions of critics do not count.
The Market does not care about your feelings or anyone else's.
All people enter the Market equal and there are no participation awards. There is no busywork. Your test scores do not matter. All that matters are results and that type of black and white simplicity makes the Market the most sane aspect of society, right now.
Though most of the obvious stocks have since reached preCovid normality, it has been easy to make money by sorting every ticker by Feb 20 high, then subtract the current price, calculate potential gain when they return to their old price and pick ones that had a high probability of doubling or tripling your money the fastest.
I understand it seems tangential, the stock market angle, but when you are routinely called a “conspiracy theorist”, it helps to be as realistic as possible and there is no better way to prove your theories than by putting your money where your mouth is.
The stock market is a vessel from which normal people (”retail investors”) are scammed constantly, for the benefit of institutional investors. The Epsteins, the Soros’, all the political elite; they are playing in this realm and they graduated to using AI and machine learning to augment their schemes years ago. In order to understand the elite, you have to understand their playground.
In order to compete in the information age, you need to augment your intellect using technology. If nothing else, use it to be meticulously organized. If you get organized in only one aspect of your life, make it your finances.
The Democratic party uses the ADA AI, named from Ada Lovelace and a competitor, in 2016, Cambridge Analytica, was used by the Republicans. These AI’s are augmented with databases and metadatabases of everything that can be served up by a social media APIs. They know everything about you and they don’t spy on your microphones, cameras and screenshots to catch you at crimes; they are spying on you in order to better teach you how to vote and spend money.
Combined with an army of astroturfing accounts, these AIs are quite good at manipulating what shows up on your screen. This type of censorship is bad for stock traders, researchers and people who just want a few honest answers.
In order to compete a bit better, I have taken to making by own custom feeds and scrapers, so that I can database text of many sites and subjects, which then is far easier to search, but is also able to sort information so that I can find what I am looking for in a few minutes, as opposed to trawling the same channels or search engines everyday and learning relatively little. I am really on the hunt for stuff that is voted up or noticed organically and is in that stage before it catches on by a shill group. I incorporate a lot of OSINT tools and I like to collect leaked databases to be able to compare information. It is very helpful to use machine learning to detect what I need as quickly as possible and serve it up to me, first.
Applying my own knowledge of how the astroturfing system works, I have developed strategies to target influencers with new and original information and I can quickly and easily get it to them without influencers even knowing I am the source of the information. I just have to identify the correct group to get my message out, then make sure their leaders see the information, who will naturally post it on their own and their followers will naturally vote information up for free. I don’t do this with stocks (questionable legality), but I do feed good news to the right people and I exert a lot less effort to get ideas across all platforms than I used to.
No astroturfing groups are into anti-consumerist ideas. “Hydro Homies” and “No Fap” are two great examples that recommend people be anti-consumerist and avoid specific products. As a result, these movements, despite being healthy and productive, have a lot of trouble gaining traction. There is no mainstream push for a truly healthy agenda. All contrived movements must pay to astroturf and shill because, otherwise, embracing their products and ideas is contrary to your well being. No shill group is working to save you money or trying to convince you to make the right decision, for yourself.
There are certain messages almost no one will add social media velocity to; detailed instructions on how to report crimes or catch pedophiles, leaked information that hurts both sides of the political spectrum, anything a little too technical or complex.
There are already efforts to make hijack the anti-human trafficking crowd. They will be tricked into meaningless pursuits that have no real world consequence. Money will be raised and wasted. News article after news article will be pumped out detailing how everyone is supporting victims and raising awareness. Meanwhile; nobody of consequence is arrested. The mining industry will continue to use forced labor and the networks they use will also feed the sex slavery and domestic servitude and the systemic policies and corrupt politicians will continue on unimpeded.
Let’s hope that changes, but it will require a lot more people getting off their asses and getting involved. It will require a lot more people speaking up outside of their echo chambers.
Ready. Set. Go.
submitted by The_Web_Of_Slime to TopConspiracy [link] [comments]

Free bitcoin usd ticker??

I’m looking for an intraday Bitcoin usd ticker data feed API that I don’t need to pay for. Not historical, just ticker data. Happy to have typical ohlcv or just prices and volumes.
Happy to deal with rest or web socket or Mqtt or whatever just something that is straightforward and works.
If this isn’t the right place can someone point me in the right direction? If you think think the answer is too obvious, don’t underestimate my level of idiocy and just ELI5; I’m alright with python and internet protocol fundamentals just getting really frustrated.
Thanks in advance
submitted by blorgalorp to CryptoMarkets [link] [comments]

BTC price quote

BTC price quote

https://preview.redd.it/ol0xunboaf951.png?width=864&format=png&auto=webp&s=3bc261b6916c16487d48e8241f2467bb64429406
new version of my self-created linux command line tool:
https://github.com/fatrattombala/bash-btc-quote
The shell (bash) script uses the coingecko API and is capable of displaying all crypto currencies available through that API. There are a lot of cross-currencies (55 at the moment, including some Cryptos, as well as the commodities Gold (XAU) and Silver). The script startet with the argument "--c" shows them all with name and ticker.
I like this kind of command line tools a lot - I don't want to be constantly informed about the Bitcoin (or other crypto) price, but from time to time, I hack in "btc" - and get it. The script was more or less the outcome of a small shell script programming learning project.
have fun
submitted by fatrattombala to Bitcoin [link] [comments]

My Raspberry Pi Bitcoin ticker!

My Raspberry Pi Bitcoin ticker! submitted by cryptocake to Bitcoin [link] [comments]

HEX CoinMarketCap Listing Request - Need Feedback/Help

PROGRESS:
https://coinmarketcap.com/currencies/hex/
https://www.coingecko.com/en/coins/hex
https://coincodex.com/crypto/hex/
https://coinpaprika.com/coin/hex-hex/

PROOF:
CoinMarketCap ---- https://imgur.com/a/TsbX5o3
LiveCoinWatch ----- https://imgur.com/a/9pdzLgg
CoinGecko ----------- https://imgur.com/a/oY3wn0w
WorldCoinIndex --- https://i.imgur.com/t9m0NDX.png
CryptoCompare --- https://i.imgur.com/wt6ni6O.png
CoinCodex ----------- https://i.imgur.com/XonOWor.png
Coinlib ----------------- https://i.imgur.com/ZNtvOsZ.png
Coinpaprika --------- https://i.imgur.com/f6fFz2s.png

DONATE / REFER:
if you want to support my work, please use my referral link! (and gain 10% more hex coins):
https://hex.win/?r=0x36ECd27625efeECeF5E8e62Cfdbd3F990801bA96
or donate ETH or HEX to my address: 0x36ECd27625efeECeF5E8e62Cfdbd3F990801bA96

COINMARKETCAP LISTING - TEXT FORMAT - (WITH LATEST EDITS):

1 - [New Listing] Add cryptoasset

Subject
HEX - HEX - Add cryptoasset

Project Launch Date
December 2, 2019

Project Name
HEX

Project TickeSymbol
HEX

Project Description
Launched on December 2, 2019 by Richard Heart and team, HEX is the first certificate of deposit on the blockchain, essentially time deposits that gain interest, HEX is an ERC20 Token that runs over the Ethereum network

Platform
Ethereum

Chain Fork
Not a fork, an Ethereum Smart Contract

Consensus Algorithm
Proof of Work and Proof of Stake Hybrid

Team/Backers/Investors
https://hex.win/#team

Traction/Adoption/Parternships/MVPs/Apps
As of Ethereum Block #9073548, Sun, 08 Dec 2019 19:5511 GMT
33,571 ETH ($5,067,575.86) has been invested
Ranked Top 10 Project on Dapps Radar
https://dappradar.com

Community Engagement
6,415 members on Telegram
https://t.me/HEXcrypto
3,661 followers on Twitter
https://twitter.com/HEXcrypto

Regulation/Licence
N/A

Office locations/addresses
N/A

Industry/SectoVertical
Certificate of Deposit (CD)

Link to Logo
https://i.imgur.com/Ha3FT3a.png

Website 1
https://hex.win/

Website 2
https://go.hex.win/

Block Explorer 1
https://etherscan.io/token/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39

Source Code
https://etherscan.io/address/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39#code
https://github.com/BitcoinHEX

Whitepaper / Technical Documentation
https://hex.win/techspecs.html

Announcement (Bitcointalk)
https://bitcointalk.org/index.php?topic=4523610.0

Message Board
https://www.reddit.com/HEXcrypto/

Twitter
https://twitter.com/HEXcrypto

Reddit
https://www.reddit.com/HEXcrypto/

Facebook
https://www.facebook.com/HEXcrypto

Video Channel
https://www.youtube.com/HexCrypto

Chat 1
https://t.me/HEXcrypto

Linkedin
https://www.linkedin.com/

Mobile App
https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn

Circulating Supply
https://hexstat.com/circulatingsupply

Total Supply
https://hexstat.com/totalsupply

Max Supply
N/A
(NOTE: Inflates 3.69% per year)

ICO/IEO Start Date
?

ICO/IEO End Date
?

ICO/IEO Price
?

# of assets sold in Private Sale
0

# of assets sold in Public Sale/ICO/IEO
0

Total # of assets sold
0

Total amount of capital raised (USD)
?

# of assets available to the public
0

# of assets that have been distributed to the public
0

# of assets that have been privately allocated for team/advisors/developers/future
0

API endpoint that displays ONLY TOTAL SUPPLY as a NUMERICAL value
https://api.etherscan.io/api?module=stats&action=tokensupply&contractaddress=0x2b591e99afe9f32eaa6214f7b7629768c40eeb39&apikey=YourApiKeyToken

Rich List
https://etherscan.io/token/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39#balances

List of CMC-supported exchanges
https://forkdelta.app/#!/trade/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39-ETH

Annex A - Rich List & Reserve Addresses
Origin Address
https://etherscan.io/address/0x2b591e99afe9f32eaa6214f7b7629768c40eeb39
Flush Address
https://etherscan.io/address/0xDEC9f2793e3c17cd26eeFb21C4762fA5128E0399

Tags
DeFI
Staking

Are you willing to provide linkbacks to CMC?
Yes

Proof/Supporting evidence/documents
https://hex.win/

UPDATED LOCALLY:
- Project Name ----- (Changed from Hex to HEX)
- Circulating Supply ----- (Changed to Total Supply)
- Source Code ----- (Added Etherscan)
- Max Supply ----- (None, Inflates forever)
- API endpoint that displays ONLY TOTAL SUPPLY as a NUMERICAL value (Hexstat.com)
HELP:
- Project Description
- Announcement Link
- Mobile App
- ICO/IEO questions and Assets sold in Public/Private questions
- Annex A
submitted by togoshige to HEXcrypto [link] [comments]

2.3 Common API explanations

Summary

When it comes to programming, it must be inseparable from the API. For many non-programmer people, what is the API? In this section we will use the easiest language to explain what is the API, and introduce the APIs commonly used in the FMZ Quant tools.

What is API?

If you google it, you will get the following results: API (Application Programming Interface) is a predefined function to provide applications and developers with the ability to access a set of routines based on a piece of software or hardware. Without having to access the source code, or understand the details of the internal working mechanism.
In fact, in daily life, we have a lot of similar API scenarios, such as: you go to a restaurant to eat, just look at the menu to order, you do not need to know how to make it. The menu name in the menu is the specific API, and the menu is the API document.

What is the API in the quantitative trading?

For example, If you need to get the opening price of the current variety today, you don't need to know exactly how to get it. You only need to write "OPEN" in the code editor, just use it directly, "OPEN" is the API for the opening price in the M language.

Common M language API

Before we talk about the M language API, let's first look at the common code structure and what features it has. This will help you better understand the API. Please see the following example:
12
AA:=OPEN; //Get the opening price of the latest k line and assign the result to the variable AA BB:=MA(ClOSE,10); //Get the 10-cycle moving average of the latest K line and assign the result to the variable BB 
The code shown above:
With the basic code structure awareness, we will bring you some common grammar of M languages ​​below, and we will use them in the future.
Example: AA:=OPEN; Get the opening price of the latest K line and assign the result to AA
Example: AA:=HIGH; Get the highest price of the latest K line and assign the result to AA
Example: AA:=LOW; Get the lowest price of the latest K line and assign the result to AA
Example: AA:=CLOSE; Get the closing price of the latest K line and assign the result to AA
Example: AA:=VOL; Get the volume of the latest K line and assign the result to AA
Example: REF(CLOSE,1); Get the opening price of the pervious K line
Example: MA(CLOSE, 10); //Get the 10-cycle moving average of the latest K-line
Example: CROSSUP (CLOSE, MA (C, 10)) // closing price up-cross the 10 cycle moving average price
Example: CROSSDOWN(CLOSE, MA(C,10)) // closing price down-cross the 10 cycle moving average price
Example: CLOSE>MA(CLOSE,5), BK; // Closing price is greater than 5 cycle moving average, open long position
Example: CLOSE Example: CLOSE
  • BP - buy to cover to close short position
Example: CLOSE>MA(CLOSE,5), BP; // Closing price is greater than 5 cycle moving average, close short position
  • BPK - close short position and open long positions (reverse open position)
Example: CLOSE>MA(CLOSE,5), BPK; // when the closing price is greater than the 5-period moving average, close the short position and open the long position.
  • SPK - close long position and open short position (reverse open position)
Example: CLOSE
  • CLOSEOUT - close all positions, it is recommended to use in the addition and subtraction position operation
Example: CLOSEOUT; close all positions that current holding.

Commonly used JavaScript language API

Before explaining the JavaScript language API, let's take a look at what the common code structure is and what features it has. This will help you better understand the API. Please see the following example:
12
var aa = exchange.GetRecords(); // get the K-line data var bb = exchange.SetContractType("BTC_USDT") // set the trading pair to Bitcoin to USDT 
The code shown above:
  • Creating variables in the JavaScript language is often referred to as a "declaration" variable. we use the "var" keyword to declare the variable, the variable name is : "aa".
  • In the JavaScript language, assign an equal sign, that is, give the value on the right side of "=" to the variable on the left.
  • The code "exchange" is the exchange object. The exchange here refers to the exchange you set up on platform page. This is a fixed format, that is, you must specify the exchange object when you call the API of the JavaScript language.
  • The green code is the API of the JavaScript language. When we call it, it is actually calling the function in the exchange object. Note that the point behind the code is also a fixed format. The function here is the same meaning of the function we learned in middle school. If the function does not need to specify a parameter, it is represented by an empty parenthesis; if the function must pass in a parameter, the parameter is written in parentheses.
After using the case to understand the basic structure of the code, let's take a look at a few JavaScript language APIs that you will use in the future.
  • SetContractType ( "variety code" ) - set the trading pair, which is the trading variety that you want to trade
Example: exchange.SetContractType("BTC_USDT"); //Set the trading pair to Bitcoin to USDT
  • GetTicker - Get Tick data
Example: exchange.GetTicker(); //Get Tick data
  • GetRecords - get K line data
Example: exchange.GetRecords(); //Get K line data
  • Buy - buy long
Example: exchange.Buy(5000, 1); //Buy one unit at 5,000
  • Sell ​​- sell short
Example: exchange.Sell (5000, 1); // Sell one unit at 5,000
  • GetAccount - get account information
Example: exchange.GetAccount(); //Get account information
  • GetPosition - Get position information
Example: exchange.GetPosition(); //Get position information
  • SetDirection - set to do long or short order type
example:
exchange.SetDirection("buy"); //Set the order type to open long positions
exchange.SetDirection("closebuy"); //Set the order type to sell to close long positions
exchange.SetDirection("sell"); //Set the order type to open short positions
exchange.SetDirection("closesell"); //Set the order type to buy to cover to close short position
  • Log - output a message in the log
Example: Log( "hello, World" ); //output " hello world " in the log
  • Sleep - pause the program for a while
Example: Sleep (1000); / / make the program pause for 1 second (1000 milliseconds equals 1 second)
Some people may have doubts, so many APIs above, how can i memorize it all? actually, you don't need to remember any one of them, FMZ Quant official website has a detailed API documentation. Just like looking up a dictionary, anytime you use it, you only need check it through our documentation. Don't be scared by the coding part. What we want is to organize our own strategies through these languages. Please remember that technology is never a threshold for quantitative trading. The excellent trading strategy is the most important of all.

To sum up

The above is the most commonly used API in quantitative trading, basically including: obtaining data, calculating data, placing orders. These steps should be enough to deal with a simple quantitative trading strategy. futhermore, if you want to write a more complex strategy, you need go to the FMZ Quant website to get it.

After-school exercises

1, try to write a M language 5 cycle average line up-cross 10 cycle moving average line sentence.
2, try to use the JavaScript language "GetAccount" to get your account information, and use "Log" to print it to the log.

Next section notice

Programming is like assembling LEGO bricks. The API is like the various parts of a building block. The programming process is to make each Lego part a complete toy. In the next section, I will lead you to assemble a complete quantitative trading strategy using the M language API.
submitted by FmzQuant to CryptoCurrencyTrading [link] [comments]

A Python Script for Live XRP Price Ticker (Using Exchange Websockets)

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.
Install Library
We will need to install the following library.
pip install shrimpy-python 
Script
Once the library has finished installing, you can run this simple script to begin streaming live XRP ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "binance", "pair": "xrp-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
Automating Crypto Portfolios with Trading Scripts
submitted by ShrimpyApp to Ripple [link] [comments]

A Python Script for Live Bitcoin Price Ticker

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.

Install Library

We will need to install the following library.
pip install shrimpy-python 

Script

Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "binance", "pair": "btc-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
submitted by ShrimpyApp to Bitcoin [link] [comments]

A Python Script for Live Bitcoin Price Ticker (Using Coinbase Pro Websockets)

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.
Install Library
We will need to install the following library.
pip install shrimpy-python 
Script
Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "coinbasepro", "pair": "btc-usd", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
Automating Crypto Portfolios with Trading Scripts
submitted by ShrimpyApp to CoinBase [link] [comments]

Financial Modeling for Cryptocurrencies: The spreadsheet that got me my first 1,000% gain

TL;DR: I created a spreadsheet that automates pulling trending cryptocurrencies, recent tweets, and bullish/bearish sentiment into Google Sheets. You can find it here:
https://docs.google.com/spreadsheets/d/1QtxaDWCoXkIqjPVVkU8DNsx8GBaBd180COwn1CIasa8/copy
I know some crypto users prefer to work in spreadsheets (including myself) so I created a spreadsheet that looks at trending symbols and estimates bullish/bearish sentiment. I never had the time to develop software engineering skills, but the recent launch of a few add-ins has allowed regular joes like myself to harness the power of APIs.

The Beauty of Sentiment Trading

According to Google Trends, the word “sentiment analysis” has been gaining steady traction over the past 5 years.
Sentiment refers to the attitude expressed by an individual regarding a certain topic. This is especially relevant in trading, where so much of the change in price is dictated by emotions:
When it is applied to trading, sentiment can be used (with great potential windfall) as a directional signal to figure out whether you should enter a crypto position within your portfolio.
A way you can utilize sentiment when trading crypto, is to measure the positivity or negativity of a tweet. If recent tweets have been overwhelmingly bullish (aka, the person expects the crypto rise) and movement is beginning to happen in the currency, chances are good that the trend will continue.
Luckily for you, StockTwits already does this with around 225 different cryptocurrencies. And if you can combine the sentiment with trending cryptocurrencies, you can catch the wave right as it forms.

Services Used:

  1. Google Sheets
  2. Spreadstreet Google Sheets Add-in
  3. StockTwits
  4. CoinMarketCap API
Full disclosure: The google sheets add-in is a 14-day free trial, and $15 per month after. However, no one should be refused access on the basis of money (especially true for students and less fortunate). Send me a message, and I will make sure you are not left in the dark.

A note on security

Users have expressed hesitation about running a google sheets add-in on their main computer, so I will attempt to ease those concerns:

What it pulls:

AN OVERVIEW OF THE SECTIONS

The Dashboard
Changing the timeframe
Changing the cryptocurrency
Instructions Tab
Summary Tab

How to use the spreadsheet to spot trending cryptocurrencies

You will spend most of your time in the “Analysis” tab, where the trending cryptocurrencies reside.
I am almost always looking at the “By Hour” timeframe, as the “By Day” and “By Week” is usually a missed opportunity…however, those time frames can still be very useful (albeit, for different reasons).
You want to ride the wave on a cryptocurrency under one or both of the following conditions:
  1. The tweets are very recent, preferably within the last hour
  2. Overwhelmingly Bullish sentiment
A Great Example
A Bad Example

Getting the spreadsheet to work for you

1. Install the Spreadstreet add-in for Google Sheets
2. Get sheet ready for use with the add-in
3. After logging into the add-in, refresh the sheet

Troubleshooting

  1. Important Open the template, click the menu Add-ons / Spreadstreet / Help / View in store, and then click Manage and in the dropdown menu click “Use in this document.”
  2. A reload of the entire worksheet fixes quite a few problems.
  3. Deleting and re-pasting the formula in A1 of the “Data” tab fixes things as well.
  4. If all else fails, drop me a message
  5. The “TIMEFRAME” cell in the Analysis tab (B3) refreshes the pull. Change the results for new data.
Some trending coins are not pulling correctly…what’s going on?
StockTwits has a list of ~225 coins it currently supports. See the “TweetInfo” tab for the full list.
I have tried logging in, activating the template with “Use in this document” and refreshed the sheet…still nothing.
Head to the “Data” tab. Delete the formula in cell A1, and repaste the following: =SS(“tickers-coinmarketcap”, headers, “0”, Currency)
Hoping this is something that is useful to everyone, and I am more than happy to help peeps setup the sheet so they can use it. Just send me a message on here.
Original Medium article can be found here: https://medium.com/@spreadstreet/financial-modeling-for-cryptocurrencies-the-spreadsheet-that-got-me-my-first-1-000-gain-f4d0d1a6e5ed

RESOURCES

Download the spreadsheet: https://docs.google.com/spreadsheets/d/1QtxaDWCoXkIqjPVVkU8DNsx8GBaBd180COwn1CIasa8/copy
Download the add-in: https://spreadstreet.io/tools/google-sheets-add-in
Help: https://spreadstreet.io/docs
First time install and login: https://www.youtube.com/watch?v=aLjtPR4T2bg
Bitfinex Candles endpoint help: https://spreadstreet.io/knowledge-base/bitfinex-api-candles-endpoint/

RELATED POSTS

Top 12 Cryptocurrencies Ranked by Risk-Adjusted Return
10 Statistical Price Predictions for 10 Cryptocurrencies
Bitcoin Madness: How to Simulate Bitcoin Prices in Google Sheets

ABOUT THE AUTHOR

John Young is the founder of Spreadstreet.io, former Financial Analyst for a big-ass company, and runner-up in the 6th grade spelling bee. He would have invested in Google if he knew about it...and had any money.
He is the author of the Spreadstreet blog, which has over 3 readers (not a typo). He hopes to hit 10, but honestly writing is a lot of work.
submitted by 1kexperimentdotcom to CryptoCurrency [link] [comments]

Bitcoin Ticker for real-time BTC market price updates. No adverts. Press F11 to run full screen.

Bitcoin Ticker for real-time BTC market price updates. No adverts. Press F11 to run full screen. submitted by CoinAddress to Bitcoin [link] [comments]

Help with AWS Lambda writing Bitcoin price to DynamoDB

Hi Guys,
I am a couple months into my journey learning to code in Python, and as my first proper 'project' I'm trying to use AWS Lambda to write the Bitcoin price into DynamoDB. I was then looking to use Cloudwatch to automate this process and trigger the Lambda every 15 minutes or so. I am interested in Bitcoin, and so thought it would be a good start with getting to know AWS and Python.
When running the program from IDLE everything works as it should, and the data is written to DynamoDB multiple times. However, when I zip the file and then upload it to AWS, after I click 'Test' the Lambda only works once, and posts the wrong data, as can be seen here: https://ibb.co/7ygpHqp. The bottom 5 entries are me running the code in Idle and gives the correct data, the top one (with incorrect time) is the Lambda. Clicking 'Test' multiple times results in no new data being written to DynamoDB. If I delete the entry and then run Test again, the same entry gets written to Dynamo.
Here is my code, I would be massively grateful for any advice, either on Python or AWS.
import requests, json, boto3 from datetime import datetime bitstamp = requests.get('https://www.bitstamp.net/api/ticke') timestamp = int(bitstamp.json()['timestamp']) dateTime = str(datetime.fromtimestamp(timestamp)) d = datetime.strptime(dateTime, "%Y-%m-%d %H:%M:%S") date = str(d.day) + '-' + str(d.month) + '-' + str(d.year) time = str(d.hour) + ':' + str(d.minute) + ':' + str(d.second) bitstampUSD = float(bitstamp.json()['ask']) dataSet = { 'time(unix)' : timestamp, 'date' : date, 'time' : time, 'bitstampUSD' : str(bitstampUSD) } def lambda_handler(event=None, context=None): dynamodb = boto3.resource('dynamodb') dynamoTable = dynamodb.Table('bitcoinData') dynamoTable.put_item( Item = dataSet ) lambda_handler() 
submitted by spinosaurus7 to learnprogramming [link] [comments]

Help with AWS Lambda writing Bitcoin price to DynamoDB

Hi Guys,
I am a couple months into my journey of learning to code in Python, and as my first proper 'project' I'm trying to use AWS Lambda to write the Bitcoin price into DynamoDB. I was then looking to use Cloudwatch to automate this process and trigger the Lambda every 15 minutes or so. I am interested in Bitcoin, and so thought it would be a good start with getting to know AWS and Python.
When running the program from IDLE everything works as it should, and the data is written to DynamoDB multiple times. However, when I zip the file and then upload it to AWS, after I click 'Test' the Lambda only works once, and posts the wrong data, as can be seen here: https://ibb.co/7ygpHqp. The bottom 5 entries are me running the code in Idle and gives the correct data, the top one (with incorrect time) is the Lambda. Clicking 'Test' multiple times results in no new data being written to DynamoDB. If I delete the entry and then run Test again, the same entry gets written to Dynamo.
Here is my code, I would be massively grateful for any advice, either on Python or AWS.
import requests, json, boto3 from datetime import datetime bitstamp = requests.get('https://www.bitstamp.net/api/ticke') timestamp = int(bitstamp.json()['timestamp']) dateTime = str(datetime.fromtimestamp(timestamp)) d = datetime.strptime(dateTime, "%Y-%m-%d %H:%M:%S") date = str(d.day) + '-' + str(d.month) + '-' + str(d.year) time = str(d.hour) + ':' + str(d.minute) + ':' + str(d.second) bitstampUSD = float(bitstamp.json()['ask']) dataSet = { 'time(unix)' : timestamp, 'date' : date, 'time' : time, 'bitstampUSD' : str(bitstampUSD) } def lambda_handler(event=None, context=None): dynamodb = boto3.resource('dynamodb') dynamoTable = dynamodb.Table('bitcoinData') dynamoTable.put_item( Item = dataSet ) lambda_handler() 
submitted by spinosaurus7 to aws [link] [comments]

A Python Script for Live Bitcoin Price Ticker

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.

Install Library

We will need to install the following library.
pip install shrimpy-python 

Script

Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "binance", "pair": "btc-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
submitted by ShrimpyApp to CryptoCurrency [link] [comments]

My simple bot stops running after a few hours [AWS EC2].

I finally got my python bot working great, all it does is take the current price of bitcoin (plus a few others) and put it into the sidebar. It updates every 60 seconds.
It is running on AWS EC2, on a linux instance. I can run it just fine, and it seems to run for a dozen hours or something like that. For some reason, it stops randomly, despite the python script being designed to repeat indefinitely.
I have to restart it every once in a while, and I can't figure out why. Any help would be appreciated!
Here it the code in my ccbot.py file, with the passwords edited out:
import time import praw import requests from decimal import Decimal USER_AGENT = 'cryptocurrencies ticker bot by u/washyourclothes' REDDIT_USERNAME = 'CryptoCurrenciesMod' SUBREDDIT_NAME = 'cryptocurrencies' class TickerBot: def __init__(self): self.client = praw.Reddit( client_id='edited', client_secret='edited', refresh_token='edited', user_agent='cryptocurrencies ticker bot by u/washyourclothes' ) self.last_ticker_update = 0.0 def run(self): while True: if time.time() - self.last_ticker_update >= 60.0: self.main() self.last_ticker_update = time.time() time.sleep(1.0) def main(self): req = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json') req = req.json() btcprice = req['bpi']['USD']['rate'] rounded_price = round(Decimal(btcprice.replace(",", "")), 0) btcticker = '1 BTC = $' + str(rounded_price) req = requests.get('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd') req = req.json() ethprice = req['ethereum']['usd'] ethticker = '1 ETH = $' + str(ethprice) req = requests.get('https://api.coingecko.com/api/v3/simple/price?ids=ripple&vs_currencies=usd') req = req.json() xrpprice = req['ripple']['usd'] rounded_xrp = round(Decimal(xrpprice), 3) xrpticker = '1 XRP = $' + str(rounded_xrp) req = requests.get('https://api.coingecko.com/api/v3/simple/price?ids=litecoin&vs_currencies=usd') req = req.json() ltcprice = req['litecoin']['usd'] ltcticker = '1 LTC = $' + str(ltcprice) r = praw.Reddit(client_id='edited', client_secret='edited', password='edited', user_agent='cryptocurrencies ticker bot by u/washyourclothes', username='CryptoCurrenciesMod') old_sidebar = r.subreddit('cryptocurrencies').mod.settings()['description'] sidebar = old_sidebar.partition("[](/trg)")[0] r.subreddit('cryptocurrencies').mod.update(description= sidebar + '[](/trg)' + '[' + btcticker + '](https://www.coindesk.com/price/bitcoin)' + '[' + ltcticker + '](https://www.coindesk.com/price/litecoin)' + '[' + ethticker + '](https://www.coindesk.com/price/ethereum)' + '[' + xrpticker + '](https://www.coindesk.com/price/xrp)') if __name__ == '__main__': bot = TickerBot() bot.run() 
The above ccbot.py file is uploaded to my AWS EC2 instance, and I run it using 'nohup python3 ccbot.py &' so that I can shut down my computer and it keeps it running. But for some reason, it only runs for a while. Not exactly sure how long but I ran it last night, it worked fine most of the night, but maybe about 7 or 8 hours after I started it, it stopped running.
submitted by washyourclothes to RequestABot [link] [comments]

A Python Script for Live Bitcoin Price Ticker (Using Exchange Websockets)

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.
Install Library
We will need to install the following library.
pip install shrimpy-python 
Script
Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "binance", "pair": "btc-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
Automating Crypto Portfolios with Trading Scripts
submitted by ShrimpyApp to CryptoCurrency [link] [comments]

A Python Script for Live Crypto Price Ticker

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.
Install Library
We will need to install the following library.
pip install shrimpy-python 
Script
Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "binance", "pair": "btc-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
Automating Crypto Portfolios with Trading Scripts
submitted by ShrimpyApp to CryptoCurrencyTrading [link] [comments]

A Python Script for Live Bitcoin Price Ticker (Using KuCoin Websockets)

Hi Everyone!
I've seen that people in this group have been interested in scripting and building simple things to interact with the cryptocurrency markets.
To help everyone out, I wrote up a brief script which will connect to the websocket for any major exchange and start streaming price data from the exchange.
It's so easy to do anyone could do it. All you need is Python and the ability to copy and paste code. Let's quickly walk through how we can get started.
Install Library
We will need to install the following library.
pip install shrimpy-python 
Script
Once the library has finished installing, you can run this simple script to begin streaming live Bitcoin ticker data.
# import the Shrimpy library for free crypto exchange websockets import shrimpy # create the Shrimpy websocket client client = shrimpy.ShrimpyWsClient() # define the handler to manage the output stream def handler(msg): # multiple trades can be returned in each message, so take the last one ticker = msg['content'][len(msg['content']) - 1]['price'] print(ticker) # construct the subscription object subscribe_data = { "type": "subscribe", "exchange": "kucoin", "pair": "btc-usdt", "channel": "trade" } # connect to the Shrimpy websocket and subscribe client.connect() client.subscribe(subscribe_data, handler) # disconnect from the websocket once data collection is complete client.disconnect() 
That's it! Let me know if you have any questions. You can find the documentation for these APIs here. I also wrote up a few example articles to provide more information:
Script for Cryptocurrency Price Charts
Script for Bitcoin Price Live Ticker
submitted by ShrimpyApp to kucoin [link] [comments]

Multi Crypto Currency Bitcoin price ticker ESP8266 Node MCU Dot Matrix Led Arduino Bitcoin price ticker ESP8266 Node MCU Dot Matrix Led Arduino Bitcoin Price Ticker Tutorial! Raspberry Pi & Python - YouTube Learn all about API from Bitcoin Ticker a very beautiful ...

Some API calls are available with CORS headers if you add a &cors=true paramter to the GET request . URL: https://blockchain.info/ticker No Parameters. Returns a JSON object with the currency codes as keys. "15m" is the 15 minutes delayed market price, "last" is the most recent market price, "symbol" is the currency symbol. 31 March 2020: When querying the coins/ /tickers API endpoint. The value returned under converted_last should be in terms of the price per coin of the . For example, if you query coins/tether/tickers and under the results there is a BTC/USDT ticker pair; in the old version you would see converted_last usd returning 6491.51. Trading-Api (v4) Price Widget API (Basic) Bitcoin.de - Price Widget. Unser Widget bietet Ihnen die Möglichkeit, den Besuchern Ihrer Website bzw. Blogs, den aktuellen Bitcoin.de-Preis anzuzeigen. Größe und Farbe der Widget-Box können Sie über Parameter anpassen. Die Nutzung des Widgets ist kostenlos und mit keinen weiteren Verpflichtungen verbunden, Sie benötigen keinen API-Key ... The best free 🚀 cryptocurrency and bitcoin API. Programmatically access current and historical price, markets, and exchange rate data from exchanges like Binance, Gemini, GDAX, and Poloniex. Quickly create mobile apps, charts, and pricing websites with our lightning fast RESTful JSON API. Trading-Api (v4) Price Widget API (Basic) Bitcoin.de - API (Basic) Die Bitcoin.de API (Basic) ermöglicht Ihnen den Zugriff auf die Übersicht der erfolgreich abgeschlossenen Trades (Tradehistory), der aktuellen Kauf- und Verkaufsangebote (Orderbook) und den aktuellen Bitcoin.de-Kurs (Rate). Tradehistory und Orderbook werden alle 60 Sekunden aktualisiert. Die API (Basic) ist auch ohne großes ...

[index] [51079] [16702] [11247] [37717] [45696] [11271] [8712] [638] [47616] [12954]

Multi Crypto Currency Bitcoin price ticker ESP8266 Node MCU Dot Matrix Led Arduino

In this video u will learn about API & how API works in flutter A simple and easy to build UI design of app We get current price of 1 BTC , 1 ETH, 1 LTC in d... Multi Currency Bitcoin ticker using: arduino-coinmarketcap-api - up to 10 coins with % price change - 1Hr or 24Hr 1 x MAX7219 4 in 1 Dot Matrix Display module 1 x ESP8266 CH340 Node MCU V3 Simple Bitcoin ticker fetching data from api.coindesk.com 1 x MAX7219 4 in 1 Dot Matrix Display module 1 x ESP8266 CH340 Node MCU V3 1 x 20 cm dupont line 5P 1 x 5mm 4pin Common Anode Diffused RGB LED Here, I show you how to make a really, really simple bitcoin price ticker, using a little bit of electronics and a few lines of python! Watch your money incr...

#