Trade Smarter with Automation

Equity Opportunity

Open, monitor and close long or short stock and ETF positions.

Opening

Call $bot.open with type 'equity' or 'shortequity' and other options, e.g.

$bot.open({
    type: 'equity',
    symbol: 'JPM',
    memo: 'Buy signal crossed.'
});

Options:

  • String

    'equity' or 'shortequity'

  • String

    The stock ticker symbol (e.g. 'JPM')

  • Mixed

    A fixed limit price, array of prices or price settings object. If you don't provide a price, Smart Pricing will automatically try limit orders between the bid/ask spread.

  • Number

    The quantity for the order. If you don't provide a quantity, Alta5 will automatically calculate the quantity based on the bot's opportunity draw limit. More info...

  • Number/String

    The number of seconds to keep the order open, 'day' for the rest of the day or 'gtc' for good-til-canceled. More info...

  • Object

    Any storable data you want to attach to the opportunity.

  • String

    A memo message displayed in the app when viewing the opportunity.

  • String

    A comma separated list of tags.

API

Once the bot has opened the opportunity, it can be accessed via the $bot.opps collection:

// the first equity opportunity
var opp = $bot.opps.first('equity');

Properties

  • Number

    The total amount paid to close the opportunity.

    closeCost will be negative for long and positive for short opportunities.
  • Date

    The date the opportunity was closed.

  • Date

    Total P/L for any closed positions of this opportunity.

  • Number

    The total trade commissions for the opportunity.
    * Paper trading commission values are not real charges and are solely for performance analysis.

  • Number

    The total amount paid to open the opportunity.

    The value will be negative for opportunities that collect premium.
  • Object

    The storable data passed to $bot.open. (See data option above)

  • Number

    The number of days this opportunity has been open.

  • Number

    The highest amount of capital drawn by this opportunity at any time.

  • Number

    The highest amount of capital drawn by this opportunity today.

  • Number

    P/L as a decimal percent of capital drawn.

    Returns either markGain or marketGain, depending on your settings (under "Advanced Settings" in the app).
  • String

    The id of this opportunity.

  • String

    The id of the bot that opened this opportunity.

  • Boolean

    true if this opportunity is closed.

  • Number

    The amount of capital or margin reserved to secure this opportunity.

  • Number

    P/L as a decimal percent of capital drawn by this opportunity.

    Calculated using marketPnl and highDraw.
  • Number

    P/L for the opportunity using the market asking price(s).

  • Number

    The current value of the opportunity using the market asking price(s).

  • Number

    P/L as a decimal percent of capital drawn by this opportunity.

    Calculated using markPnl and highDraw.
  • Number

    P/L calculated using the mark price(s) midway between the bid/ask spread.

  • Number

    The current value of the opportunity using the mark price(s) midway between the bid/ask spread.

  • Date

    The date the opportunity was opened.

  • Date

    The total capital drawn by open positions.

  • Number

    The total P/L.

    Returns either markPnl or marketPnl, depending on your settings (under "Advanced Settings" in the app).
  • Security

    A Security object for the underlying equity.

  • String

    The symbol for the call option.

  • String

    'equity' or 'shortequity'

  • Security

    A Security object for the underlying.

  • Number

    The current $ value of the opportunity.

    Returns either markValue or marketValue, depending on your settings (under "Advanced Settings" in the app).

Functions

close(opts)

Close the opportunity.

Options
  • String

    Memo text displayed in the application.

  • Mixed

    A fixed limit price, array of prices or price settings object. If you don't provide a price, Smart Pricing will automatically try limit orders between the bid/ask spread.

  • Number/String

    The amount of time to keep the order open. More info...

Usage

Can be called with an options object or by passing a memo directly.

$bot.opp.close('Profit taking at 75%');
or
// timeout in 300 seconds (5 minutes)
$bot.opp.close({memo: 'Profit taking at 75%', timeout: 300});