Trade Smarter with Automation

Bot

Properties

  • Boolean

    true if the bot's status is 'active'.

  • Object

    Contains properties with real-time capital, P/L and statistical values the bot.

  • Boolean

    true if the bot's status is stopped because of an error. See message for details about the error.

  • String

    A description for the bot.

  • Object

    Set informative data for display in the web client.

    Values are sorted alphabetically by name and should be appropriate for display in a small space (e.g. numbers, dates).

    Usage
    $bot.displayData.Expires = $now.nextFriday;

    Setting multiple values:

    $bot.displayData.set({
        'Expiration': fri,
        'Bull Open': bd.bull.open,
        'Bull Close': bd.bull.close,
        'Bull Legs': bd.bull.legs.join(', '),
        'Bear Open': bd.bear.open,
        'Bear Close': bd.bear.close,
        'Bear Legs': bd.bear.legs.join(', ')
    });

    Displays the data on the bot dashboard:

  • String

    The text displayed about the bots current status.

  • String

    The name of the bot.

  • Opportunity

    The current open opportunity or the opportunity with the last trade activity if multiple opportunities are open.

  • Collection

    Collection containing all open opportunities for a bot.

  • Boolean

    true if the bot has an active trade in progress.

  • Object

    Stores data for a bot indefinitely. More about state...

    // define $signal variable
    $bot.state.signal = $$($stock.close * .9);
  • String

    The bots current status. starting, sleep, loading, active, paused or error

  • String

    A list of comma separated tags.

Functions

open(opts)

Opens a new opportunity.

Options

There are many types of opportunities, each with different options. See the Opportunity guide for details.

Usage
$bot.open({
    type: 'equity',
    symbol: 'AAPL'
});
$bot.open({
    type: 'bullput',
    symbol: 'AAPL',
    expiration: 'next friday',
    legs: [122, 123],
    memo: 'Underlying crossed signal.'
});

pause(opts)

Pause the bot. Prevents the bot from scanning, monitoring opportunities or making any trades.

Options
  • String/Date

    (optional) Pause bot until a specific time/date. Date formats...

  • String

    (optional) Informative message displayed while the bot is paused.

Usage
$bot.pause({
    alarm: 'next monday',
    message: 'Skipping earnings week.'
});

reset(fn)

Resets a bot and its statistics to original state. All data and trade history is deleted.

Arguments
  • Function

    Optional callback function that's called when the bot is reset.

restart(fn)

Restarts a bot.

Arguments
  • Function

    Optional callback function that's called when the bot has finished restarting.

Usage
$bot.restart(function(){
    $log($bot);
});

resume()

Resumes a bot that was paused or stopped because of an error.

Usage
$bot.resume();