Skip to content

Instantly share code, notes, and snippets.

View umitanuki's full-sized avatar

Hitoshi Harada umitanuki

  • Alpaca
  • California
View GitHub Profile
shares price dollar
AAPL 2.0 190.9403 381.8806
MSFT 3.0 107.556 322.668
FB 1.0 210.91 210.91
JPM 1.0 113.35 113.35
JNJ 1.0 126.63 126.63
XOM 1.0 80.569 80.569
BAC 3.0 30.75 92.25
WFC 1.0 57.5786 57.5786
using System;
using System.Configuration;
using Alpaca.Markets;
namespace example
{
class Program
{
static void Main(string[] args)
{
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = "*"
BeautifulSoup4 = "*"
IPython = "*"
pandas = "*"
@umitanuki
umitanuki / algo.py
Created September 19, 2018 21:15
An example of live algo migrate from Quantopian
from pylivetrader.api import (
attach_pipeline,
date_rules,
time_rules,
order,
get_open_orders,
cancel_order,
pipeline_output,
schedule_function,
)
@umitanuki
umitanuki / main.py
Created November 19, 2018 02:01
Alpaca Backtrader Integration Example
import backtrader as bt
import alpaca_backtrader_api
import pandas as pd
class SmaCross(bt.SignalStrategy):
def __init__(self):
sma1, sma2 = bt.ind.SMA(period=10), bt.ind.SMA(period=30)
crossover = bt.ind.CrossOver(sma1, sma2)
self.signal_add(bt.SIGNAL_LONG, crossover)
var PositionRowStart = 17;
function _request(path, params) {
var headers = {
"APCA-API-KEY-ID": "*** API key ID ***",
"APCA-API-SECRET-KEY": "*** API secret key",
};
var endpoint = "https://api.alpaca.markets";
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pipeline-live = ""
ipython = "*"
ta-lib = "*"