All Projects → AxelGard → cira

AxelGard / cira

Licence: MIT license
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to cira

AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+980.95%)
Mutual labels:  finance, trading, trading-bot, algo-trading, stocks, quantitative-finance
stockbot
Alpaca algo stock trading bot
Stars: ✭ 105 (+400%)
Mutual labels:  algo-trading, stock-market, stocks, alpaca, alpaca-trading-api, alpaca-markets
Alpaca Backtrader Api
Alpaca Trading API integrated with backtrader
Stars: ✭ 246 (+1071.43%)
Mutual labels:  finance, trading, trading-bot, stock-market, algotrading
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+2038.1%)
Mutual labels:  finance, trading, stock-market, algotrading, quantitative-finance
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (+528.57%)
Mutual labels:  finance, trading, trading-bot, stocks, quantitative-finance
Beibo
🤖 Predict the stock market with AI 用AI预测股票市场
Stars: ✭ 46 (+119.05%)
Mutual labels:  finance, stock-market, stocks, quantitative-finance
tuneta
Intelligently optimizes technical indicators and optionally selects the least intercorrelated for use in machine learning models
Stars: ✭ 77 (+266.67%)
Mutual labels:  finance, trading, stock-market, stocks
trading sim
📈📆 Backtest trading strategies concurrently using historical chart data from various financial exchanges.
Stars: ✭ 21 (+0%)
Mutual labels:  finance, trading, trading-bot, stock-market
Mop
Stock market tracker for hackers.
Stars: ✭ 1,534 (+7204.76%)
Mutual labels:  finance, trading, stock-market, stocks
Machine Learning And Ai In Trading
Applying Machine Learning and AI Algorithms applied to Trading for better performance and low Std.
Stars: ✭ 258 (+1128.57%)
Mutual labels:  finance, trading, trading-bot, quantitative-finance
Pipeline Live
Pipeline Extension for Live Trading
Stars: ✭ 154 (+633.33%)
Mutual labels:  finance, trading, trading-bot, algotrading
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+38971.43%)
Mutual labels:  finance, trading-bot, algotrading, quantitative-finance
Finance
Here you can find all the quantitative finance algorithms that I've worked on and refined over the past year!
Stars: ✭ 194 (+823.81%)
Mutual labels:  finance, stock-market, stocks, quantitative-finance
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+1080.95%)
Mutual labels:  finance, trading, stock-market, stocks
Mida
The open-source and cross-platform trading framework
Stars: ✭ 263 (+1152.38%)
Mutual labels:  finance, trading, trading-bot, stocks
alpaca
A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.
Stars: ✭ 100 (+376.19%)
Mutual labels:  trading, stocks, alpaca, alpaca-markets
Blankly
🚀 💸 Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
Stars: ✭ 1,456 (+6833.33%)
Mutual labels:  trading, trading-bot, algotrading, stocks
algotrading-example
algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex, binance futures, market making)
Stars: ✭ 169 (+704.76%)
Mutual labels:  trading, trading-bot, algo-trading, algotrading
Stocksharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Stars: ✭ 4,601 (+21809.52%)
Mutual labels:  finance, trading, stocks, quantitative-finance
Tradestation
EasyLanguage indicators and systems for TradeStation
Stars: ✭ 65 (+209.52%)
Mutual labels:  finance, trading, stock-market, stocks

cira

Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.

Cira is available on pip. Please give it a star if you like it!

a cira

GitHub stars GitHub forks Tweet

GitHub PyPI PyPI - Python Version PyPI - Downloads

The name cira is a miss spelling of the word for a baby alpaca cria and because this is a simple and small lib I thought it would be a perfect fit.

Axel Gard is main developer for cira.

Getting Started

You can get started fast by using the cira-group boilerplate. If you are new to cira checkout the tutorial.

Installation

You can install it using pip.

pip install cira

Usage

Since the Alpaca trade API need a API key, you need to generate your own key at alpaca markets website. If you want to play around with it you can try paper trading (recommended for beginners). I recommend keep it in a JSON file which cira needs the path to. You can also set the variables directly or use an environment variable, see the wiki for diffrent the ways. However, it is recommended that you store it in a file just make sure not to upload that file on any public repositories.
key.json

{
  "APCA-API-KEY-ID":"your_pub_key",
  "APCA-API-SECRET-KEY":"your_private_key"
}

then you can start using the lib

import cira
cira.alpaca.KEY_FILE = "../mypath/key.json"
stock = cira.Stock("TSLA")
stock.buy(1)
stock.sell(1)

New classes with cira v.2!

portfolio = cira.Portfolio() # methods for your portfolio
exchange = cira.Exchange() # methods for exchange
stock = cira.Stock("TSLA") # a class for one stock

A simple algorithm

In just a couple of lines you are up and running, with a super simple algorithm.

import cira
import random
import time

cira.alpaca.KEY_FILE = "../mypath/key.json"

portfolio = cira.Portfolio()
exchange = cira.Exchange()

qty = 1 # choose how many stocks should be handled in one session 
while True:
    while exchange.is_open:
        for stock in random.choices(exchange.stocks, k=qty):
            stock.buy(1)
        for stock in random.choices(portfolio.owned_stocks, k=qty):
            stock.sell(1)
        time.sleep(60*30) # 30 min timer    

you can find more examples on the wiki/examples and the wiki/tutorial for even more information.

Things to checkout

Wiki and docs

To see what more you can do check out the wiki.

I also have an example of how to build a index fund trader with cira.

Want the old version?

For backwards compatibility I made sure to fork cira in to cira-classic and cira-classic is also available on pypi with pip.

if you find bug plz let me know with a issue. If you know how to solve the problem then you can of course make a pull request and I will take a look at it.

Have a question?

If you have a question about cira, want to share what you built with cira or want to talk to others using cira, you can checkout the discussions page or make issue if that is more fitting.

History of cira

I was interested in using the Alpaca trade API for building a quantitative paper trader. The project is available here.
However after working on this for alomst a year (off and on) I realized that I had alomst build a small library for using the Alpaca API. So I thought that I would make this into a real library so that you can get started with quantitative paper trading as well.

Development

If you want to help develop cira you are more then welcome to do so. Feel free to make a pull request or issue. To install cira with all the dev req.

git clone [email protected]:AxelGard/cira.git
cd cira/
git checkout develop

and know you need to

python3 -m venv env
source env/bin/activate
pip install -e .

Run tests using pytest. Ensure that you are in the cira dir. But you will need a new key. This key should not only be used for testing or if you don't mind if all of the assets in the portfolio being sold.

touch tests/test_key.json
pytest

Coding style

I'm trying to follow the pep8 standard notation. I try to make the library to be so intuitive as possible for easy of use.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].