web analytics
< All Topics
Print

Frequently Asked Questions

This FAQ answers many of the commonly asked questions regarding how to use the OptionStack platform. Topics such as how to create / adjust your positions and how to analyze / tune your trading systems are discussed below. If you have any additional questions, please post your questions to our discussions forums.

Creating Trades

How do I create a trade?

You can create various different trades, from covered calls to vertical spreads to iron condors.

Screen Shot 2016-05-30 at 4.50.44 PM

How do I copy blocks from one file to another?

You can select the blocks of interest and copy them using [Ctrl-C]. Once copied, you can paste them into the same file or a different file using [Ctrl-V]. For example, you can select and copy specific blocks from the example strategies into a new file.

How do I preview my trades?

Once you’ve constructed your spread order, click on the “Magnifying Icon” on the Strategy block. A list of matching positions will be displayed in the lower panel.

Screen Shot 2016-05-30 at 4.43.15 PM

How do I apply a filter to a specific leg of a trade versus the entire trade?

You can specify the strategy filters for an entire trade or for individual legs of a trade. By default, the strategy filters apply to the entire trade as a whole.

To specify the strategy filters for a specific leg of a trade, click on the “Gears” icon on the strategy filter block and enable the “Leg” option.

Screen Shot 2016-05-30 at 4.05.02 PM

In the example above, a put vertical spread will be constructed where:

  • the highest strike put will have a delta of 25 – 30.
  • the overall position delta will be 15 – 20.

How do I trade multiple instruments at the same time?

By default, the studies and strategies use the instrument defined at the top block.

To create studies and trades for other instruments, click on the “Gears” option icon, and enable the “Instrument” option .

Screen Shot 2016-05-30 at 5.09.56 PM

How do I add a specific trade on a specific date?

You can specify a specific date to place a trade using the blocks under the Calendar Studies menu.

You can also manually add specific option trades or stock trades on a specific date using the Manual Trade Block. You can select the exact date / strike / expiration / fill price / quantity for your trade. 

How do I use my own custom trading indicators?

Please see the following article on using your own custom indicators: How To Use Your Own Custom Indicators

How do I create a new trade with the same expiration or similar strikes as an existing trade?

You can reference the attributes of an existing position, such as strike prices / expiration dates / quantity, etc…, by using the SetVariable block and the Portfolio Studies block. Please see the following for more information:  Referencing Existing Trades

How do I wait X days after a trading condition has occurred before placing a trade?

You can wait several days after your trading conditions triggered before executing your trades by using a dummy position. Please review the following tutorial for more information: Wait X Days…

Adjusting Trades

How do I close a trade?

You can close an existing position by using the Close block, and specifying the Order ID of the position you wish to close. Be sure to place the Close block inside a WHEN block with the appropriate Market Studies Block / Portfolio Studies block to only close your trades when the conditions are right.

Screen Shot 2016-05-30 at 5.25.27 PM

How do I close a specific leg of a trade?

You can close an entire position, or a specific leg of a position.

To close a specific leg of a position, click on the “Gear” option icon and select the “Leg” option. Then select the specific leg you want to close. 

Screen Shot 2016-05-30 at 5.27.56 PM

How do I close a trade when certain profit/loss/greek targets are hit?

The Portfolio Studies block contains numerous studies relating to the property of a trade, such as profit / loss, option greeks, etc. To close a position based on profit / loss / greeks (i.e. delta) targets, place the Close block inside the body of a WHEN block with the Portfolio Studies Block configured to trigger on specific attributes of a particular trade. You can also plot the various attributes of a trade, such as its profit/loss and option greeks. 

Screen Shot 2016-05-30 at 7.50.56 PM

How do I roll a trade further out of the money or further out in time?

Please review the following article on Rolling Your Trades.

How do I allow trades to be exercised / assigned at expiration?

By default, positions are closed prior to expiration. To allow positions to be exercise / assigned instead, enable the “At Expiration” option under the GearIcon on the Strategy block. Select the Exercise/Assign” drop-down option.

How can I tell if a trade has been exercised / assigned?

You can use the netOpenUnderlyingInstrumentUncoveredQuantity method in the Portfolio Studies block. This method returns the number of underlying shares of stock a position has, which will be greater than 0 if an option has been assigned / exercised.

What happens when one trade accidentally overlaps with and offsets / closes another trade?

By default, once a position is opened, it is considered open unless it has expired or has been explicitly closed by an accompanying order with matching OrderID. This allows multiple positions to be managed and tracked separately, without worrying about one trade interfering / offsetting another trade unintentionally.

But if you want to allow one position to offset another position, you can enable the consideredPositionsClosedIfOffsetByIndependentPositions setting.

How do I close my positions prior to a stock split?

To identify the date of the stock split, change the Stock Split Mode under the Backtest Settings to “Abort on Stock Splits“.

Use the blocks under the Calendar studies to specify the date right before the stock split, and close your positions.

Analyzing Results

Why do the results change across backtest runs?

For each backtest run, the trades selected will match your specified trading rules. But if your trading rules / criteria are too broad, multiple different trades may match your trading rules simultaneously. When several trades match, a different matching trade may be selected across backtest runs, resulting in potentially different results from one backtest to another.

In this case, you should “tighten” your strategy filters to limit the number of trades that may match your rules.

broadFilters

How do I view how my portfolio changes over time?

Double-click on any of the rows in the Statistics table to view the portfolio at a given point in time.

Screen Shot 2016-05-30 at 8.13.29 PM

How do I view the details of my trades?

Double-click on any of the transactions in the Transaction Table or the “T” icons on the chart to bring up the transaction details.

Screen Shot 2016-05-30 at 8.07.38 PM

In addition to the transaction details itself, you can also view the portfolio before and after the transaction.

Screen Shot 2016-05-30 at 8.09.36 PM

Debugging

How do I debug my trading strategy?

Please take a look at the following article for tips on debugging your strategy.  Debugging your trading strategy can be accomplished by using the following techniques:

  • Adding Comments to your Orders:  By adding comments to your orders, you can trace the transactions back to your  specific trading rules.
Screen Shot 2016-05-30 at 3.55.51 PM
  • Plotting studies / portfolio attributes:  By plotting the various technical studies and your portfolio attributes, you can observe how your trading rules interact with market conditions.
Screen Shot 2016-05-30 at 8.36.54 PM
Screen Shot 2016-05-30 at 8.38.55 PM
  • Previewing your Strategy Orders:  By previewing your strategy orders, you can verify whether your order criteria matches your desired position characteristics.
Screen Shot 2016-05-30 at 4.43.15 PM

Where can I find the API documentation?

Sharing

How do I share my strategy with others?

Click on the “Share” button to create a shareable link that you can send to others, post on social media / website, etc… 

You can choose to share your strategy publicly, which will publish your strategy to our OptionStack community. Or you can share your strategy privately, where only those who have the direct link can access the strategy.

How does sharing work?

When someone clicks on your shareable link, they will receive a snapshot / copy of your strategy file into their own OptionStack account. The snapshot is based on the state of your strategy at the moment the link is clicked.
 
Since it is a copy of your strategy, users can edit / modify the strategy, without impacting your original strategy file. You may continue to edit and modify your strategy after it has been shared. But your changes will not be reflected in existing copies / snapshots of your strategy by other users.

Error Messages

How do I fix the InvalidFilterSetting error?

Certain strategy filters are meant to apply to the entire strategy than the individual legs of a strategy.

The strategy above will encounter the following error message:

InvalidFilterSetting: Please change [XYZ] filter to entire strategy, rather than individual leg.

To fix this issue, remove the Leg option so that the filter applies to the entire strategy, rather than a specific leg.

How do I fix the SetVariableErrors?

If you are using the Portfolio Studies Block in a SetVariable Block (i.e. returnOnMargin, etc), the SetVariable Block should be enclosed in a WHEN block with matching orderID.

The strategy above will encounter the following error message:

OrderID used in variable must match OrderID specified in enclosing WHEN Block

To fix the issue, enclose the variable in a WHEN block with matching OrderID.

Previous Quick Start Guide
Table of Contents