Has anyone did any work with bitcoins?
Has anyone did any work with bitcoins?
There are several relevant datasests on quandl, here's one: http://www.quandl.com/BITCOIN-Bitcoin-Charts/MTGOXUSD-Bitcoin-Markets-mtgoxUSD
With Tyler's tip, I was able to cook together an example.
You can clone this and make a trading strategy now that you have the price imported.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.
I tried combining this with the sample algo but had no luck: halp?
import pandas
def rename_col(df):
df = df.rename(columns={'Weighted Price': 'price'})
df = df.fillna(method='ffill')
df = df[['price', 'sid']]
log.info(' \n %s % df.head()')
return df
def initialize(context):
fetch_csv('http://www.quandl.com/api/v1/datasets/BITCOIN/MTGOXUSD.csv?trim_start=2012-01-01',
date_column='Date',
symbol='weighted_price',
usecols=['Weighted Price'],
post_func=rename_col,
date_format='%Y-%m-%d'
)
context.stock = sid(3766)
context.max_notional = 1000000.1
context.min_notional = -1000000.0
def handle_data(context, data):
if 'price' in data['weighted_price']:
record(weighted_price=data['weighted_price'].price)
vwap = data[context.stock].vwap(3)
price = data[context.stock].price
notional = context.portfolio.positions[context.stock].amount * price
if price < vwap * 0.995 and notional > context.min_notional:
order(context.stock,-100)
elif price > vwap * 1.005 and notional < context.max_notional:
order(context.stock,+100)
I agree, the error will be helpful.
Also, Kent, what are you trying to do? Currently the backtester only permits buying and selling US equities. Bitcoin prices can be used as a signal, but you can't (yet) model buying and selling bitcoin. Is there a stock you are trying to trade as Bitcoin value changes?
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.
it was a runtime error; didn't know modeling buying/selling wasn't implemented: that answers my question :)
Hello Cos,
Our livetrading model depends on connecting your Quantopian account to a broker. So far there isn't an obvious bitcoin broker to do livetrading with.
I expect our bitcoin modeling tools will get strong this summer, though.
Dan
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.
ahahhaha without read all the thread i try and try to do what Kent Davis just try to do without success!!!
anyway you have to contact:
coinsetter
coinMKT
they are going to open in days....
i doesn't understand why having the price is not possible to backtest, let's the user choose the fees and the spread if is this the problem, if not what is?
anyway the problem will be solved soon because now 2 broker will be open in days (coinmkt in 5 days, coinsetter will also work in around a week)