Skip to content

Python code for multiple trade order entries triggered from Tradingview alerts passing a JSON payload to the Alpaca Broker API

Notifications You must be signed in to change notification settings

jasona7/alpacaTrading

Repository files navigation

Welcome to alpacaTrading 👋

Automated Alpaca Trading API Order entry

Version

Python bracket order for alpaca order api

Screenshot

Requirements

Usage

app.py Edit the limit_price and stop_price variabes to set a gain/loss limit for orders (ex. below 5% gain, and 2% stop loss)

"take_profit": {
            "limit_price": webhook_message['close'] * 1.05
        },
        "stop_loss": {
            "stop_price": webhook_message['close'] * 0.98,
        }

TradingView Alert JSON BODY

{
    "open": {{open}},
    "high": {{high}},
    "low": {{low}},
    "close": {{close}},
    "exchange": "{{exchange}}",
    "ticker": "{{ticker}}",
    "volume": {{volume}},
    "time": "{{time}}",
    "timenow": "{{timenow}}"
}

Author

👤 Jason Alloway

Show your support

PLZ give a ⭐️ if this code was helpful!


This README was generated with ❤️ by readme-md-generator

About

Python code for multiple trade order entries triggered from Tradingview alerts passing a JSON payload to the Alpaca Broker API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages