Trade Smarter with Automation

Bot Control Panels

Learn how to build a custom control panel for your bot.

Building your control panel

Alta5 provides controls (button, switch and readout) which you can add to your bots to trigger scripts, interactions, modify behavior, analyze/display data, etc. In the prototype builder, find the "Controls" list and click the + icon to add a control to your bot prototype.

Layout

Each control has a size option to adjust how it is laid out in the control panel. "Small" controls occupy 1 column and "large" controls occupy 2 columns. For example, in the image below the green and red buttons are large and the other controls are small.


Accessing controls

Each control becomes a global bot $ variable with properties you can access or modify in your scripts.

Switch example

You add a switch named $swScan, and access its state in the top of your scan routine to enable/disable scanning:

if($swScan.isOff){
    return;  // scanning is turned off
}
Disabled/hidden example

You've added a button, $liquidate, to your bot that closes all open opportunities. You want to enable / disable it at the appropriate times.

wake routine:

$liquidate.disabled = !$bot.opps.length;

open routine:

$liquidate.disabled = false;

close routine:

$liquidate.disabled = !$bot.opps.length;

You could also hide it using the hidden property instead of disabled:

$liquidate.hidden = !$bot.opps.length;

Button API

  •  

    Triggers a button click.

    If provided, the properties of the data object are copied to $event for your script.

    Example

    In the 'scan' script:

    $button.click({source: 'script'});

    In the button script:

    if($event.source === 'script'){
        // triggered by script
    } else {
        // normal click
    }
  • String

    'blue', 'red', 'green' or 'outline'.

  • Boolean

    true to disable the button.

  • Boolean

    true to hide the button.

  • String

    The tooltip for the button (web only).

  • String

    The id of the button.

  • Number

    1 for small, 2 for large.

  • String

    The text in the button.


Switch API

  • Boolean

    true to disable the switch.

  •  

    Turn the switch "off".

    If provided, the properties of the data object are copied to $event for your script.

    Example

    In the 'scan' script:

    $switch.flipOff({source: 'script'});

    In the switch script:

    if($event.source === 'script'){
        // triggered by script
    } else {
        // normal switch
    }
  •  

    Turn the switch "on".

    If provided, the properties of the data object are copied to $event for your script.

    Example

    In the 'scan' script:

    $switch.flipOn({source: 'script'});

    In the switch script:

    if($event.source === 'script'){
        // triggered by script
    } else {
        // normal switch
    }
  • Boolean

    true to hide the switch.

  • String

    The help tooltip for the switch (web only).

  • String

    The id of the switch.

  • Boolean

    true if the switch is "off".

  • Boolean

    true if the switch is "on".

  • String

    The label text above the switch.

  • Number

    1 for small, 2 for large.

  • Boolean

    true if the switch is "on", false if it's off.


Readout API

Readouts display values in the control panel. Your routines (e.g. wake) can update the readout value or the readout's refresh script can be used to manage the readout's value.

  • Boolean

    true to hide the readout.

  • String

    The help tooltip for the readout (web only).

  • String

    The id of the readout.

  • String

    The label text above the value.

  •  

    Triggers the refresh script to update the readout value.

    If provided, the properties of the data object are copied to $event for your script.

    Example

    In the 'scan' script:

    $readout.refresh({mode: '%'});

    In the refresh script:

    if($event.mode === '%'){
        // calculate %
    }
  • Number

    1 for small, 2 for large.

  • String

    The value displayed in the readout.