Welcome to the Tradovate command examples page.
Here you will find some Commands/Parameters that can help you start trading in Tradovate with Autoview.
Keep in mind that most of these can be done using the handy Syntax Builder!
If this article is missing something you feel should be added, feel free to make a suggestion under this page so we can add it for future reference.
Error: Symbol is inaccessible
Tradovate has restrictions on price data, usually requiring a subscription.
Using fixed parameters, like fp=
,fpx=
, fsl=
, and ftp=
, which use exact prices, avoid needing to fetch the current price.
When closing positions, adding ps=position
bases all of the prices off of your position's average, rather than attempting to fetch the current price.
Parameters
Here we will cover some of the Parameters that we will be using to set up some basic trades for Tradovate using Autoview.
Account Identifier [aid=]
aid=
is used to select which sub-account to use internally.
Tradovate runs all accounts under one API key. When using this parameter, be sure to include your sub-account name in the syntax to select it.
aid=subaccount2312
Exchange [e=]
Used for pinpointing what exchange you are trading on. In this case you have 2 options.
Tradovate and Tradovate Simulation.
Use Tradovate for live trades and Tradovate Simulation to test your trading strategies before entering a live market.
e=tradovate
e=tradovatesim
Symbol [s=]
"s=" is used whenever you are referencing an asset you want to trade. This symbol can be copied from the website to ensure you are getting the proper asset you want.
s=ZNH2
s=ESH2
s=MSFT
Book [b=]
Standard Buy, Sell, Long and Short options.
b=buy (Spot Trading)
b=sell (Spot Trading)
b=long (Margin Trading)
b=short (Margin Trading)
Cancel and Close All [c=all]
c=all
Order Price [p=]
The amount to undercut (negative) or overcut (positive) the top order of the book.
When using this, enter the appropriate amount for the asset you are trading.
In some cases you may see a negative input [Ex: p=-1%]. It is only relevant to your take profit, as a negative, when closing a short position.
p=20% (Price based off a percentage)
p=120 (Price based off of a number)
b=buy p=-1% (Place buy 1% below the current price)
b=sell p=20 (Place sell $20 above the current price)
Quantity [q=]
The portion of your wallet balance or position you would like to effect.
q=10% (Price based off a percentage)
q=50 (Price based off of a number)
Order Type [t=]
There are Various order types that can be used within your command to select what type of trade you want.
t=limit (Limit: Order will be placed in the books to await being filled)
t=market (Market: Place order in the book for immediate filling (p
is ignored)
t=fok (FOK: Fill Or Kill orders will either completely fill or be aborted)
t=ioc (IOC Immediate Or Cancel orders can be partially or completely filled, but any remaining portion is cancelled.
One Cancels the Other [oco=]
A conditional order that combines a limit order with a stop-limit order.
We use OCO orders to trade retracements and breakouts. If you wanted to trade a break above resistance or below support, you could place an OCO order that uses a buy stop and sell stop to enter the market.
When using this command, 1 simply means true and tells Autoview to place an OCO order.
oco=1
One Sends the Other [oso=]
You can use an order-sends-order to make entry and exit points with one order. For example, a buy limit order may be placed on a stock at a level that is 5% below the current market with an OSO condition that if this first order is filled, a second limit order to sell be placed at a level 10% above that buy
When using this command, 1 simply means true and tells Autoview to place an OSO order
oso=1
Trigger Price [px=]
px= sets the trigger price for the stop-limit you place. You can use a percentage value or a set number value.
In some cases you will want to use px to take profit, for this you would use minus symbol (-).
Example: px=-1% (One percent representing the take profit price you would want)
px=10%
px=120
px=-1% (Sets the take profit price)
Fixed Trailed Stop [fts=]
Used to set a fixed trailing stop in your market order.
fts=2048.04 (Sets your fixed price)
Order Examples
Below will be a set of examples using some of the parameters mentioned above.
We will be stringing some of them together to form different types of orders.
These examples should help you get started with opening basic and or advanced orders in Tradovate with Autoview/TradingView.
We will be using Tradovate Simulation for the exchange type in these examples.
If you wish to trade using the Live markets use e=tradovate
Open a long/short limit
e=tradovatesim s=znh2 b=long q=10% fp=140.6562
e=tradovatesim s=znh2 b=long q=10% p=10%
e=tradovatesim s=znh2 b=short q=10% p=-10%
e=tradovatesim s=znh2 b=short q=10% fp=115.10937
Open a long/short market
e=tradovatesim s=znh2 b=long q=1 t=market
e=tradovatesim s=znh2 b=short q=1 t=market
Open a long with a stop-limit/market
e=tradovatesim s=znh2 b=long q=10% px=10% p=20%
e=tradovatesim s=znh2 b=long q=10% px=10% t=market
e=tradovatesim s=znh2 b=long q=10% fpx=140.671878 fp=153.46875
e=tradovatesim s=znh2 b=long q=10% fpx=140.6878 t=market
Open a short with a stop-limit/market
e=tradovatesim s=znh2 b=short q=10% px=-10% p=-20%
e=tradovatesim s=znh2 b=short q=10% px=-10% t=market
e=tradovatesim s=znh2 b=short q=10% fpx=115.109375 fp=102.3125
e=tradovatesim s=znh2 b=short q=10% fpx=115.109375 t=market
Close position with a stop-loss
e=tradovatesim s=znh2 b=long c=position px=-10% p=-20%
e=tradovatesim s=znh2 b=long c=position px=-10% t=market
e=tradovatesim s=znh2 b=short c=position px=10% sl=20%
e=tradovatesim s=znh2 b=short c=position px=10% t=market
Close position with take profit
e=tradovatesim s=znh2 b=long c=position p=4%
e=tradovatesim s=znh2 b=short c=position p=-4%
Open a new order with OCO
e=tradovatesim s=znh2 b=long q=1 oco=1 sl=-2% p=2%
e=tradovatesim s=znh2 b=short q=1 oco=1 sl=2% p=-2%
e=tradovatesim s=znh2 b=long q=1 oco=1 fsl=125.390625 fp=130.5
e=tradovatesim s=znh2 b=short q=1 oco=1 fsl=130.5 fp=125.39
Close Position with OCO
e=tradovatesim s=znh2 b=long c=position oco=1 sl=-2% tp=3%
e=tradovatesim s=znh2 b=short c=position oco=1 sl=10% tp=-10%
e=tradovatesim s=znh2 b=long c=position oco=1 fsl=125.3 ftp=131.765625
Open a new order with OSO
b=long oso=1 p=-1% px=-2% sl=-2% tp=3%
p= sets the entry price
px= sets stop loss trigger
sl= sets stop loss price
tp= sets take profit price
You can also use it with just tp or just sl.
b=long oso=1 p=-1% px=-2% sl=-2%
Or
b=long oso=1 p=-1% tp=3%
e=tradovatesim s=znh2 b=long oso=1 p=-1% px=-2% t=market
Close Position and reverse your order
This example below shows us how to tell tell Autoview to close the previous position before opening the opposite (reversed)
Long Position
e=tradovate s=ReplaceWithProperSymbol b=short c=position t=market
e=tradovate s=ReplaceWithProperSymbol b=long q=1 t=market
Reversed Short Position
e=tradovate s=ReplaceWithProperSymbol b=long c=position t=market
e=tradovate s=ReplaceWithProperSymbol b=short q=1 t=market
Break-Even (autoview.com)
ABE is breakeven + this value in price units.
ABEX is the number in price units to trigger.
s=mnqm4 q=1 b=long t=market price=18576.25 oco=1 & fsl=18558.25 abe=5 abex=15
Auto-Trailing (autoview.com)
All values are in points.
ATSL is the amount of points to trail the stop.
ATX is points from entry to activate the trail.
ATF is how often to update the trail (in this case every tick).
s=mnqm4 q=1 b=long t=market price=18576.25 oco=1 & fsl=18558.25 atsl=4.5 fatx=18 atf=0.25
Comments
3 comments
Very helpful. It would be great to show a step by step example on how to use built-in tradingview strategy to create automated trading on Tradovate.
hi i want to open position with tp and sl in one alarm i try every command(oco and ...) it can not be
i can make position with alarm but i can not set tp and sl in one alarm
when i use oco in alarm it just send order with tp and sl but not open a postion
when is dont use it it just open position with no tp and sl order
can i set tp sl order and open market position in one alarm?
or i shoud have one alarm for open market position
and another alarm for send tp sl order ?
please help me iam trying for weeks
my exchange :okx
Thank you for this very helpful plugin.
Tradovate has an auto trail feature in its GUI order settings with the following three input fields:
ATM Settings
Auto trail:
1.) stop loss
2.) profit trigger
3.) frequency
Can this be implemented with Autoview and if so, can you share an example with a market order with stop loss and the above auto trail feature. Thank you!
Please sign in to leave a comment.