Trading View Automation
  • Introduction
  • Setting Up Local Server
    • Setting Up HashiCorp Vault + EthSigner
    • Setting Up HashiCorp Vault (dev) + EthSigner
  • Setting Up Google Cloud Run
    • Setting Up Google KMS
  • Setting Up Heroku
  • Setting Up Env Vars
  • Setting Up Trading View Alert
  • Testing With sendAlert.js
  • Setting Up Google Sheets
  • Setting Up Telegram Notifications
  • Using Tmux
  • Using Git
Powered by GitBook
On this page
  • Setup
  • Test Setup

Setting Up Heroku

PreviousSetting Up Google KMSNextSetting Up Env Vars

Last updated 6 months ago

Heroku is a free cloud server where you can easily deploy a NodeJS Express App. When you create a project on Heroku, you will be given a git URL where you can push the server files to. The Heroku backend will run "npm install" to build the NodeJS Express App and then run "npm run start", thus deploying your App. Heroku will also provide you a https url that can be used as the webhook URL in your Trading View alert.

Setup

  1. Download files from the Github repository to your computer

    1. Sign up for a Github account

    2. Install Git ()

    3. Establish authentication to Github API

      • Windows

        1. download VSCode

        2. download the Github Pull Requests Extension

        3. Click Accounts (bottom left) > sign in with Github

      • MacOS

        1. Use VSCode, as above

        2. Alternatively, use a Personal Access Token

          1. Log into Github > Profile photo (top right) > Settings > Developer Settings (left menu, scroll down) > Personal access tokens > Tokens (classic) > Generate new token (top right) > Generate a new token (classic)

          2. Give name, expiration date, and scopes (for scopes, click "repo" checkbox)

          3. Click Generate token

          4. When you run git clone (Step 1.4), it will ask for a username and password. Use your Github username. For password, use the generated token.

          5. Cache token with git config --global credential.helper osxkeychain

            1. view cached credentials with echo url=https://github.com/git/git.git | git credential fill

    4. In your CLI, cd into where you want the “trading-view-automation” folder downloaded, then run git clone

  2. Upload files to Heroku

    1. Create a Heroku account

    2. Create a new app on Heroku

      1. Go to New (top right) > Create new app

      2. Enter a name, choose region, and click Create app

    3. Install the Heroku CLI ()

      1. verify installation with heroku --version

      2. heroku update // updates heroku CLI

      3. heroku login

        1. press any key to continue

        2. Web browser should popup prompting login

    4. cd into the "trading-view-automation" folder

    5. git remote add heroku https://git.heroku.com/example-app.git // adds a remote labeled "heroku", which is an alias for the url

      • find the https url in the your Heroku account > project page > Settings tab (top center). Look in the App Information category for the Heroku git URL

      • git remote -v // check if remote is added

    6. push files to Heroku git URL with git push heroku main

      1. macOS may show a prompt for additional authentication. If so, type "blank" into username field and enter API Key into the password field. You can generate API Key withheroku auth:token

    7. Code is uploaded if you see various logs appearing for 10-15s

  3. Set environment variables

    1. In your Heroku account, go to Settings > Config Vars > click Reveal Config Vars

    2. Enter the environment variables detailed in

  4. Copy the app URL and use it as the webhook URL in your or

    • URL is located in your Heroku account > project page > Settings > scroll down to Domains. It looks like

  5. To view logs, go to More (top right) > View logs

  6. Every time you need to update the Heroku remote

    1. git pull origin main // this pulls changes from Github repository

    2. git push heroku main // this pushes changes to the Heroku repository

  7. Set up Google Sheets to see successful or failed trades (see )

  8. Set up Telegram to see successful or failed trades (see )

Test Setup

Send a T or mimic one using . Use the provided Heroku HTTPS URL (see Step 1.4) as the webhook URL.

https://www.git-scm.com/downloads
https://github.com/brianonchain/trading-view-automation.git
link
Setting Up Env Vars
Trading View alert
sendAlert.js
https://tv-test-2-fdfas8b39b.herokuapp.com/
Setting Up Google Sheets
Setting up Telegram
rading View alert
sendAlert.js