Skip to content

Latest commit

 

History

History
168 lines (105 loc) · 3.21 KB

INSTALL.md

File metadata and controls

168 lines (105 loc) · 3.21 KB

Project Setup

Functions Setup

Firebase

Signup for Firebase

Clone

git clone https://github.com/balupton/automated-trading.git
cd automated-trading

Setup

nvm use
npm run login
npm run setup
npm run deploy

Account Creation

# create a user and get its id
http -f POST https://VALUE.cloudfunctions.net/createUser \
    email='VALUE'


# get bitfinex serviceid, use your bitfinex API details
http -f POST https://VALUE.cloudfunctions.net/bitfinex_createService \
    atuserid='VALUE' \
    key='VALUE' \
    secret='VALUE'


# get itbit serviceid, use your itbit API details
http -f POST https://VALUE.cloudfunctions.net/itbit_createService \
    atuserid='VALUE' \
    userid='VALUE' \
    key='VALUE' \
    secret='VALUE'

# verify itbit
http -f POST https://VALUE.cloudfunctions.net/itbit_fetchWallets \
    atuserid='VALUE' \
    atserviceid='VALUE'


# get drivewealth serviceid, use your drivewealth login details
http -f POST https://VALUE.cloudfunctions.net/drivewealth_createService \
    atuserid='VALUE' \
    username='VALUE' \
    password='VALUE'

# initialise drivewealth session
http -f POST https://VALUE.cloudfunctions.net/drivewealth_createSession \
    atuserid='VALUE' \
    atserviceid='VALUE'


# remove the above commands from fish shell history
history clear

# remove the above commands from bash shell history
rm ~/.bash_history

Twilio

TwiML Bins

Create the following TwiML Bins

Reject

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Reject reason="busy" />
</Response>

Nothing

<?xml version="1.0" encoding="UTF-8"?>
<Response></Response>

Number

Create a number and configure it like so:

== Voice & Fax ==

Accept incoming: Voice Calls

Configure with: Webhooks, or TwiML Bins or Functions

A call comes in: TwiML: nothing

Primary handler fails: TwiML: reject

Caller name lookup: disabled


== Messaging ==

Configuare with: Webhooks, or TwiML Bins or Functions

A message comes in:
Webhook: https://VALUE.cloudfunctions.net/parse?atuserid=VALUE
HTTP POST

Primary handler fails: TwiML: reject

Trading View

Phone Number

Configure your Trading View phone numnber to be your Twilio one.

Add Strategies

Create a strategy and add its accompanying study. You need to add an accompanying study in order to link up alerts. As strategies for some silly reason cannot create alerts.

You can strategies in the tradingview directory.

Alerts

When you've made your strategy, then create alerts for it. Use the "SMS" feature, and the appropriate message from the following:

Buy Stock Message

{"atmarket": "stock", "call": "order", "symbol": "TSLA", "action": "buy"}

Sell Stock Message

{"atmarket": "stock", "call": "order", "symbol": "TSLA", "action": "sell"}

Buy Crypto Message

{"atmarket": "cryptocurrency", "call": "order", "symbol": "BTCUSD", "action": "buy"}

Sell Crypto Message

{"atmarket": "cryptocurrency", "call": "order", "symbol": "BTCUSD", "action": "sell"}