Git Product home page Git Product logo

pi-trader-24x7's Introduction

Pi-Trader-24X7

I am trying to make a trading bot on Raspberry Pi 4 using Alpaca trading API from scratch and later implement some profitable trading strategies to make little money. My objective is to trade in different time zone markets without actually logging to the trading workstation. In this case I am trading in US stock exchange market.

Installation

To start, make a account on Alpaca trading, you dont need to make Live trading account for testing purposes you can try paper trading. In this programme I am currently using Paper Trading API.

Clone this repository:

git clone https://github.com/Adiboy3112/Pi-Trader-24X7.git

Change directory

cd Pi-Trader-24X7

Generate your API keys

In the cloned Repository make newfile keys.txt add your API keys in this format:

API_KEY_ID=<your API KEY ID>
API_SECRET_KEY=<your API SECRET KEY>
BASE_URL=https://paper-api.alpaca.markets

NOTE: Change BASE_URL for Live Trading

NOTE: Don't leave a space after "=" sign

You can change your stocks of interest here in main.py:

stocks_list = ["AAPL", "MSFT","TSLA"]

Now to start add your trading strategy for the day in main.py:

def trading_strategy(api, stock):

Now to get started start a screen session:

screen -S <name-your-session>

Now run the startup script:

./start-trading.sh

To detach from this screen press CTRL+A then CTRL+D

Now to again reattach to this session to check status:

screen -r <name-your-session>

There are many helper functions in tools.py use them according to your need.

Deployment Demo

I deployed the programme on Raspberry Pi 4 and kept the programme running finally when it was trading hrs. My orders were placed from my stock list without logging into the workstation





Detached from the session:





Reatached from my Mobile Termux App:



pi-trader-24x7's People

Contributors

adiboy3112 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.