Coder Social home page Coder Social logo

cryptomiron / captnhook Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkaladi/captnhook

0.0 0.0 0.0 289 KB

Server that allows users to place trades with tradingview's webhook alerts.

License: MIT License

Shell 2.30% Go 95.51% Dockerfile 2.19%

captnhook's Introduction

pirate

captnHook allows users to place trades with Tradingview's webhook alerts. The server is configurable to the most popular broker APIs (Alpaca, Binance, Coinbase, many more)


Website Coming Soon



Directories

  • cert A folder for housing a self-signed X.509 TLS certificate
  • cmd Main application for this project
  • docs Design and user documents
  • pkg Library code used by the main command

Installation

Clone the project to your machine

$ https://github.com/bareish/captnhook.git

Environment Variables

Copy the contents of .env.example and create a .env file from the contents - Then, fill in credentials that are required.

$ touch .env
$ cp .env.example .env

Directory tree should look as such:

  ├── .env
  ├── .env.example
  ├── Dockerfile
  ├── README.md
  ├── cmd
  ├── pkg
  ├── cert
  │   ├── cert.pem
  │   └── key.pem

Dotenv Example

# general configuration
MODE = dev  # can be dev/prod
BASE_URL=https://0.0.0.0
PORT=8000

# Path to self-signed X.509 TLS certificate
CERT_PATH=./cert/cert.pem
KEY_PATH=./cert/key.pem


# Alpaca Credentials
ALPACA_CLIENT_ID=nicetrygithubscraper
ALPACA_CLIENT_SECRET=nicetrygithubscraper
ALPACA_ACCOUNT_TYPE=Paper

#Binance Credentials
BINANCE_CLIENT_ID=nictrygithubscraper

Running locally

As simple as one command :)

$ docker-compose up

Output should look as such:

Successfully tagged captnhook_api:latest
Recreating captnhook_api ... done
Attaching to captnhook_api
api_1  |
api_1  |    ____    __
api_1  |   / __/___/ / ___
api_1  |  / _// __/ _ \/ _ \
api_1  | /___/\__/_//_/\___/ v4.2.0
api_1  | High performance, minimalist Go web framework
api_1  | https://echo.labstack.com
api_1  | ______________________________________________
api_1  |                                     
api_1  |http server started on [::]:8000

Webhook Settings

  1. Let's create a new alert in TradingView

Alert

  1. You can set the condition of the alert to whatever you want

Conditions

  1. Check the Webhook URL box and set it to your domain.

Hook

  1. Format your message as JSON, so the server can recognize it

JSON

Example:

{
  "ticker" : "{{ticker}}", 
  "price" : "{{close}}",
  "action": "Buy" 
}

📝 License

By contributing, you agree that your contributions will be licensed under its MIT License.

In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.

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.