Overview Intro Log In
  

Opportunity API

Opening opportunities

Opportunities are opened by calling $bot.open, e.g.

$bot.open({
    type: 'equity',
    symbol: 'JPM',
    price: 55.23
});

Below is a list of the types of opportunities Alta5 currently supports:

Long/Short Equity

// short LVS
$bot.open({
    type: 'shortequity',
    symbol: 'LVS',
    memo: 'LVS is going down'
});
// Long JPM, hard-coded price
$bot.open({
    type: 'equity',
    symbol: 'JPM',
    price: 55.23,
    timeout: 60    // cancel order in 60 seconds
});
Options:

Long/Short Options

$bot.open({
    type: 'call',
    symbol: 'AAPL',
    strike: 120,
    days: 10    // <-- at least 10 days to exp
});
$bot.open({
    type: 'shortput',
    symbol: 'JPM',
    strike: 55,
    expiration: 'next friday',
    price: [.9, .85, .8],
    tags: 'naked'
});

If you have an option security ($option) returned by the $data.option or $data.optionchain APIs, use option instead of providing symbol, strike, days and expiration:

$bot.open({
    type: 'shortcall',
    option: $option
});
Options:

Credit Spreads

$bot.open({
    type: 'bullput',
    symbol: 'AAPL',
    legs: [131, 130],
    expiration: 'next friday'
});

If you load a variable using the $data.spreads API, use the spread option:

$bot.open({
    type: 'bearcall',
    spread: $spread
});
Options:

Opportunity API

All Opportunities

Properties
Functions

close(memo)

Close the opportunity.

Arguments
  • String

    Memo text displayed in the application.

Usage
$bot.opp.close('Stop Loss');

Short/Long Option

Functions

roll(opts)

Rolls an option opportunity to different strike price, delta or expiration.

Options
  • Number

    The strike price of the option (matches exact). Either strike or delta is required.

  • Number

    The delta of the option (matches nearest). Either strike or delta is required.

  • Security

    An option security returned by $data.option or $data.optionchain. If option is supplied then delta, strike, days and expiration can be omitted.

  • Number

    Rolls to an option in the first option series with at least days to expiration. Optional if a expiration is provided.

  • String/Date

    Rolls to an option in the first option series that expires on or after the expiration date. Optional if a days is provided. Date formats...

  • Mixed

    A fixed limit price, array of prices, 'auto' or price settings object. Use negative numbers for a debit, positive for a credit. For example, -.15 would roll for a 15 cents per share debit. More info...

  • Number/String

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

  • String

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

Usage
var calls = $bot.opps.first('shortcall');
if(calls && calls.daysOpen > 3 && calls.timeValue < $timeValue){
    calls.roll({
        delta: $delta,
        expiration: calls.expiration.nextMonthlyDate
    });
}