GithubHelp home page GithubHelp logo

ajrj / add-tradingview-alerts-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alleyway/add-tradingview-alerts-tool

0.0 0.0 0.0 16.27 MB

Bulk-add alerts to TradingView (designed for 3Commas TV alert integration)

License: MIT License

TypeScript 86.82% Shell 0.32% JavaScript 12.86%

add-tradingview-alerts-tool's Introduction

We are working on a service that would completely automate this tool!

Register your interest as a beta tester at tradingview-alerts-manager.com

Add TradingView Alerts Tool

Automatically adds custom alerts to TradingView in bulk

Why This Project Exists

Trading platforms (such as 3Commas and Alertatron) allow automated trades based on custom TradingView alerts which can be pinged using webhook URLs to execute trades.

When using a TradingView indicator (such as Material Indicators), you can send signals to your trading bot using TradingView alerts

So what if you want to use an indicator to trade across dozens or hundreds of pairs? Because there is no TradingView API to add alerts in bulk, you'd need to maintain those alerts by hand.

How does this tool work?

Using open source software designed for automated website testing, we can enter as many custom alerts as your TradingView account allows. It installs its very own Chrome browser (called Chromium) which is controlled by this script.

Watch as this tool enters your TradingView alerts automatically.

demo video of tool

Requirements

MacOS/Windows/Linux

Install NodeJS (minimum version: 14.15.0)

Installation

Open Terminal/PowerShell and run the following:

# make sure you're running at least node version 14.15.0
node -v 

# create your tradingview-alerts-home directory
npx @alleyway/create-tradingview-alerts-home

# Follow prompts to initialize your tradingview-alerts-home

Edit your config.yml file (if you're passing signals for automated trading such as 3commas, configure those details here)

files:
  input: binance_usdt_pairs.csv
  exclude: blacklist.csv
tradingview:
  # The chart which has the indicator you'd like to use
  chartUrl: https://www.tradingview.com/chart/WS5uK1l5/
  # (optional) set the chart interval before adding pairs, otherwise interval of last saved chart is used
  # examples: 1s | 30s | 1m | 15m | 1h | 1D | 1M
  interval: 4h
  # Optionally supply login details or login manually once and restart script
  #username: 
  #password: 
alert:
  condition:
    primaryLeft: MTF Deviation
    primaryRight:
    secondary: Tier1 long
    tertiaryLeft:
    tertiaryRight:
  option: Once Per Bar Close
  actions:
    notifyOnApp: false
    showPopup: false
    sendEmail: false
    webhook:
      enabled: true
      url: "https://3commas.io/trade_signal/trading_view"
  # alert name is optional - can override in csv if desired and use {{symbol|base|quote}}
  # name: MI dev3 for {{base}} {{quote}}
  # indentation matters! {{quote}} and {{base}} are swapped out for quote asset(eg. USDT) and the base (eg. BTC)
  message: >
    {
        "message_type": "bot",
        "bot_id": 999999,
        "email_token": "fffffff-fffff-fffff-ffff-ffffffffff",
        "delay_seconds": 0,
        "pair": "{{quote}}_{{base}}"
    }

Fields corresponding to configuration

Fetching Trading Pairs

Creates CSV file for use as input (see above config) for supported exchanges. Want other exchanges? File an issue!)

Download Trading Pairs From Binance/BinanceUS

This command downloads all USDT trading pairs for Binance:

    npx atat fetch-pairs binance usdt
    
    # Creates binance_usdt_pairs.csv    

This command downloads all trading pairs for BinanceUS:

    npx atat fetch-pairs binanceus all

    # Creates binanceus_all_pairs.csv

Download Trading Pairs From FTX

In addition to fetching all/btc/usd/usdt/etc, you may also fetch perpetual contracts by specifying "perp"

    npx atat fetch-pairs ftx perp

    # Creates ftx_perp_pairs.csv

Download Trading Pairs From Coinbase

    npx atat fetch-pairs coinbase usd

    # Creates coinbase_usd_pairs.csv

Download Trading Pairs From Bittrex

    npx atat fetch-pairs bittrex btc

    # Creates bittrex_btc_pairs.csv

...and so on..

Adding TradingView Alerts

Before you run the script

When adding alerts TradingView uses your last settings as defaults for new alerts. If not explicitly set in the config.yml file, it will use the settings from the last alert made. So if you prefer to play a sound or not, create an alert with that setting before running the script.

You must actually create an alert once with those options, before they become defaults. (You can immediately delete the alert)

Running the script

NOTE: You'll need to log into TradingView the first time you run the script, then you'll need to close the browser and re-run the command

npx atat add-alerts

You can stop the script in Terminal/PowerShell by pressing Ctrl-C

If the tool gets interrupted for some reason, you can remove the rows of already-added alert symbols (from the .csv) and re-run

Troubleshooting

Moving too fast for your connection speed? Try adjusting the delay option (default is 1000)

npx atat --delay 1500 add-alerts 

Anything else? File an issue

Advanced Usage

Multiple Configurations

A configured TradingView Indicator that works for assets quoted in BTC may not be appropriate for USD pairs, therefore, you'll want to segment your setup as follows:

Abstract Concretely
List of pairs quoted only in BTC Run "npx atat fetch-pairs binance btc"
input: binance_usdt_pairs.csv
TradingView chart layout with an indicator tailored specific to BTC (eg. set 6% for deviation on MTF deviation) chartUrl: https://www.tradingview.com/chart/WS5uK1l5/
3commas trading bot to handle only BTC {
"message_type": "bot",
"bot_id": 999999,
"email_token": "fffffff-fffff-fffff-ffff-ffffffffff",
"delay_seconds": 0,
"pair": "{{quote}}_{{base}}"
}
A dedicated configuration file for the above npx atat add-alerts config.btc.yml

NOTE: running "npx atat add-alerts" will default to config.yml unless you specify one (eg. "npx atat add-alerts config.btc.yml")

Send a single alert to multiple bots(or use multiple commands)

3commas will allow you to use an array of commands in the message, I typically send a message to two bots: one for paper trading, and another "real" account which I can choose to disable.

So you can use a JSON array for the message:

  message: >
    [{
        "message_type": "bot",
        "bot_id": 999999,
        "email_token": "fffffff-fffff-fffff-ffff-ffffffffff",
        "delay_seconds": 0,
        "pair": "{{quote}}_{{base}}"
    },
    {
        "message_type": "bot",
        "bot_id": 999999,
        "email_token": "fffffff-fffff-fffff-ffff-ffffffffff",
        "delay_seconds": 0,
        "pair": "{{quote}}_{{base}}"
    }]

Send an alert to Alertatron

This works in the same way as for 3Commas, but Alertatron using a different format for its messages. For example...

  message: >
    binanceKeys({{quote}}_{{base}}) {
        market(side=buy, amount=50%);
        stopOrder(side=sell, amount=100%p, offset=2%);
        limit(side=sell, amount=100%p, offset=3%);
    }

Donations

Not necessary, but motivating to keep the project up to date

Send ETH to

0x37f79c0bAC4068a56E36694c5F5d8853F54022cb

Developer Notes

Install xpath generator

Publishing

Beta Testing

Create a beta release:

npm run release-beta

Ask a user to run the following:

npm install @alleyway/add-tradingview-alerts-tool@beta

Stable Release

npm run release
./deploy_master.sh

Stable Release (create-tradingview-alerts-home)

create-tradingview-alerts-home$ npm publish

add-tradingview-alerts-tool's People

Contributors

imerkle avatar instabot42 avatar mlake 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.