Skip to content

Instantly share code, notes, and snippets.

@boxxa
Forked from tranzium/autoview-syntax.txt
Last active November 13, 2015 16:57
Show Gist options
  • Save boxxa/1045db58e411489809f0 to your computer and use it in GitHub Desktop.
Save boxxa/1045db58e411489809f0 to your computer and use it in GitHub Desktop.
TradingView can now become automated trading.
---------- Usage
The syntax created by these parameters is placed in an alert's description on Trading View
to be utilized by the AutoView Chrome Extension.
TradingView: https://www.tradingview.com/
AutoView: https://chrome.google.com/webstore/detail/autoview/okdhadoplaoehmeldlpakhpekjcpljmb
---------- Syntax
<letter>=<value>
<letter>=<value> <letter>=<value>...
---------- Parameters
Alias ? type default values
book b string <all> ask, bid, long, short
cancel/close c string n/a order, position
disabled d boolean 0 0, 1
leverage l integer <all> >= 0
price p decimal 0 min(-max), min%(-max%)
quantity q decimal 100% min(-max), min%(-max%)
stoploss sl integer n/a # of price interest points (pips)
order type t string limit close, limit, market, open
take profit tp integer n/a # of price interest points (pips)
yield y string balance balance, equity
-- Override
exchange e string <symbol> 1BROKER, OKCOIN
symbol s string <symbol> BTCCNY, GBPNZD, LTCUSD3M, ...
--OKCoin
closeorder co string none type of close with trigger/trail for downward pyramiding
---------- Examples
-- Place a 5 contract market order at the top price
b=long l=10 q=5 t=market
-- Place a short at an undercut of $0.05
b=short p=-0.05 l=10 q=1 t=limit
-- Place a long of 1-10 contracts, between the top price and an undercut of $1
b=long p=0--1 l=10 q=1-10 t=limit
NOTE: The above examples are for Alerts placed on a futures symbol (e.g. BTCUSD1W)
---------- Notes
PERCENTAGES: Will automatically be converted to a decimal (i.e. / 100).
e.g. 20% = 0.2
e.g. 115% = 1.15
PRICE: When using percentages, the calculation will be based directly off the top value.
e.g. $300 * 50% = $150
e.g. undercut @ 95%: $300 * 0.95 = $285
e.g. overcut @ 105%: $300 * 1.05 = $315
QUANTITY: When using percentages, the calculation will be based off your available contracts.
i.e. available_balance * leverage / per_contract
e.g. 1.75 * 20 / ($100 / $300) = 11
e.g. 11 * 75% = 8
ORDER TYPE: [limit, market] apply to both opening orders and closing positions.
[close] applies to position closing orders.
[open] applies to canceling open orders.
e.g. Cancel all open orders: c=order t=open
e.g. Cancel all position closing orders: c=order t=close
e.g. Cancel all orders: c=order
SYMBOL: Until more Forex exchanges are implemented, FX symbols will default to 1Broker.
YIELD (OKCOIN): [balance] will use your available balance in calculations
[equity] will use your entire account balance in calculations
-- Using [equity] may cause orders to fail due to calculated contract quantity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment