Differences

This shows you the differences between two versions of the page.

Link to this comparison view

syntax-setup [2018/11/28 14:48] (current)
profitview created
Line 1: Line 1:
 +~~Title: Syntax Setup ~~
 +{{tag>​guides}}
 +<​page-header>​
 +==== How to setup a syntax in ProfitView & TradingView ====
 +</​page-header>​
 +The syntax alert goes straight into the ProfitView GUI. {{:​syntax:​syntax_setup.png?​nolink&​110|}}
 +\\
 +Use alert name as first line in "​Message"​ field on TradingView (Alt + A).
  
 +**Please change the alert condition accordingly**.
 +\\
 +\\
 +<alert type="​warning"​ icon="​fa fa-bullhorn">​It is always recommend to paper trade first!</​alert>​
 +
 +<​accordion>​
 +<panel title="​Long/​Buy Signal"​ icon="​fa fa-bar-chart">​
 +<​file>#​ LONG XBTUSD
 +c=order t=open
 +c=position b=short t=market
 +c=position b=short t=market
 +delay=3
 +b=long l=25 q=50% t=market err=-1
 +delay=5
 +b=long c=position q=300% sl=-2.5% t=market r=1 ret=1 err=-2
 +b=long c=position q=300% tp=0% p=1.3% r=1 ret=1 err=-2
 +</​file>​
 +''​q= l= sl= p= needs to be adjusted to your needs''​
 +----
 +{{ :​syntax:​syntax_long.png?​nolink |}}
 +----
 +=== Syntax Explanation ===
 +^Command ​  ​^Description ​  ​^ ​
 +| c=order t=open | close open orders |
 +| c=position b=short t=market | close open shorts @ market |
 +| c=position b=short t=market | safety |
 +| delay=3 | 3 seconds delay. |
 +| b=long l=10 q=50% t=market | open market long 50% @ 10x |
 +| delay=5 | 5 seconds delay. |
 +| b=long c=position q=300% sl=-2.5% t=market r=1 ret=1 err=-2 | fixed stop loss @ 2.5% below current price. expect to place an order, otherwise close all & abort | 
 +| b=long c=position q=300% tp=0% p=1.3% r=1 ret=1 err=-2 | fixed take profit @ 1.3% above current price. expect to place an order, otherwise close all & abort | 
 +</​panel>​
 +
 +<panel title="​Short/​Sell Signal"​ icon="​fa fa-bar-chart">​
 +<​file>#​ SHORT XBTUSD
 +c=order t=open
 +c=position b=long t=market
 +c=position b=long t=market
 +delay=3
 +b=short l=25 q=50% t=market err=-1
 +delay=5
 +b=short c=position q=300% sl=2.5% t=market r=1 ret=1 err=-2
 +b=short c=position q=300% tp=0% p=-1.3% r=1 ret=1 err=-2
 +</​file>​
 +''​q= l= sl= p= needs to be adjusted to your needs''​
 +----
 +{{ :​syntax:​syntax_short.png?​nolink |}}
 +----
 +=== Syntax Explanation ===
 +^Command ​  ​^Description ​  ​^ ​
 +| c=order t=open | close open orders |
 +| c=position b=long t=market | close open longs @ market |
 +| c=position b=long t=market | safety |
 +| delay=3 | 3 seconds delay. |
 +| b=short l=10 q=50% t=market | open market short 50% @ 10 |
 +| delay=5 | 5 seconds delay. |
 +| b=short c=position q=300% sl=2.5% t=market r=1 ret=1 err=-2 | fixed stop loss @ 2.5% above current price. expect to place an order, otherwise close all & abort | 
 +| b=short c=position q=300% tp=0% p=-1.3% r=1 ret=1 err=-2 | fixed stop loss @ 1.3% above current price. expect to place an order, otherwise close all & abort | 
 +</​panel>​
 +
 +\\
 +<panel title="​Available Commands"​ icon="​fa fa-align-justify">​
 +<​datatables header-rows="​true">​
 +^Name   ​^Key ​  ​^Default ​  ​^Values ​  ​^Description ​  ^
 +| Account | a | * | Anything (excluding special characters) | The account name of the API key you want to use for this command. |
 +| Book | b | all | buy, long; sell, short | The side of the market you would like to place your order. |
 +| Cancel / Close | c | n/a | order, position | Cancel open orders or close open positions according to other specified parameters. |
 +| Cancel / Close Maximum | cm | all | Static: #, %Random: #-#, %-% | Cancels orders or closes positions (see cmo for ordering). |
 +| Cancel / Close Maximum Order | cmo | oldest | newest, oldest; lowest, highest; smallest, biggest; random | How the orders are sorted for canceling. How the positions are sorted for closing. |
 +| Delay | delay | n/a | > 0 | Pauses execution between previous and this command (line) for the specified time (e.g. delay=10). |
 +| Disabled | d | 0 | 0, 1 | Disables placement or cancelation/​closing of orders/​positions.This is helpful for debugging by outputting the calculated parameters to be used. |
 +| Exchange | e | Exchange Name from Alert | BitMEX, Binance, ... | The receiving exchange for your command. |
 +| Fixed Price | fp | n/a | Static: # Random: #-# | Fixed price for which to place an order or close a position. |
 +| Hidden / Iceberg | h | n/a | Static: #, % Random: #-#, %-% | Bitfinex: Whether the order should be hidden (i.e. h=1). BitMEX: If set to 0, order will be hidden. Otherwise this portion of the position will be visible (i.e. Iceberg). |
 +| Leverage | l | all | >= 0 | Leverage, multiplying your available balance while increasing risk (!). |
 +| Linking Identifier | lid | n/a | Anything | BitMEX: Create an order that is part of this linking identifier. To be used when oco, oto, ouoa, or ouop are not set explicitly. |
 +| One Cancels the Other | oco | n/a | Anything | BitMEX: The first order that fully or partially executes (or activates for Stop orders) will cancel all other orders with the same linking identifier. |
 +| One Triggers the Other | oto | n/a | Anything | BitMEX: Apply on the primary order and then subsequent orders with the same identifier will not be triggered until the primary order fully executes. |
 +| One Updates the Other Absolute | ouoa | n/a | Anything | BitMEX: As one order has an execution, other orders with the same linking identifier will have their order quantity amended down by the execution quantity. |
 +| One Updates the Other Proportional | ouop | n/a | Anything | BitMEX: As one order has an execution, other orders with the same linking identifier will have their order quantity reduced proportionally by the fill percentage. |
 +| Price | p | 0 | Static: #, % Random: #-#, %-% | Amount to undercut or overcut the top order in the book - either by percentage or absolute price! |
 +| Quantity | q | 100% | Static: #, % Random: #-#, %-% | The portion of your balance or position (!) you would like to effect. |
 +| Reduce | r | 0 | 0, 1 | BitMEX: Place order as "​reduce only" |
 +| Symbol | s | Chart Symbol from Alert | XBTU18, ETHEUR, ... | Market on the receiving exchange to be used for this command. |
 +| Stop Loss | sl | n/a | Static: #, % Random: #-#, %-% | Bitfinex: Whether the order is a stop order (i.e. sl=1) 1Broker, Binance, BitMEX: Provided value is applied to the position'​s entry price. Kraken: Triggers the order (buy or sell) when the last traded price hits the stop price. |
 +| Shared | shared | 0 | 0, 1 | 1Broker: Whether or not the trade will be visible to others. |
 +| Order Type | t | limit | limit, market, fok, ioc, post, close, open, settle | close, open, settle Limit:​ Order will be placed in the books to await being filled. Market: Place order in the book for immediate filling (p is ignored). FOK: Fill Or Kill orders will either completely fill or be aborted. IOC: Immediate Or Cancel orders can be partially or completely filled, but any remaining portion is cancelled. Post: If any part of the order would have executed, it will be cancelled instead. Close / Open: Can be used together with c=order for specific order types. Settle (Kraken only): Settle position(s) at the original order price. Learn more |
 +| Take Profit | tp | n/a | Static: #, % Random: #-#, %-% | 1Broker, Binance, BitMEX: Provided value is applied to the position'​s entry price. Kraken: Triggers the order (buy or sell) when the last price hits the profit price. |
 +| Trailing Stop | ts | n/a | Static: #, % Random: #-#, %-% | 1Broker: Whether the position has a trailing stop loss (i.e. disabled ts=0, enabled ts=1) Bitfinex: Whether the order is a trailing stop (i.e. ts=1) Kraken: Triggers a market order (buy or sell) when the last traded price goes against the position by the stop offset amount. |
 +| Unit | u | contracts | contracts, currency | Unit to be used for the provided quantity (q) parameter. |
 +| Yield | y | balance | balance, equity | Balance: Your available balance excluding open orders/​positions. Equity: Grand total including all profit and loss. |
 +</​datatables>​
 +</​panel>​
 +</​accordion>​
 +<callout type="​warning"​ icon="​true">​
 +=== Attention ===
 +Always double check that you are using the right syntax/​alert!
 +</​callout>​