# User Defined Variables

You can create variables and set them to any value then use them either manually by typing into the CLI or inside a shortcut binding.&#x20;

{% hint style="info" %}
All user variables start with the **"@"** symbol
{% endhint %}

This scheme offers a lot of flexibility and power if you're a regular shortcut user! For example you could define a variable **@bigsize** and use that in multiple shortcut bindings to Swarm, Chase etc. And then if you want to change the size used in these bindings, you can simply modify the value of **@bigsize** without having to re-write the bind shortcut.

### How To Create & Modify Variables

| Command                   | Description                                         | Example                                                                                                                               |
| ------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **`set @<name> <value>`** | Create a variable or change existing variable value | <p><em><code>set @bigsize 1000$</code></em> <br><em><code>set @halfsize 50%</code></em><br><em><code>set @myentry -1%</code></em></p> |
| **`unset @<name>`**       | Remove a variable                                   | *`unset @bigsize`*                                                                                                                    |
| **`unset all`**           | Removes all variables                               |                                                                                                                                       |
| **`print @<name>`**       | Shows current value of the variable                 | *`print @myentry`*                                                                                                                    |
| **`print all`**           | Displays all variables and their current values     |                                                                                                                                       |

{% hint style="success" %}
Variables work with any type of number or string. They can be used for size, price, the number of orders you want to place, the method of scale (cubic, linear).
{% endhint %}

### Quick Editor

For fast editing, you can also use the quick editor in the Hotkey Configuration at the top:

<figure><img src="https://1855557010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuzWZkA5631kraBpRETyN%2Fuploads%2FnTx1SR4nb1P2on8rTxSW%2FScreenshot%202025-07-30%20at%2018.16.15.png?alt=media&#x26;token=550af968-56e2-42c7-90fd-eb804d2d358d" alt=""><figcaption></figcaption></figure>

### Using Variables in the CLI

It's very simple, here's a quick example:

```
set @mysize 100$     // set up our variables 
set @price -1%

buy @mysize at @price  // limit order
=> buy 100$ at -1%

chase sell @mysize to @price // chase all the way to -1% 
=> chase sell 100$ to -1%

set @price -0.1%       // modify and set more variables 
set @price2 -0.5%
set @numorders 10

scale buy @mysize into @numorders from @price to @price2
=> scale buy 500$ into 10 from -0.1% to -0.5%

// Combine 'Constants' with user variables:
buy @mysize   
sell @mysize at $entry // sell 100$ at your current entry price 
```
