TAT now has a flexible system for setting up conditional trade entries based on things such as Exponential Moving Averages (EMA), VIX, and SPX gaps and intraday movements. One or more conditions can be combined using both AND and OR groups to create complex conditions. Once a condition is created, it can be applied to both scheduled trade entries and triggers, to only enter the trade if the conditions are true. A condition can also be used to "Early Exit" a trade.
Part 1: Creating Condition Sets
To create conditions, start with Conditions on the left menu and click New Condition.
Wait for Conditions to be True?
Cancel Trade on Fail - This option will cancel a scheduled trade entry immediately on the first attempt to enter if the Condition set evaluates to false.
Re-Check Conditions until Expiration - This option will put a scheduled trade entry back in the queue with Waiting status to be processed again if it evaluated to false. It will continue to be evaluated until the scheduled entry expires.
Condition Details
The heart of a Condition Set is one or more Condition Details. You can compare SPX, VIX, or EMA values to other built in values, or a Specific numeric value.
This example would evaluate to true when EMA5 > EMA40.
This example would evaluate to true when the current value of VIX is > 15
Multiple Conditions
You can combine multiple conditions together to evaluate when deciding to enter a trade. The example below will evaluate to true only if BOTH EMA5 > EMA40 and the current SPXIntradayPct move is > 0.25%.
AND/OR Groups
Condition Details with the same Group number must all be true for the condition to evaluate to true. (Conditions with the same group are treated as AND).
Different Group numbers are treated as ORs. When multiple groups are used, only one of the groups needs to be true for the entire condition to evaluate to true and the trade to be triggered.
The example below would evaluate to true if VIX was below 18 OR if the VIXIntradayPct move was below 0 (VIX had moved down during the day).
Part 2: Using Condition Sets When Entering Trades
To make use of a Condition Set once you have created it, you simply need to select it from the dropdown when scheduling a trade and creating a trade trigger.
Scheduled Trade:
Trade Trigger:
Part 3: Using Condition Sets to "Early Exit" a Trade.
To make use of a Condition Set to exit a trade, you simply need to select it from the "Early Exit Condition" dropdown under the Timed Exit section of the Trade Template. TAT will check once a minute to see if the condition is true, and if so, it will schedule the trade to close immediately. The closing order will utilize the Limit/Market order setting you have set for the template.
WARNING: It is strongly discouraged to use the Early Exit conditions as a stop loss order for a 0 DTE or other trade with fast moving pricing. Since it is only checked once per minute, it is very possible for the price to close to be higher than expected by the time the closing order is executed.
Early exit conditions make more sense for longer term trades like calendars where you might want to exit when your delta gets to high or your short legs go too far in the money.
Data Available For Conditions
EMA (Exponential Moving Average) (5, 20, and 40 minute)
Many users use Exponential Moving Average (EMA) to determine the trend. EMA values are calculated using 1 minute bar SPX data. TAT currently offers the ability to look at EMA values for 5, 20, and 40 minutes.
Typically when using trend entries you are only wanting to open a trade with the trend, i.e. sell a put spread in a rising market or sell a call spread in a falling market. To automate this in TAT you will schedule two separate trades at your desired entry time: a call spread and a put spread. Then you will make each conditional on the proper trend. For example, your put spread might be set up to execute when EMA5>EMA40 (market is moving up) and the call spread would be set up to execute if EMA5<EMA40. Then when the scheduled trade time occurs, the condition is evaluated for each trade and the trade with the true condition is entered and the trade with the false condition is cancelled.
IMPORTANT: To enable EMA trades or to use SPXPriorClose, SPXOpen, or SPXGapPts/Pct in conditions, you must toggle "SPX EMA" on under Market Data settings on the Settings page. This data is off by default.
Since SPX data is coming from TWS, the time zone set on your computer/server, market close time in the TAT settings, and the timezone used when signing in to TWS must all match. More information here.
SPX - Current SPX Price
SPXPriorClose - SPX closing price on the previous trading day
SPXOpen - Opening price of SPX on the current trading day
SPXGapPts - SPX price difference (Gap) between the previous close and today's open, measured in the number of points. A gap up will be a positive value and a gap down will be a negative value.
SPXGapPct - SPX price difference (Gap) between the previous close and today's open, measured as a percentage of the previous price. A gap up will be a positive value and a gap down will be a negative value. The example below would look for an SPX gap up of over 1%.
SPXIntradayPts - SPX price difference between today's open and the current price, measured in the number of points. A move up will be a positive value and a move down will be a negative value.
SPXIntradayPct - SPX price difference between today's open and the current price, measured as a percentage of the opening price. A move up will be a positive value and a move down will be a negative value. The example below would look for an SPX gap up of over 1%.
IMPORTANT: To enable conditions using VIX data, you must toggle "VIX" on under Market Data settings on the Settings page. This data is off by default.
Since VIX data is coming from TWS, the time zone set on your computer/server, market close time in the TAT settings, and the timezone used when signing in to TWS must all match. More information here.
VIX - Current VIX Price
VIXPriorClose - VIX closing price on the previous trading day
VIXOpen - Opening price of VIX in the current trading day
VIXGapPts - VIX price difference (Gap) between the previous close and today's open, measured in the number of points. A gap up will be a positive value and a gap down will be a negative value.
VIXGapPct - VIX price difference (Gap) between the previous close and today's open, measured as a percentage of the previous price. A gap up will be a positive value and a gap down will be a negative value.
VIXIntradayPts - VIX price difference between today's open and the current price, measured in the number of points. A move up will be a positive value and a move down will be a negative value.
VIXIntradayPct - VIX price difference between today's open and the current price, measured as a percentage of the opening price. A move up will be a positive value and a move down will be a negative value.
Trade data available for Early Exit Conditions
All conditions prefixed with "Trade_" are available for trade exits only and are based on the live values of the open trade the condition is being applied to.
Trade_LongCallDelta/Trade_LongPutDelta/Trade_ShortCallDelta/Trade_ShortPutDelta - Delta value of the long (or short) call (or put) in the trade. Values always positive 0-100.
Trade_LongCallOTMPts/Trade_LongPutOTMPts/Trade_ShortCallOTMPts/Trade_ShortPutOTMPts - Number of points the long (or short) call (or put) in the trade is currently out of the money. Positive values means the strike is out of the money. Negative values mean the strike is in the money.
Trade_LongCallOTMPct/Trade_LongPutOTMPct/Trade_ShortCallOTMPct/Trade_ShortPutOTMPct - Percentage of the underlying value that the long (or short) call (or put) in the trade is currently out of the money. Positive values means the strike is out of the money. Negative values mean the strike is in the money. For example, a strike that is 60 points out of the money when SPX is 6000, then it is 1 percent OTM.
Trade_PositionDelta - Combined current delta of the current trade, which is the sum of all legs in the trade. This value will range between -100 and +100.
Trade_ShortLongRatio - This is the ratio of the current Ask price of the short leg(s) divided by the long leg(s) in the trade. For example, if your short legs add up to be worth 2.50 and the long legs are worth 1.25, then the ShortLongRatio would be: 2.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article