- Getting Started
- What is Investfly?
-
User Management
-
Market Analysis
-
Trading
-
Automated Strategies
-
Logical Expressions
- Custom Indicators
- Investfly SDK API Docs
Create Trading Strategy
This tutorial video demonstrates how to set up an automated trading strategy using Investfly's algorithmic trading platform.
Access Trading Strategies
You can create multiple trading strategies to test new ideas independently. The strategies page displays all your automated trading strategies, showing their name, description, visibility, and deployment status. The deployment status indicates whether your strategy is deployed to a trading account. You can edit the strategy name and description directly from the table. To modify strategy details like entry and exit conditions, click on the strategy name to access the strategy details page. For further instructions, read Working with Automated Strategy.
Create a New Strategy
Follow these steps to create a new trading strategy:
- Access the strategy list page.
- Click on the "Create New" button at the top right.
- A popup dialog will appear with template strategies displayed in a slideshow.
- Click on "Select and Modify" to use a template, or click "Create from Scratch".
-
A guided wizard with 10 steps will start:
-
Step 1: Strategy Detail
- Enter the name, description, and visibility. A public strategy is viewable by other users on Investfly.
-
Step 2: General Setting
-
Security Type: Investfly supports automated trading strategies for both
stocks and options. However, there are some limitations for option
strategies:
- Entry and exit criteria must be based on the underlying stock price, not the option price, as we do not have continuous data feed for all option prices.
- Option strategies cannot be backtested due to the lack of historical data for option prices.
- Position Type: Select LONG or SHORT. Currently, you can only specify one entry condition, and when it is met, a LONG or SHORT position is opened as specified here.
-
Security Type: Investfly supports automated trading strategies for both
stocks and options. However, there are some limitations for option
strategies:
-
Step 3: Automation Scope
- Specify the automation scope. Read Automation Concepts for more details.
-
Step 4: Open Trigger Condition
- Specify the entry condition. Read Logical Expressions and Expression Builder for more details.
- Trade Security: Normally, you will leave it as "Trade Triggered Security" because the security that meets the entry condition should be traded. This is useful for correlation trading, where you define entry conditions on one security but trade a different stock. For example, if you think WMT typically follows AMZN price movements, you may set a rule to buy WMT when AMZN goes up by 5%. To achieve this, define criteria on AMZN as scope, but select "Trade Different Security" and put WMT as the symbol.
-
Step 5: Trigger Restriction
- Time Restrictions: You may want to start trading only a few minutes after the market opens and stop trading a few minutes before the market closes to avoid high volatility. Set time restrictions for your open trade condition, which will only be evaluated within the time you set here.
- Open Trade Gap: To avoid unwanted trade signals due to wild price swings, set an open trade gap.
-
Step 6: Open Order Type
- Set Market or Limit Order.
- Set GTC or Day order duration.
-
Step 7: Trade Cash Allocation
- Allocation Method: Read the section on portfolio allocation in Automation Concepts and set accordingly.
- Incremental Trade: Investfly supports trading incrementally for large orders. If you want to split your order into multiple small orders, select "Trade Incrementally".
- Reserved Cash: Reserved Cash is useful only for trading with a real broker account. If your broker account has a large cash balance and you want to risk only a part of it with this strategy, set reserved cash. The strategy will only invest the amount in your account after subtracting reserved cash.
-
Step 8: Close Trigger
- Specify standard exit conditions such as target profit, loss, and trailing loss.
- Min Hold Period: If specified, your open position will not be closed until the minimum hold period, even if other exit conditions are met.
- Timeout Period: This is the inverse of the min hold period. The open position will always be closed after the timeout period.
- Custom Close Condition: Define a logical expression similar to the open trade condition.
-
Step 9: Close Trade Restrictions
- Excluded Securities: This is applicable when the strategy is deployed to a real trading account. If you have already open positions that this strategy should not close, specify those here.
- Specify time restrictions if any.
-
Step 10: Close Order Type
- Set Market or Limit Order.
- Set GTC or Day order duration.
-
Step 1: Strategy Detail
- Click Save.