Become a Digital Coin Runner with this Program!!!steemCreated with Sketch.

in #programming7 years ago (edited)


I have already advanced enough this interesting program made in  python, with which we will be able to connect to our preferred API to  observe the development of our investments.

For  now the program only has Bittrex API, but soon implement BlockChain,  Poloniex and some other suggest, of course I need a little money to  invest, since the little that I have invested is what I have earned by  working as FREELANCER and The power down from here!!!

The idea of

this program is to understand which currency you are  making or losing money on your favorite investment page such as Bittrex  ...

For example I have invested about 80% and I currently have more than  100 $ in Bittrex simply by investing in small coins that are a bit bad  and some emerging or new ...

The  system is missing a lot but it is already part of what I want to  calculate is how much, now for the next entries we will add the time  factor which will allow us to know if we are winning or losing with one  or another currency and Print the trajectory of our currency !!!

To display a Button:


With this simple code we are going to get something like this:


As we can see tells us how many dollars or bitcoins we have invested  in Bittrex and at about that time when we could sell it for now, the  option of the invested is the market of Ask that is when it is quoted.

Later we are going to graph our profits and we are going to make a  little program capable of indicating to us if in a currency we must sell  or that the own system does :D

The complete code if you want to try it for now here, and soon I upload it to Git:

#!/usr/bin/env python

# -*- coding: utf-8 -*-

from bittrex import Bittrex

import urllib2

from bs4 import BeautifulSoup

import re

APIKEY = "AQUI TU API KEY"  

SECRETKEY = "AQUI TU API SECRETKEY"  

bittrex = Bittrex("APIKEY", "SECRETKEY")

url = "http://www.eleconomista.es/cruce/BTCUSD"

page = urllib2.urlopen(url)

soup = BeautifulSoup(page, "lxml")

valor_btc = soup.find_all('span',class_="accion1 Dif_23138 estado_23138" )

value_BTC_dolares = valor_btc[0].get_text()

value_BTC_dolares = float(value_BTC_dolares.replace(',','.'))

print "Valor del Bitcoin:   ", value_BTC_dolares, "$"

get_balances = bittrex.get_balances

list_important = get_balances()[u'result']

list_balance = []

total_dolares_ask = []

total_dolares_bid = []

total_BTC_ask = []

total_BTC_bid = []

for currency_currency in list_important:

    balance =  currency_currency[u'Balance']

    currency =  currency_currency[u'Currency']

    balance = float(balance)

    if balance>0.00000:

        market_search = "BTC-"+currency

        steem_bittrex = bittrex.get_ticker(market_search)

        if steem_bittrex[u'message'] != u'INVALID_MARKET':

            value_ASK = float(steem_bittrex[u'result'][u'Ask'])

            value_Bid = float(steem_bittrex[u'result'][u'Bid'])

            value_Last = float(steem_bittrex[u'result'][u'Last'])

            value_ASK_BTC   = value_ASK*balance

            value_ASK_Dolar = value_ASK_BTC * value_BTC_dolares

            value_Bid_BTC   = value_Bid*balance

            value_Bid_Dolar = value_Bid_BTC * value_BTC_dolares

            print "Balances in BTC for:  ", currency, "Market:  ", market_search

            print  currency,"Balance:  ", balance, "Value Ask",value_ASK_BTC , "Value BID", value_Bid_BTC

            print "Balances in $ for:  ", currency, "Market:  ", market_search

            print  currency,"Balance:  ", balance, "Value Ask",value_ASK_Dolar , "Value BID", value_Bid_Dolar

            print " "

            total_dolares_ask.append(value_Bid_Dolar)

            total_dolares_bid.append(value_ASK_Dolar)

            total_BTC_ask.append(value_Bid_BTC)

            total_BTC_bid.append(value_ASK_BTC)

print "Total  Dolars Investment: ", sum(total_dolares_bid)

print "Total Dolars, if sell now: ", sum(total_dolares_ask)

print "Total Bitcoins Investment: ", sum(total_BTC_bid)

print "Total Bitcoins, if sell now: ", sum(total_BTC_ask)

May God bless you until the next ...

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.029
BTC 64512.68
ETH 2615.54
USDT 1.00
SBD 2.82