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.

All user variables start with the "@" symbol

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

CommandDescriptionExample

set @<name> <value>

Create a variable or change existing variable value

set @bigsize 1000$ set @halfsize 50% set @myentry -1%

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

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).

Quick Editor

For fast editing, when you create your first variable you also enable the quick editor at the top of the Terminal window:

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 

Last updated