Create Trading Strategy


This 7 minute tutorial video shows how to setup an automated trading strategy.

Access trading strategies

You can create multiple trading strategies to try out new ideas and test them independently of each other. The table on the strategies page shows all automated trading strategies you have created so far. For each strategy, the table shows name, description, visibility, and deployment status. The deployment status indicates whether your strategy is deployed to a trading account. The table also has actions to edit strategy name and description. To modify strategy details like the entry and exit conditions, click on the strategy name on the table and access strategy details page. Then, read Working with automated strategy for further instructions.

portfolio details page

Create a new strategy

Follow the steps below to create a new strategy

  1. Access strategy list page
  2. Click on Create New button on top right
  3. A popup dialog will appear with template strategies displayed a slideshow
  4. Click on ‘Select and Modify’ if you want to use any, otherwise click ‘Create from scratch’
  5. It will start a guided wizard with 10 steps :
    • Step 1: Strategy Detail
      1. Enter name, description and visibility. A public strategy is viewable by other users at Investfly.
    • Step 2: General Setting
      1. Security Type: Investfly supports automated strategy to trade both stocks and options. However, there are some limitation to OPTION strategy
        1. Entry and exit criteria must be based on the underlying stock price, not the option price. This is because we do not have a continuous data feed for all option prices in all option chains
        2. Option strategies cannot be backtested. We do not have historical data for option prices
      2. Position Type: Select LONG or SHORT. Currently, you only specify one entry condition and when the entry condition is met, a LONG or SHORT position is opened as specified here.
    • Step 3: Automation Scope
      1. Specify Automation Scope. Read Automation Concepts for more details
    • Step 4: Open Trigger Condition
      1. Specify entry condition. Read Logical Expressions and Expression Builder for more details
      2. Trade Security: Normally, you will leave it as Trade Triggered Security because whatever security met the entry condition should be traded. This is useful only if you want to do correlation trading, where you define entry condition on one security but trade a different stock. E.g if you think that WMT typically follows AMZN price movements, you may want to setup a rule to buy WMT when AMZN goes up by 5%. To achieve this, you will define criteria on AMZN as scope, but you will select Trade Different Security and put WMT as the symbol.
    • Step 5: Trigger Restriction
      1. Time Restrictions: You may want to start trading only a few minutes after the market has opened and stop trading few mins before the market close to avoid high volatility in the market. You can set time restrictions for your open trade condition. Your open trade condition will only be evaluated within the time you set here.
      2. Open Trade Gap: Sometime due to wild price swings, open trade signal could be triggered multiple time in short time. You can set open trade gap to avoid those unwanted trade signals.
    • Step 6: Open Order Type:
      1. Set Market or Limit Order
      2. Set GTC or Day order duration
    • Step 7: Trade Cash Allocation
      1. Allocation Method: Read the section on portfolio allocation in Automation Concepts and set accordingly
      2. Incremental Trade: Investfly supports trading incrementally for large orders. If you want to split your order into multiple small orders, you can select Trade Incrementally.
      3. Reserved Cash: Reserved Cash is useful only for trading with the real broker account. If you broker account has large cash balance, and you want to risk only a part of it with this strategy, you can set reserved cash. The strategy will only invest the amount in your account after subtracting reserved cash.
    • Step 8: Close Trigger
      1. Specify standard exit conditions such as target profit, loss, trailing loss
      2. Min Hold Period: If specified, your open position will not be closed until the minimum hold period even if other exit conditions are met.
      3. Reserved Cash: Reserved Cash is useful only for trading with the real broker account. If you broker account has large cash balance, and you want to risk only a part of it with this strategy, you can set reserved cash. The strategy will only invest the amount in your account after subtracting reserved cash.
      4. Timeout period: The is the inverse fo min hold period. The open position will always be closed after the timeout period.
      5. Custom Close Condition: Define a logical expression similar to open trade condition.
    • Step 9: Close Trade Restrictions
      1. Excluded Securities: This is applicable when strategy is deployed to a real trading account. If you have already open position that this strategy should not close, then specify those here.
      2. Specify time restrictions if any,
    • Step 10: Close Order Type
      1. Set Market or Limit Order
      2. Set GTC or Day order duration
  6. Click Save