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

Setting Up Google Cloud Run

PreviousSetting Up HashiCorp Vault (dev) + EthSignerNextSetting Up Google KMS

Last updated 6 months ago

  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

        4. All Git commands need to be done in VSCode's in-built terminal

      • 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")

          3. Click Generate token

          4. When you run git clone (Step 2), it will ask for 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 https://github.com/brianonchain/trading-view-automation.git

      1. Prompt will pop up > login with browser

      2. After the credentials are confirmed, the folder containing the files will downloaded

      3. Repo is only downloadable if you are invited as a collaborator to the private repo

  2. Upload files to Google Cloud Run

    1. Sign up an account on Google Cloud Platform

    2. Create a billing account

    3. Create a project

    4. Install the Google Cloud CLI, takes ~10 minutes ()

    5. In your CLI:

      1. cd into the “trading-view-automation” folder you created in Step 1.3.4

      2. gcloud init

        1. Enter 1 for "Re-initialize this configuration [default] with new settings"

        2. Login with your Google username/password

        3. Select the project you created in Step 2.3

      3. gcloud run deploy --source .

        1. For the Service name, press Enter to use the default name ("trading-view-automation")

        2. enter y to enable APIs

        3. Choose region

        4. Enter y to allow unauthenticated invocations

        5. Wait ~5 minutes for files to build & upload

  3. Enter your environment variables

    1. Select your project in Google Cloud

    2. Click the menu (top left) > Cloud Run > click the trading-view-automation Service

    3. Click EDIT & DEPLOY NEW REVISION (top)

    4. Under Edit Container, click VARIABLES & SECRETS and enter environment variables (see )

    5. For better security, you can use Google Secrets Manager. For the best security, you can use Google Key Management Service (see )

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

    • URL is located in menu (top left) > Cloud Run > click the trading-view-automation Service > see top-middle of page (it looks like )

  5. If you need to update the Cloud Run code

    1. cd into "trading-view-automation folder", ensure you are on "main" branch, run git pull

    2. Follow Step 2.5.3

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

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

Test Setup

Send a 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://cloud.google.com/sdk/docs/install
Setting Up Env Vars
Setting Up Google KMS
Trading View alert
sendAlert.js
https://dev-b3gfgsdfs3a-de.a.run.app
Setting Up Google Sheets
Setting up Telegram
Trading View alert
sendAlert.js