I'll put the monitoring service online in the few days.
Error: object 'tt' not found"
I would be interested in any script, website, that could chart and compare coinbase and btcchina if anyone knows of others or could tell me why this doesn't run.
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
library(rjson)
library(RCurl)
require(tcltk)
n=10 #number of BTC you are trading
wu_fee=30 #fee that use western union to transfer money from China to US
diffs<-c()
count<-0
while(TRUE)
{
count=count+1
result = tryCatch({
tt<-fromJSON(getURL("https://coinbase.com/api/v1/prices/buy")) #get real time trading data
bc<-fromJSON(getURL("https://vip.btcchina.com/bc/ticker"))
}, warning = function(w) {
print("internet problem")
}, error = function(e) {
print("internet problem")
})
buy_price<-as.numeric(tt$subtotal$amount)
tx_fee<-as.numeric(tt$fees[[1]]$coinbase$amount)
bank_fee<-as.numeric(tt$fees[[2]]$bank$amount)
buy_total<-buy_price*n+tx_fee*n+bank_fee
sell_price<-as.numeric(bc$ticker$buy)
ex_rate=6.1
bank_fee_sell=0.01
total_sell<-sell_price*n*(1-bank_fee_sell)/ex_rate
diff<-total_sell-buy_total-wu_fee
print(diff)
if(diff>300) #alert trade if diff is greater than 300 USD, change it yourself as needed
{
ReturnVal <- tkmessageBox(title = "Trade Now",
message = "Trade Now", icon = "info", type = "ok")
}
if(count>=500)
{
count=0
diffs=diffs[-c(1:400)]
}
diffs<-c(diffs,diff)
plot(diffs,type="l")
}
wu_fee=30 #fee that use western union to transfer money from China to US
library(rjson)
library(RCurl)
require(tcltk)
n=10 #number of BTC you are trading
wu_fee=30 #fee that use western union to transfer money from China to US
diffs<-c()
count<-0
while(TRUE)
{
count=count+1
result = tryCatch({
tt<-fromJSON(getURL("https://coinbase.com/api/v1/prices/buy")) #get real time trading data
bc<-fromJSON(getURL("https://vip.btcchina.com/bc/ticker"))
}, warning = function(w) {
print("internet problem")
}, error = function(e) {
print("internet problem")
})
buy_price<-as.numeric(tt$subtotal$amount)
tx_fee<-as.numeric(tt$fees[[1]]$coinbase$amount)
bank_fee<-as.numeric(tt$fees[[2]]$bank$amount)
buy_total<-buy_price*n+tx_fee*n+bank_fee
sell_price<-as.numeric(bc$ticker$buy)
ex_rate=6.1
bank_fee_sell=0.01
total_sell<-sell_price*n*(1-bank_fee_sell)/ex_rate
diff<-total_sell-buy_total-wu_fee
print(diff)
if(diff>300) #alert trade if diff is greater than 300 USD, change it yourself as needed
{
ReturnVal <- tkmessageBox(title = "Trade Now",
message = "Trade Now", icon = "info", type = "ok")
}
if(count>=500)
{
count=0
diffs=diffs[-c(1:400)]
}
diffs<-c(diffs,diff)
plot(diffs,type="l")
}