# Table of Contents - [Create Project | Origami Documentation](#create-project-origami-documentation) - [Add accounts | Origami Documentation](#add-accounts-origami-documentation) - [API Key Creation | Origami Documentation](#api-key-creation-origami-documentation) - [Gate io | Origami Documentation](#gate-io-origami-documentation) - [Hyperliquid | Origami Documentation](#hyperliquid-origami-documentation) - [Mexc | Origami Documentation](#mexc-origami-documentation) - [Bybit | Origami Documentation](#bybit-origami-documentation) - [OKX | Origami Documentation](#okx-origami-documentation) - [HTX | Origami Documentation](#htx-origami-documentation) - [Create Spot Bot | Origami Documentation](#create-spot-bot-origami-documentation) - [Required parameters | Origami Documentation](#required-parameters-origami-documentation) - [Bitget | Origami Documentation](#bitget-origami-documentation) - [Create Futures Bot | Origami Documentation](#create-futures-bot-origami-documentation) - [Kucoin | Origami Documentation](#kucoin-origami-documentation) - [Sleep After Seconds | Origami Documentation](#sleep-after-seconds-origami-documentation) - [Optional parameters | Origami Documentation](#optional-parameters-origami-documentation) - [BitMart | Origami Documentation](#bitmart-origami-documentation) - [Time Between Orders | Origami Documentation](#time-between-orders-origami-documentation) - [Binance | Origami Documentation](#binance-origami-documentation) - [Placing Buy and Sell Orders Based on RSI of 15-Minute Candlesticks | Origami Documentation](#placing-buy-and-sell-orders-based-on-rsi-of-15-minute-candlesticks-origami-documentation) - [BingX | Origami Documentation](#bingx-origami-documentation) - [Grids Examples | Origami Documentation](#grids-examples-origami-documentation) - [Selling at the Best Price with Minimum Price and Balance Constraints | Origami Documentation](#selling-at-the-best-price-with-minimum-price-and-balance-constraints-origami-documentation) - [Is Buy First | Origami Documentation](#is-buy-first-origami-documentation) - [Base logic | Origami Documentation](#base-logic-origami-documentation) - [Buying at the Best Price with Maximum Price and Balance Constraints | Origami Documentation](#buying-at-the-best-price-with-maximum-price-and-balance-constraints-origami-documentation) - [Placing Orders at the Best Price or with a Minimum Spread | Origami Documentation](#placing-orders-at-the-best-price-or-with-a-minimum-spread-origami-documentation) - [Sell Orders Count | Origami Documentation](#sell-orders-count-origami-documentation) - [Buying at the Best Price Considering Historical Data | Origami Documentation](#buying-at-the-best-price-considering-historical-data-origami-documentation) - [Buy Orders Count | Origami Documentation](#buy-orders-count-origami-documentation) - [Placing Orders with a Spread Based on Historical Data | Origami Documentation](#placing-orders-with-a-spread-based-on-historical-data-origami-documentation) - [Side | Origami Documentation](#side-origami-documentation) - [Execute Price | Origami Documentation](#execute-price-origami-documentation) - [Pre-defined parameters | Origami Documentation](#pre-defined-parameters-origami-documentation) - [Buying and Selling When the 15-Minute RSI Exits a Defined Range | Origami Documentation](#buying-and-selling-when-the-15-minute-rsi-exits-a-defined-range-origami-documentation) - [GroupBalance | Origami Documentation](#groupbalance-origami-documentation) - [Selling at the Best Price Considering Historical Data | Origami Documentation](#selling-at-the-best-price-considering-historical-data-origami-documentation) - [Execute Volume | Origami Documentation](#execute-volume-origami-documentation) - [Orderbook | Origami Documentation](#orderbook-origami-documentation) - [Shortcuts | Origami Documentation](#shortcuts-origami-documentation) - [Counter | Origami Documentation](#counter-origami-documentation) - [Base | Origami Documentation](#base-origami-documentation) - [Order Pos | Origami Documentation](#order-pos-origami-documentation) - [OrderBookUnit | Origami Documentation](#orderbookunit-origami-documentation) - [Balance | Origami Documentation](#balance-origami-documentation) - [Symbol | Origami Documentation](#symbol-origami-documentation) - [Candle | Origami Documentation](#candle-origami-documentation) - [Amount Before Price | Origami Documentation](#amount-before-price-origami-documentation) - [Structures | Origami Documentation](#structures-origami-documentation) - [Exchanges list | Origami Documentation](#exchanges-list-origami-documentation) - [Symbol | Origami Documentation](#symbol-origami-documentation) - [Amount Threshold Index | Origami Documentation](#amount-threshold-index-origami-documentation) - [Candles | Origami Documentation](#candles-origami-documentation) - [Pivot Points | Origami Documentation](#pivot-points-origami-documentation) - [Create Grid | Origami Documentation](#create-grid-origami-documentation) - [Percent B | Origami Documentation](#percent-b-origami-documentation) - [Mean | Origami Documentation](#mean-origami-documentation) - [Sum | Origami Documentation](#sum-origami-documentation) - [Stochastic RSI | Origami Documentation](#stochastic-rsi-origami-documentation) - [Average True Range | Origami Documentation](#average-true-range-origami-documentation) - [Momentum Breakout Bands | Origami Documentation](#momentum-breakout-bands-origami-documentation) - [VWAP | Origami Documentation](#vwap-origami-documentation) - [Count | Origami Documentation](#count-origami-documentation) - [Abs | Origami Documentation](#abs-origami-documentation) - [Saved Balance | Origami Documentation](#saved-balance-origami-documentation) - [RSI to price | Origami Documentation](#rsi-to-price-origami-documentation) - [Orderbook | Origami Documentation](#orderbook-origami-documentation) - [Min | Origami Documentation](#min-origami-documentation) - [Group Balance | Origami Documentation](#group-balance-origami-documentation) - [Exponential Moving Average | Origami Documentation](#exponential-moving-average-origami-documentation) - [Var | Origami Documentation](#var-origami-documentation) - [Random | Origami Documentation](#random-origami-documentation) - [Kaufman Efficiency Indicator | Origami Documentation](#kaufman-efficiency-indicator-origami-documentation) - [Stochastic Oscillator %K | Origami Documentation](#stochastic-oscillator-k-origami-documentation) - [Max | Origami Documentation](#max-origami-documentation) - [Stop-and-Reverse | Origami Documentation](#stop-and-reverse-origami-documentation) - [Exp | Origami Documentation](#exp-origami-documentation) - [Ticker | Origami Documentation](#ticker-origami-documentation) - [Balance | Origami Documentation](#balance-origami-documentation) - [Remove NaN | Origami Documentation](#remove-nan-origami-documentation) - [Keltner Channels | Origami Documentation](#keltner-channels-origami-documentation) - [Percentage Price Oscillator | Origami Documentation](#percentage-price-oscillator-origami-documentation) - [Triple Exponential Moving Average Oscillator | Origami Documentation](#triple-exponential-moving-average-oscillator-origami-documentation) - [Is NaN | Origami Documentation](#is-nan-origami-documentation) - [Volume Adjusted Moving Average | Origami Documentation](#volume-adjusted-moving-average-origami-documentation) - [Logn | Origami Documentation](#logn-origami-documentation) - [Cached | Origami Documentation](#cached-origami-documentation) - [Median | Origami Documentation](#median-origami-documentation) - [True Range | Origami Documentation](#true-range-origami-documentation) - [Kaufman's Adaptive Moving Average | Origami Documentation](#kaufman-s-adaptive-moving-average-origami-documentation) - [Bollinger Bands | Origami Documentation](#bollinger-bands-origami-documentation) - [Relative Strenght Index | Origami Documentation](#relative-strenght-index-origami-documentation) - [Functions | Origami Documentation](#functions-origami-documentation) - [Technical analysis | Origami Documentation](#technical-analysis-origami-documentation) - [Donchian Channel | Origami Documentation](#donchian-channel-origami-documentation) - [Own | Origami Documentation](#own-origami-documentation) --- # Create Project | Origami Documentation Step 1: Selecting or Adding a Project ### [](https://docs.origami.tech/#id-1.-open-the-platform-and-locate-the-select-project-button) 1\. Open the platform and locate the "Select Project" button On the main screen of your terminal, you will find the "Select Project" button in the top-right corner. The arrow in the screenshot points to this location. ### [](https://docs.origami.tech/#id-2.-click-on-the-select-project-button) 2\. Click on the "Select Project" button After clicking the button, a dropdown menu will appear, as shown in the second screenshot. In this menu, you can: * Add a new project by selecting the "+ Add Project" option. * Manage your profile via the "Manage Profile" option. * Switch the interface to dark mode by selecting the "Dark Mode" option. * Log out of your account by clicking "Logout." ![how to create project on origami tech, click "Start project" in the top right corner](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fdw5bW1okgvzDxxFdZpWt%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.19.40.png%3Falt%3Dmedia%26token%3Dc171dc57-15b0-492e-8f4d-22c3806c2262&width=768&dpr=4&quality=100&sign=2545fe94&sv=2) ![how to create project on origami tech, click "add project" in the dropdown menu](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FYLMmnyKdbkpSdEDs6kj9%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.21.11.png%3Falt%3Dmedia%26token%3D7668cee2-ef81-41f4-9fc2-67216028288e&width=768&dpr=4&quality=100&sign=abbb239e&sv=2) [](https://docs.origami.tech/#step-2-creating-a-new-project) Step 2: Creating a New Project ------------------------------------------------------------------------------------------------ ### [](https://docs.origami.tech/#id-1.-select--add-project) 1\. Select "+ Add Project" To add a new project, click on the "+ Add Project" option in the menu. ### [](https://docs.origami.tech/#id-2.-fill-in-the-fields-for-the-new-project) 2\. Fill in the fields for the new project A form for creating a new project will appear, as shown in the third screenshot. Enter the following information: * **Profile Name:** The name of your project. This can be any unique identifier to help you recognize the project. ### [](https://docs.origami.tech/#id-3.-click-create) 3\. Click "Create" After completing the form, click the "Create" button to finalize the creation of your new project. The project will be added, and you can start working with it immediately. ![how to create project on origami tech, click "Select project" in the top right corner](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2Gll5vjstWm3q8udCEkc%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.19.40.png%3Falt%3Dmedia%26token%3Df33eb12f-6ba3-4025-83b6-415a65f13d48&width=768&dpr=4&quality=100&sign=fe4f9786&sv=2) ![how to create project on origami tech, click "add project" in the drop down menu](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FV6yY7lyzdH5VmDsoAdk3%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.21.11.png%3Falt%3Dmedia%26token%3D707c1179-ac86-4f15-a0cc-0dbb63004809&width=768&dpr=4&quality=100&sign=92161cf0&sv=2) ![how to create project on origami tech, add project name](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FEGGIGAUiz8EuOJQOFUYT%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.57.09.png%3Falt%3Dmedia%26token%3D552a2e51-7df3-486e-a381-695340faef0e&width=768&dpr=4&quality=100&sign=462ff624&sv=2) * * * [NextAdd accounts](https://docs.origami.tech/user-guide/add-accounts) Last updated 1 month ago --- # Add accounts | Origami Documentation [](https://docs.origami.tech/user-guide/add-accounts#step-1-accessing-the-profile-management-menu) Step 1: Accessing the Profile Management Menu ----------------------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/add-accounts#id-1.-click-on-select-project) 1\. Click on "Select Project" In the top-right corner of the screen, click on the "Select Project" button. If a project is already selected, the button may be labeled as "New Project." ### [](https://docs.origami.tech/user-guide/add-accounts#id-2.-select-manage-profile) 2\. Select "Manage Profile" In the dropdown menu, choose the "Manage Profile" option, as shown in the screenshot. This will open the profile settings, where you can manage accounts, security, and other preferences. ![how to add account, click "manage profile"](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FrB8C02zA040cSFhKbUWJ%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-19%2520%25D0%25B2%252016.21.11.png%3Falt%3Dmedia%26token%3D2e6d57cb-8680-4baf-bf35-40c20f731864&width=768&dpr=4&quality=100&sign=8a93a1db&sv=2) [](https://docs.origami.tech/user-guide/add-accounts#step-2-managing-accounts) Step 2: Managing Accounts ------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/add-accounts#id-1.-navigate-to-the-accounts-tab) 1\. Navigate to the "Accounts" tab In the profile settings, select the "Accounts" tab. This section displays all existing accounts linked to various exchanges that the user works with. ### [](https://docs.origami.tech/user-guide/add-accounts#id-2.-click-add-account) 2\. Click "Add Account" To add a new account, click the "+ Add Account" button located in the top-right corner of the screen. ![how to add account on Origami tech, click add account ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FEpg4CiwQOKZYSKRpIT2K%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252013.12.39.png%3Falt%3Dmedia%26token%3D80ac538a-374d-45ce-af1e-fb7c83fcca57&width=768&dpr=4&quality=100&sign=897bde9a&sv=2) [](https://docs.origami.tech/user-guide/add-accounts#step-3-adding-a-new-account) Step 3: Adding a New Account ------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/add-accounts#id-1.-fill-in-the-fields-for-the-new-account) 1\. Fill in the fields for the new account On the final screen, a form will appear for entering the account details: * **Account Name:** Specify a name for the new account. * **Exchange:** Select the exchange that the account will be associated with. * **Project:** Specify the project linked to this account (this is a required field). * **API Key:** Enter the API key obtained from the exchange. * **Secret Key:** Enter the Secret Key provided by the exchange. ### [](https://docs.origami.tech/user-guide/add-accounts#id-2.-click-add-account-1) 2\. Click "Add Account" Once all fields are filled in, click the "Add Account" button to complete the process. The account will now be linked to the platform, and you can use it for trading through the terminal. ![how to create account on origami tech, fill in account details ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F5jiT7G9GCUVC7myPujGT%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252013.13.23.png%3Falt%3Dmedia%26token%3D43df6f02-2709-46bc-ada8-d10803de222a&width=768&dpr=4&quality=100&sign=342bd790&sv=2) * * * [PreviousCreate Project](https://docs.origami.tech/) [NextAPI Key Creation](https://docs.origami.tech/user-guide/api-key-creation) Last updated 1 month ago * [Step 1: Accessing the Profile Management Menu](https://docs.origami.tech/user-guide/add-accounts#step-1-accessing-the-profile-management-menu) * [1\. Click on "Select Project"](https://docs.origami.tech/user-guide/add-accounts#id-1.-click-on-select-project) * [2\. Select "Manage Profile"](https://docs.origami.tech/user-guide/add-accounts#id-2.-select-manage-profile) * [Step 2: Managing Accounts](https://docs.origami.tech/user-guide/add-accounts#step-2-managing-accounts) * [1\. Navigate to the "Accounts" tab](https://docs.origami.tech/user-guide/add-accounts#id-1.-navigate-to-the-accounts-tab) * [2\. Click "Add Account"](https://docs.origami.tech/user-guide/add-accounts#id-2.-click-add-account) * [Step 3: Adding a New Account](https://docs.origami.tech/user-guide/add-accounts#step-3-adding-a-new-account) * [1\. Fill in the fields for the new account](https://docs.origami.tech/user-guide/add-accounts#id-1.-fill-in-the-fields-for-the-new-account) * [2\. Click "Add Account"](https://docs.origami.tech/user-guide/add-accounts#id-2.-click-add-account-1) --- # API Key Creation | Origami Documentation [Hyperliquid](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid) [Binance](https://docs.origami.tech/user-guide/api-key-creation/binance) [Bybit](https://docs.origami.tech/user-guide/api-key-creation/bybit) [OKX](https://docs.origami.tech/user-guide/api-key-creation/okx) [Gate io](https://docs.origami.tech/user-guide/api-key-creation/gate-io) [Mexc](https://docs.origami.tech/user-guide/api-key-creation/mexc) [HTX](https://docs.origami.tech/user-guide/api-key-creation/htx) [Kucoin](https://docs.origami.tech/user-guide/api-key-creation/kucoin) [BingX](https://docs.origami.tech/user-guide/api-key-creation/bingx) [Bitget](https://docs.origami.tech/user-guide/api-key-creation/bitget) [BitMart](https://docs.origami.tech/user-guide/api-key-creation/bitmart) [PreviousAdd accounts](https://docs.origami.tech/user-guide/add-accounts) [NextHyperliquid](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid) --- # Gate io | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-one) Step One ---------------------------------------------------------------------------------------- If you haven't already, go to [Gate’s](https://www.gate.io/signup/XlBHVllf?ref_type=103) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-two) Step two ---------------------------------------------------------------------------------------- Verify your account and get started on the API by navigating to API Management. ![gate io api for origami tech, go to api management ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FWxO1d34dSQp57c56hxOy%252Fimage%2520%2818%29.png%3Falt%3Dmedia%26token%3D946cb653-a78c-439e-bec7-515da64c116e&width=768&dpr=4&quality=100&sign=e7109f47&sv=2) ![gate io api for origami tech, create api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FN8gJjbj0pAYZUyjyqOUi%252Fimage%2520%2819%29.png%3Falt%3Dmedia%26token%3Dd3b4eb36-930c-4eb4-a713-6ea4c9d65ca8&width=768&dpr=4&quality=100&sign=4be7f35&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-three) Step Three -------------------------------------------------------------------------------------------- Come up with API Key Remark, add this IP to IP Permissions: **15.235.202.52** Use v4 API Key and Trading Account Choose Spot→ Read and Write, Perpetual Futures → Read and Write, Delivery Futures → Read and Write, Wallet→ Read Only, Option → Read and Write, Comission Details → Read and Write, Account → Read Only, Margin Trading → Read and Write, Loan → Read and Write as shown on the screenshot below Click on submit ![gate io api for origami tech, create api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F1QTMYsx48UPBgSoWQLBR%252Fimage%2520%2820%29.png%3Falt%3Dmedia%26token%3Dce16677c-c09c-4deb-931f-5c539c2d7ce9&width=768&dpr=4&quality=100&sign=11bafd93&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-four) Step Four ------------------------------------------------------------------------------------------ Tick the checkboxes and complete creation with Fund Password, 2FA and Verification Code ![gate io api for origami tech, risk reminder](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FbHSQz72324ulrTpx4HC0%252Fimage%2520%2821%29.png%3Falt%3Dmedia%26token%3D77fa2498-7032-454b-b958-847fdebafede&width=768&dpr=4&quality=100&sign=51b82a9a&sv=2) [PreviousOKX](https://docs.origami.tech/user-guide/api-key-creation/okx) [NextMexc](https://docs.origami.tech/user-guide/api-key-creation/mexc) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-one) * [Step two](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-three) * [Step Four](https://docs.origami.tech/user-guide/api-key-creation/gate-io#step-four) --- # Hyperliquid | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-one) Step One -------------------------------------------------------------------------------------------- If you haven't already, go to [Hyperliquid](https://app.hyperliquid.xyz/join/ORIGAMI) website and connect your wallet [](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-two) Step Two -------------------------------------------------------------------------------------------- To get started you should connect your wallet in the Arbitrum network and make a deposit in USDC ![Hyperliquid API keys for Origami Tech, go to API keys](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FsTQLNQ7N7tm5MUKto23Y%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-23%2520%25D0%25B2%252022.54.18.png%3Falt%3Dmedia%26token%3Da403012f-2dfc-483b-a976-a222929433ab&width=768&dpr=4&quality=100&sign=d6cd477f&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-three) Step Three ------------------------------------------------------------------------------------------------ Connect your wallet and get started by navigating to API Management. ![Hyperliquid API keys for Origami Tech, go to API settings](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FY8DkL1gOBwguH4rFJGru%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-23%2520%25D0%25B2%252022.56.07.png%3Falt%3Dmedia%26token%3Df786812c-a4ee-45b0-95e0-ad9a25c5b21d&width=768&dpr=4&quality=100&sign=86ad8ab5&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-four) Step Four ---------------------------------------------------------------------------------------------- To create API keys you will need to write a name for your future keys and click generate. After successful address generation you should click the "**Authorize API Wallet button"**. ![Hyperliquid API keys for Origami Tech, creating API for origami](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FzqF9IodnO7Y7BA3gQWCD%252FIMG_0010.PNG%3Falt%3Dmedia%26token%3D9feb3c67-5902-440f-96c7-3e87cb10e901&width=768&dpr=4&quality=100&sign=4ae34e37&sv=2) In the pop-up window you will see information about your **API Wallet Address** and **Private Key** [](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#requirements) Requirements ---------------------------------------------------------------------------------------------------- Rules for adding Hyperliquid API keys on Origami platform 1. API KEY - address of your personal wallet from which the deposit was made to Hyperliquid in USDC in the Arbitrum network 2. SECRET KEY - the secret key generated when creating API keys in the API manegement on the Hyperliquid platform HyperLiquid Spot and Futures accounts require you to enter your API keys twice. Please make sure that you select the correct type - HyperLiquid Spot or HyperLiquid Futures - when adding an account, as these accounts belong to different types of exchanges [PreviousAPI Key Creation](https://docs.origami.tech/user-guide/api-key-creation) [NextBinance](https://docs.origami.tech/user-guide/api-key-creation/binance) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-three) * [Step Four](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#step-four) * [Requirements](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid#requirements) --- # Mexc | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-one) Step One ------------------------------------------------------------------------------------- If you haven't already, go to [MEXC](https://www.mexc.com/register?inviteCode=mexc-1DZ7R) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-two) Step Two ------------------------------------------------------------------------------------- Verify your account, add 2FA and get started with creation of sub-account ![mexc api for origami tech, going to sub-account management ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FTpg12G1jebGWTFllvhPz%252Fimage%2520%2822%29.png%3Falt%3Dmedia%26token%3D3199b8f6-682d-4670-b2e6-580611ce9c9e&width=768&dpr=4&quality=100&sign=8c58b707&sv=2) ![mexc api for origami tech, create sub-account ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FWl3hfxOVT4bkyBrvx2sL%252Fimage%2520%2823%29.png%3Falt%3Dmedia%26token%3Db2bc1fad-d68f-4d36-b504-f8ab27c3656e&width=768&dpr=4&quality=100&sign=792c7b6d&sv=2) Choose Trade only trhough the API, no login permissions. ![mexc api for origami tech, select option change through api only](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FpkYYItYTElCKnNQLG0mK%252Fimage%2520%2824%29.png%3Falt%3Dmedia%26token%3Dd72fc823-414e-49e2-b418-c1e4d2415289&width=768&dpr=4&quality=100&sign=ec652ff&sv=2) Add a name to sub-account ![mexc api for origami tech, creating sub-account ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FqTNyGCzYr3h9XzyJXlpP%252Fimage%2520%2825%29.png%3Falt%3Dmedia%26token%3Dd2f78e5d-8b55-4555-9c2f-18e40d1d44e2&width=768&dpr=4&quality=100&sign=d11dd0ae&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-three) Step Three ----------------------------------------------------------------------------------------- Go to Sub-account page and click on API ![mexc api for origami tech, from sub-account go to api set up](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FccZdd1J0l8Z6CwGYqZgE%252Fimage%2520%2826%29.png%3Falt%3Dmedia%26token%3De7a46b76-7df0-4237-98c5-e1c098ac6c28&width=768&dpr=4&quality=100&sign=8012de48&sv=2) Choose Sub-account and click tickboxes as shown below on the screen. Also link this IP address: **15.235.202.52** ![mexc api for origami tech, set up new api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fh4vZDQPRZez8MVFCCEQ4%252Fimage%2520%2827%29.png%3Falt%3Dmedia%26token%3D7488f273-6bd3-4062-bf3e-54a3ba5d47fd&width=768&dpr=4&quality=100&sign=70dfd3eb&sv=2) Click on Create [PreviousGate io](https://docs.origami.tech/user-guide/api-key-creation/gate-io) [NextHTX](https://docs.origami.tech/user-guide/api-key-creation/htx) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/mexc#step-three) --- # Bybit | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-one) Step One -------------------------------------------------------------------------------------- If you haven't already, go to [Bybit's](https://partner.bybit.com/b/85238) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-two) Step Two -------------------------------------------------------------------------------------- Verify your account and get started by navigating to Sub-Account settings ![bybit api for origami tech, go to subaccount menu](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FQ8oLuNUoJH0IvxcwSXjZ%252Fimage%2520%289%29.png%3Falt%3Dmedia%26token%3D8e2524f2-eb5b-4418-8161-87349d85495f&width=768&dpr=4&quality=100&sign=5d6297d2&sv=2) ![bybit api for origami tech, create subaccount](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FZgHB1JcTczVY6q1idJ8p%252Fimage%2520%2810%29.png%3Falt%3Dmedia%26token%3D0426fa1e-8427-4a08-9499-506f750078a4&width=768&dpr=4&quality=100&sign=44b6d51&sv=2) ![bybit api for origami tech, select unified trading subaccount](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FO6whJ3LPiZXaozSBXOGb%252Fimage%2520%2811%29.png%3Falt%3Dmedia%26token%3Db1f10810-b97d-4be4-8825-21fd033b005b&width=768&dpr=4&quality=100&sign=1e82e613&sv=2) Сhoose subaccount name and use Unified Trading Account ![bybit api for origami tech, create subaccount](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FLtbUthWhGTA1Xi0YMOwu%252Fimage%2520%2812%29.png%3Falt%3Dmedia%26token%3D565f89c6-2465-4d96-90b6-dd9f620c7d77&width=768&dpr=4&quality=100&sign=4632dcbb&sv=2) Confirm Subaccount creation via Verification codes [](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-three) Step Three ------------------------------------------------------------------------------------------ Click on Sub-Account settings again After creating Sub-Account, click on Management under API note ![bybit api for origami tech, in subaccount menu click on "management" under API](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FphMSNC3VrR4qgswvcFoS%252Fimage%2520%2813%29.png%3Falt%3Dmedia%26token%3D9f067e96-c144-4661-9516-1ea1e4176df8&width=768&dpr=4&quality=100&sign=aa2d10b5&sv=2) Then, click on Create New Key ![bybit api for origami tech, click create new key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FVWgp3Vi5htmekjEFwVmE%252Fimage%2520%2814%29.png%3Falt%3Dmedia%26token%3D4246bf2f-b226-43ed-a675-bbd55134eba4&width=768&dpr=4&quality=100&sign=4542438f&sv=2) Сhoose System-Generated Key API Keys ![bybit api for origami tech, choose system generated API key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FPIf1GuIAr0F4sxXG6m7d%252Fimage%2520%2815%29.png%3Falt%3Dmedia%26token%3Ddb4eeb88-7168-4d3d-a466-822df13a9f4c&width=768&dpr=4&quality=100&sign=5fb2f0d8&sv=2) ![bybit api for origami tech, set up the API](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FRkthIHcmC6DZv0iO1R8h%252Fimage%2520%2816%29.png%3Falt%3Dmedia%26token%3D9daa7391-2623-4db3-ac9b-d1bc017d8171&width=768&dpr=4&quality=100&sign=e4b967a3&sv=2) Add name to API key, Click on all Tickboxes as shown on the screen, add this IP to whitelist: **15.235.202.52** Click Submit [PreviousBinance](https://docs.origami.tech/user-guide/api-key-creation/binance) [NextOKX](https://docs.origami.tech/user-guide/api-key-creation/okx) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/bybit#step-three) --- # OKX | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/okx#step-one) Step One ------------------------------------------------------------------------------------ If you haven't already, go to [OKX](https://www.okx.com/join/3802272) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/okx#step-two) Step Two ------------------------------------------------------------------------------------ Verify your account, add 2FA and get started with creation of sub-account ![okx api for origami tech, go to sub-accounts menu](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FSlPgKySfHh1pQo7SIabQ%252Ftelegram-cloud-photo-size-4-5949680163946087470-y.jpg%3Falt%3Dmedia%26token%3D34c318ed-1cbe-4298-a4a6-b34262d0d9c6&width=768&dpr=4&quality=100&sign=71360749&sv=2) ![okx api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fz1ifmIJ0JYi7D6zKYmf4%252Ftelegram-cloud-photo-size-4-5949680163946087471-y.jpg%3Falt%3Dmedia%26token%3Df1da6fa2-4385-485d-853e-9f4658487572&width=768&dpr=4&quality=100&sign=85306009&sv=2) Create a login name to Sub-account and use Standard sub-account → click on Submit all ![okx api for origami tech, set up sub-account ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FpYpwgdAy3zygqWWCcTKE%252Ftelegram-cloud-photo-size-4-5949680163946087472-y.jpg%3Falt%3Dmedia%26token%3Db301c50a-792e-40b5-911d-5a4b15e80c35&width=768&dpr=4&quality=100&sign=82dac45&sv=2) Complete creation of Sub-account with 2FA ![okx api for origami tech, 2 factor authentication ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F4Hm9ap9hhwOgy7WNKp6Q%252Ftelegram-cloud-photo-size-4-5949680163946087474-y.jpg%3Falt%3Dmedia%26token%3Ded1ad004-6ddd-466c-9dd5-e6b6cff9ba29&width=768&dpr=4&quality=100&sign=98f80f&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/okx#step-three) Step Three ---------------------------------------------------------------------------------------- Go to Sub-account page and click on Action → Manage API ![okx api for origami tech, go to actions, manage API](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FF0AwAnvm3qga4bnkKUBB%252Ftelegram-cloud-photo-size-4-5949680163946087475-y.jpg%3Falt%3Dmedia%26token%3D4a918924-f55a-4b36-b7c5-75e7291032c6&width=768&dpr=4&quality=100&sign=149677e1&sv=2) Create API Name, choose Account (sub-account if created previously, Main if not). Use API trading Purpose, link this IP address to allowlist: **15.235.202.52** Permissions: Read, Trade Come up with Passphrase (you must remember it) ![okx api for origami tech, set up api](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F0nA3mEWtSHVoZf6FIt6i%252Fimage%2520%2817%29.png%3Falt%3Dmedia%26token%3Db8e43c05-dec0-427d-a0d5-4fd0dac4ed51&width=768&dpr=4&quality=100&sign=8243fa66&sv=2) Click on Submit all and proceed with Email and 2FA to finish API creation [PreviousBybit](https://docs.origami.tech/user-guide/api-key-creation/bybit) [NextGate io](https://docs.origami.tech/user-guide/api-key-creation/gate-io) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/okx#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/okx#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/okx#step-three) --- # HTX | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/htx#step-one) Step One ------------------------------------------------------------------------------------ If you haven't already, go to [HTX’s](https://www.htx.com.pk/invite/en-us/1h?invite_code=ng9f9223) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/htx#step-two) Step Two ------------------------------------------------------------------------------------ Verify your account, add 2FA and get started with creation of sub-account ![htx api for origami tech, create a sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FhbaBL42ufC3DIj8M1n1m%252Fimage%2520%2828%29.png%3Falt%3Dmedia%26token%3D65144d8f-4667-4b0c-9323-608ce628beb3&width=768&dpr=4&quality=100&sign=cf32d9db&sv=2) ![htx api for origami tech, click on Create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2ufRpYZjImWih8onqBUf%252Fimage%2520%2829%29.png%3Falt%3Dmedia%26token%3Dedb3336f-3c6a-4b41-acfc-2792ff72effb&width=768&dpr=4&quality=100&sign=c40c557a&sv=2) Check Sub-Account Name and It’s availability ![htx api for origami tech, check availability](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FzlvfgD0qHKmEHStnwotR%252Fimage%2520%2830%29.png%3Falt%3Dmedia%26token%3D85dc2c49-1d90-49f3-b610-b9e7bfc7aaef&width=768&dpr=4&quality=100&sign=777bf609&sv=2) Complete creation with Security authentication [](https://docs.origami.tech/user-guide/api-key-creation/htx#step-three) Step Three ---------------------------------------------------------------------------------------- Go to Sub-account page and click on Management ![htx api for origami tech, go to sub-account management settings](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FmojzW1dEtJqEGg6FYLGh%252Fimage%2520%2831%29.png%3Falt%3Dmedia%26token%3Dde15be91-a41e-42ac-83a6-3309f84c1fee&width=768&dpr=4&quality=100&sign=d20c1e8e&sv=2) ![htx api for origami tech, click on create api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F0QU6NuiedrycjykdOnKQ%252Fimage%2520%2832%29.png%3Falt%3Dmedia%26token%3D72203fda-0849-474d-92ef-3895b6c40f8e&width=768&dpr=4&quality=100&sign=58e3634&sv=2) Choose System Generated API ![htx api for origami tech, select system generated api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FTwWILKkTSEqEj55BE4oT%252Fimage%2520%2833%29.png%3Falt%3Dmedia%26token%3D24040ab0-16ca-4e40-a281-20ecfad8b503&width=768&dpr=4&quality=100&sign=2f40dd34&sv=2) Create Notes, tick on Trade, add this IP: **15.235.202.52** Click on Create HMAC API ![htx api for origami tech, set up the api](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FnzL1HFQYJKSJfQF3RcJb%252Fimage%2520%2834%29.png%3Falt%3Dmedia%26token%3D2a53a3bb-a63f-411f-9955-13cda61984ea&width=768&dpr=4&quality=100&sign=45fc3ff7&sv=2) Tick boxes in Risk Reminder page ![htx api for origami tech, risk reminder settings](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FkXBMPCvfk66cBifCnyWg%252Fimage%2520%2835%29.png%3Falt%3Dmedia%26token%3Dfbb05a1c-b4fc-44eb-bf26-3279bb24a118&width=768&dpr=4&quality=100&sign=1185f677&sv=2) Complete with Verification [PreviousMexc](https://docs.origami.tech/user-guide/api-key-creation/mexc) [NextKucoin](https://docs.origami.tech/user-guide/api-key-creation/kucoin) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/htx#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/htx#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/htx#step-three) --- # Create Spot Bot | Origami Documentation [](https://docs.origami.tech/user-guide/create-spot-bot#step-1-adding-a-new-bot) **Step 1: Adding a New Bot** ------------------------------------------------------------------------------------------------------------------ ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-open-the-bots-section) 1\. **Open the "Bots" section** In the top menu of your platform, locate and click on the "Bots" tab. This page displays any existing bots (if available). ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-click-add-bot) 2\. **Click "Add Bot"** To create a new bot, click the "Add Bot" button located in the top-right corner of the screen, as indicated by the arrow in the screenshot. ![how to create spot bot on Origami tech, click "add bot" ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fq6o6FQVry5oOoE9uCzTK%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252013.23.04.png%3Falt%3Dmedia%26token%3Df67a8061-5a9b-4e25-9976-3161b6261f26&width=768&dpr=4&quality=100&sign=76be5636&sv=2) [](https://docs.origami.tech/user-guide/create-spot-bot#step-2-entering-bot-information) **Step 2: Entering Bot Information** ---------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-provide-the-basic-information-about-the-bot) 1\. Provide the basic information about the bot A form will appear for entering the details of the new bot. Fill in the following fields: * **Bot Name**: Enter the name of your bot (e.g., "Grid\_bot"). * **Account**: Select the exchange account that the bot will operate on. * **Coins**: Specify the base currency (_Base Coin_) and the counter currency (_Counter Coin_) for the trading pair. ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-click-next) 2\. Click "Next" After entering the required information, click the "Next" button to proceed to the next step. ![how to create a spot bot in origami tech, fill in bot details](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2ha47BAeSo0Q7Kp7wv7r%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252013.51.34.png%3Falt%3Dmedia%26token%3Dcc5f7eee-ff2d-4421-b1b1-c3b23dec4d6c&width=768&dpr=4&quality=100&sign=a00c1a1a&sv=2) [](https://docs.origami.tech/user-guide/create-spot-bot#step-3-configuring-trading-bot-parameters) **Step 3: Configuring Trading Bot Parameters** ------------------------------------------------------------------------------------------------------------------------------------------------------ ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-set-strategy-parameters) 1\. **Set Strategy Parameters** In this step, you need to define the parameters that will guide the bot's trading actions: * [**execute\_price**](https://docs.origami.tech/function/required-parameters/execute-price#execute_price-decimal-or-formula-greater-than-decimal) : Specify the execution price. You can use the `ticker()` function to automatically set the current price. * [**execute\_volume**](https://docs.origami.tech/function/required-parameters/execute-volume#execute_volume-decimal-or-formula-greater-than-decimal) : Enter the trading volume in units of the base currency. * [**buy\_orders\_count**](https://docs.origami.tech/function/required-parameters/buy-orders-count#buy_orders_count-integer-or-formula-greater-than-integer) and [**sell\_orders\_count**](https://docs.origami.tech/function/required-parameters/sell-orders-count#sell_orders_count-integer-or-formula-greater-than-integer) : Define the number of buy and sell orders the bot should place. ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-save-configuration) 2\. **Save Configuration** After setting all the parameters, click **Save** to store the bot's configuration. The bot will now be ready to operate based on the defined trading strategy. ![setting up the new spot trading bot](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FGpeHrfPRfo7lYTQxooBn%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252016.48.39.png%3Falt%3Dmedia%26token%3D63e6b74e-3b68-426b-939c-51c45ad73bb8&width=768&dpr=4&quality=100&sign=6395ed0e&sv=2) [](https://docs.origami.tech/user-guide/create-spot-bot#step-4-import-preset) Step 4: Import Preset -------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-select-a-preset) 1\. Select a Preset * Click the **Import Preset** button. * In the pop-up window, choose the desired preset from the list. * You can switch between **Bot** (global strategies) and **Grid** (order grids) categories. ![import preset to the origami spot bot ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FRMfgSwqiR7kjMqNv6vnX%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252014.44.54.png%3Falt%3Dmedia%26token%3Dd99d652e-9a33-4f97-9e53-fff946607de2&width=768&dpr=4&quality=100&sign=f2c0b4a&sv=2) ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-import-settings) 2\. Import Settings * Review the preset parameters on the right side of the window. * Click **Import** to load the selected configuration. ![importing preset settings for spot bot on Origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fr9ZILqtoTV7fkYWw9afy%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252014.43.31.png%3Falt%3Dmedia%26token%3Ddd763abe-6bbe-4bbc-bbfa-87e3cec6f8af&width=768&dpr=4&quality=100&sign=c5c1a6d1&sv=2) ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-3.-modifying-parameters-before-importing) 3\. Modifying Parameters Before Importing * After selecting a preset, its parameters will be displayed on the right side of the window. * The values of the variables can be modified before importing, allowing users to customize the strategy to fit their needs. ![modifying the preset settings on origami tech ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FnPXWbIJ5pSwWfwbtWMsq%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252014.51.32.png%3Falt%3Dmedia%26token%3Dbb55c47b-e54b-44eb-9c8f-ce4d2835a968&width=768&dpr=4&quality=100&sign=dc6ca5d3&sv=2) ### [](https://docs.origami.tech/user-guide/create-spot-bot#id-4.-edit-and-launch) 4\. Edit and Launch * After importing, the preset parameters will automatically fill in the bot creation form. * You can modify them before saving. * Click **Save** to save the bot or **Save and Exit** to exit. * * * [PreviousBitMart](https://docs.origami.tech/user-guide/api-key-creation/bitmart) [NextCreate Futures Bot](https://docs.origami.tech/user-guide/create-futures-bot) Last updated 1 month ago * [Step 1: Adding a New Bot](https://docs.origami.tech/user-guide/create-spot-bot#step-1-adding-a-new-bot) * [1\. Open the "Bots" section](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-open-the-bots-section) * [2\. Click "Add Bot"](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-click-add-bot) * [Step 2: Entering Bot Information](https://docs.origami.tech/user-guide/create-spot-bot#step-2-entering-bot-information) * [1\. Provide the basic information about the bot](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-provide-the-basic-information-about-the-bot) * [2\. Click "Next"](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-click-next) * [Step 3: Configuring Trading Bot Parameters](https://docs.origami.tech/user-guide/create-spot-bot#step-3-configuring-trading-bot-parameters) * [1\. Set Strategy Parameters](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-set-strategy-parameters) * [2\. Save Configuration](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-save-configuration) * [Step 4: Import Preset](https://docs.origami.tech/user-guide/create-spot-bot#step-4-import-preset) * [1\. Select a Preset](https://docs.origami.tech/user-guide/create-spot-bot#id-1.-select-a-preset) * [2\. Import Settings](https://docs.origami.tech/user-guide/create-spot-bot#id-2.-import-settings) * [3\. Modifying Parameters Before Importing](https://docs.origami.tech/user-guide/create-spot-bot#id-3.-modifying-parameters-before-importing) * [4\. Edit and Launch](https://docs.origami.tech/user-guide/create-spot-bot#id-4.-edit-and-launch) --- # Required parameters | Origami Documentation [](https://docs.origami.tech/function/required-parameters#buy_orders_count) [`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Responsible for the number of buy orders placed. [](https://docs.origami.tech/function/required-parameters#sell_orders_count) [`sell_orders_count`](https://docs.origami.tech/function/required-parameters#sell_orders_count-integer-or-formula-greater-than-integer) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Responsible for the number of sell orders placed. [](https://docs.origami.tech/function/required-parameters#execute_price) [`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Determines the price of the orders being placed. [](https://docs.origami.tech/function/required-parameters#execute_volume) [`execute_volume`](https://docs.origami.tech/function/required-parameters/execute-volume) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Specifies the amount to be placed, denominated in the base token. An example of a simple grid[](https://docs.origami.tech/function/required-parameters#an-example-of-a-simple-grid) The grid will place two sell orders and two buy orders, each with a 0.5% increment from the current market price. The order amount will be 10 divided by the current market price. Copy { "execute_price": "ticker()*(1+0.005*order_pos)", "execute_volume": "10/ticker()", "buy_orders_count": "2", "sell_orders_count": "2" } [PreviousBuying and Selling When the 15-Minute RSI Exits a Defined Range](https://docs.origami.tech/user-guide/grids-examples/buying-and-selling-when-the-15-minute-rsi-exits-a-defined-range) [NextBuy Orders Count](https://docs.origami.tech/function/required-parameters/buy-orders-count) Last updated 1 year ago --- # Bitget | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-one) Step One --------------------------------------------------------------------------------------- If you haven't already, go to [Bitget](https://www.bitget.com/) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-two) Step Two --------------------------------------------------------------------------------------- Verify your account and get started with creation of sub-account ![sub account creation, bitget api for origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FB1zVNVKzLBl7aAROr3uL%252Fimage%2520%2848%29.png%3Falt%3Dmedia%26token%3D0afe246e-45e4-444d-8977-df0f9990423d&width=768&dpr=4&quality=100&sign=a01d854d&sv=2) ![ bitget api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FyPhErA9bzakCuXaVQwFo%252Fimage%2520%2849%29.png%3Falt%3Dmedia%26token%3D9e6334e7-b5e7-4455-ab53-8d3e10c2ef31&width=768&dpr=4&quality=100&sign=9ad9128f&sv=2) ![ bitget api for origami tech, select virtual sub account ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FBn1Zr8j9qGb9H4FcVqtn%252Fimage%2520%2850%29.png%3Falt%3Dmedia%26token%3Dbc9cee87-c2b2-4f00-8f54-913537697e83&width=768&dpr=4&quality=100&sign=593e547&sv=2) Choose Virtual sub-account, add a name to sub-account [](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-three) Step Three ------------------------------------------------------------------------------------------- Go to Sub-account page and click on API management ![ bitget api for origami tech, go to api management ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2HccOwcB2cgKINLYqlnR%252Fimage%2520%2851%29.png%3Falt%3Dmedia%26token%3D0b8d3908-37ab-4355-875d-3262629a739f&width=768&dpr=4&quality=100&sign=fc307504&sv=2) ![ bitget api for origami tech, create api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FyI4EaFWe6HXIiGXyPOjl%252Fimage%2520%2852%29.png%3Falt%3Dmedia%26token%3Df73f5977-6a02-466d-b94a-c73876b03d95&width=768&dpr=4&quality=100&sign=95ac1495&sv=2) ![ bitget api for origami tech, select system generated api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FJOnrFZhbcUWWLKYIXzAS%252Fimage%2520%2853%29.png%3Falt%3Dmedia%26token%3D0bf66549-b179-4f1c-96b9-6b40958d7075&width=768&dpr=4&quality=100&sign=10f5f367&sv=2) Choose System-generated API key. Add Note, Passphrase (You must remember), Read-write permission, Futures → Orders, Holdings, Spot → Trade, Margin → Trade, Wallet → Transfer and bind this IP address to API keys: **15.235.202.52** Complete Security Verification. [PreviousBingX](https://docs.origami.tech/user-guide/api-key-creation/bingx) [NextBitMart](https://docs.origami.tech/user-guide/api-key-creation/bitmart) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/bitget#step-three) --- # Create Futures Bot | Origami Documentation [](https://docs.origami.tech/user-guide/create-futures-bot#step-1-adding-a-new-bot) **Step 1: Adding a New Bot** --------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-open-the-bots-section) 1\. **Open the "Bots" section** In the top menu of your platform, locate and click on the "Bots" tab. This page displays any existing bots (if available). ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-click-add-bot) 2\. **Click "Add Bot"** To create a new bot, click the "Add Bot" button located in the top-right corner of the screen, as indicated by the arrow in the screenshot. ![Create Futures Bot on Origami tech, click "add bot" in the top right corner](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fq6o6FQVry5oOoE9uCzTK%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252013.23.04.png%3Falt%3Dmedia%26token%3Df67a8061-5a9b-4e25-9976-3161b6261f26&width=768&dpr=4&quality=100&sign=76be5636&sv=2) [](https://docs.origami.tech/user-guide/create-futures-bot#step-2-entering-bot-information) **Step 2: Entering Bot Information** ------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-provide-the-basic-information-about-the-bot) 1\. Provide the basic information about the bot A form will appear for entering the details of the new bot. Fill in the following fields: * **Bot Name**: Enter the name of your bot (e.g., "Grid\_bot"). * **Account**: Select the exchange account that the bot will operate on. * **Coins**: Specify the base currency (_Base Coin_) and the counter currency (_Counter Coin_) for the trading pair. * **Margin Mode**: Choose between **Cross** and **Isolated** margin mode. * **Leverage**: Select the leverage level for the bot. Higher leverage increases potential profits but also increases risk. ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-click-next) 2\. Click "Next" After entering the required information, click the "Next" button to proceed to the next step. ![setting up Create Futures Bot in origami tech ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FhpDRGso0uQVxcYmBa53j%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252015.15.02.png%3Falt%3Dmedia%26token%3Da8bbe031-1af9-48f3-a853-13a8582018b7&width=768&dpr=4&quality=100&sign=3bd6f303&sv=2) [](https://docs.origami.tech/user-guide/create-futures-bot#step-3-configuring-trading-bot-parameters) **Step 3: Configuring Trading Bot Parameters** --------------------------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-set-strategy-parameters) 1\. **Set Strategy Parameters** In this step, you need to define the parameters that will guide the bot's trading actions: * [**execute\_price**](https://docs.origami.tech/function/required-parameters/execute-price#execute_price-decimal-or-formula-greater-than-decimal) : Specify the execution price. You can use the `ticker_futures()` function to automatically set the current price. * [**execute\_volume**](https://docs.origami.tech/function/required-parameters/execute-volume#execute_volume-decimal-or-formula-greater-than-decimal) : Enter the trading volume in units of the base currency. * [**buy\_orders\_count**](https://docs.origami.tech/function/required-parameters/buy-orders-count#buy_orders_count-integer-or-formula-greater-than-integer) and [**sell\_orders\_count**](https://docs.origami.tech/function/required-parameters/sell-orders-count#sell_orders_count-integer-or-formula-greater-than-integer) : Define the number of buy and sell orders the bot should place. ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-save-configuration) 2\. **Save Configuration** After setting all the parameters, click **Save** to store the bot's configuration. The bot will now be ready to operate based on the defined trading strategy. ![Step 3: Configuring Trading Bot Parameters on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FLYIdK6F1ieTaB44oSDxb%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252015.29.31.png%3Falt%3Dmedia%26token%3D88630cb6-2929-4647-a009-42feec8d39e3&width=768&dpr=4&quality=100&sign=5059027d&sv=2) [](https://docs.origami.tech/user-guide/create-futures-bot#step-4-import-preset) Step 4: Import Preset ----------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-select-a-preset) 1\. Select a Preset * Click the **Import Preset** button. * In the pop-up window, choose the desired preset from the list. * You can switch between **Bot** (global strategies) and **Grid** (order grids) categories. ![importing project preset for futures trading bot on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FKvghy4IEnoIPsN58fGOl%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252015.38.37.png%3Falt%3Dmedia%26token%3De729c649-3165-4fc1-8ee4-64d1356c15aa&width=768&dpr=4&quality=100&sign=40a73309&sv=2) ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-import-settings) 2\. Import Settings * Review the preset parameters on the right side of the window. * Click **Import** to load the selected configuration. ![importing future bot settings on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FOrV2QPlvqLjrkdz1B9ba%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252015.37.04.png%3Falt%3Dmedia%26token%3D880f2f30-31e1-44e4-a8a3-12773b6fcc71&width=768&dpr=4&quality=100&sign=82c60ccd&sv=2) ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-3.-modifying-parameters-before-importing) 3\. Modifying Parameters Before Importing * After selecting a preset, its parameters will be displayed on the right side of the window. * The values of the variables can be modified before importing, allowing users to customize the strategy to fit their needs. ![Modifying Parameters Before Importing in origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FCxpcmQAvMPXxxJEqdYcl%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202025-03-03%2520%25D0%25B2%252015.37.32.png%3Falt%3Dmedia%26token%3D8f7bf4c7-fd2a-4132-872f-dd8d9a0af76d&width=768&dpr=4&quality=100&sign=af2d8af9&sv=2) ### [](https://docs.origami.tech/user-guide/create-futures-bot#id-4.-edit-and-launch) 4\. Edit and Launch * After importing, the preset parameters will automatically fill in the bot creation form. * You can modify them before saving. * Click **Save** to save the bot or **Save and Exit** to exit. * * * [PreviousCreate Spot Bot](https://docs.origami.tech/user-guide/create-spot-bot) [NextCreate Grid](https://docs.origami.tech/user-guide/create-grid) Last updated 1 month ago * [Step 1: Adding a New Bot](https://docs.origami.tech/user-guide/create-futures-bot#step-1-adding-a-new-bot) * [1\. Open the "Bots" section](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-open-the-bots-section) * [2\. Click "Add Bot"](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-click-add-bot) * [Step 2: Entering Bot Information](https://docs.origami.tech/user-guide/create-futures-bot#step-2-entering-bot-information) * [1\. Provide the basic information about the bot](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-provide-the-basic-information-about-the-bot) * [2\. Click "Next"](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-click-next) * [Step 3: Configuring Trading Bot Parameters](https://docs.origami.tech/user-guide/create-futures-bot#step-3-configuring-trading-bot-parameters) * [1\. Set Strategy Parameters](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-set-strategy-parameters) * [2\. Save Configuration](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-save-configuration) * [Step 4: Import Preset](https://docs.origami.tech/user-guide/create-futures-bot#step-4-import-preset) * [1\. Select a Preset](https://docs.origami.tech/user-guide/create-futures-bot#id-1.-select-a-preset) * [2\. Import Settings](https://docs.origami.tech/user-guide/create-futures-bot#id-2.-import-settings) * [3\. Modifying Parameters Before Importing](https://docs.origami.tech/user-guide/create-futures-bot#id-3.-modifying-parameters-before-importing) * [4\. Edit and Launch](https://docs.origami.tech/user-guide/create-futures-bot#id-4.-edit-and-launch) --- # Kucoin | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-one) Step One --------------------------------------------------------------------------------------- If you haven't already, go to [Kucoin's](https://www.kucoin.com/r/af/rJ3943S) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-two) Step Two --------------------------------------------------------------------------------------- Verify your account, add 2FA and get started with creation of sub-account ![kucoin api for origami tech, go to sub-account settings ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FT7n7vFfvrQIRlmD9JtUU%252Fimage%2520%2836%29.png%3Falt%3Dmedia%26token%3D3ea7731c-ad69-4179-87d7-e54ef0a169ef&width=768&dpr=4&quality=100&sign=6a6b23b2&sv=2) ![kucoin api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fa3Y7Q74hwxxy5Dqfp9Zv%252Fimage%2520%2837%29.png%3Falt%3Dmedia%26token%3Da41e6da8-a6df-458c-8d23-cb5f5d088e74&width=768&dpr=4&quality=100&sign=2ee73f9f&sv=2) Add a name to sub-account, click on all permissions, add your Login Password and choose General Sub-Account ![kucoin api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F6DeBP3HMPoXCttPVzFBG%252Fimage%2520%2838%29.png%3Falt%3Dmedia%26token%3D51701277-35e9-4123-9e97-3bc66ef78b21&width=768&dpr=4&quality=100&sign=1304c15b&sv=2) Complete creation with 2FA and your trading password [](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-three) Step Three ------------------------------------------------------------------------------------------- Go to Sub-account page and click on Settings → View API ![kucoin api for origami tech, view api ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FeMp0cHlXrP3KVIHoqoer%252Fimage%2520%2839%29.png%3Falt%3Dmedia%26token%3D7a71f516-dc2c-4416-af97-6d3387dda53d&width=768&dpr=4&quality=100&sign=f1fcc5df&sv=2) Choose a Name for API, Add Passphrase (You must remember), add Spot Trading permission. Click on “Yes” in IP Restriction setting, add this IP: **15.235.202.52** and click on “Add” ![kucoin api for origami tech, create api](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F9PxLtJz7hoyMCNvUXGFf%252Fimage%2520%2841%29.png%3Falt%3Dmedia%26token%3Db5a8d32c-79d4-44dd-94f6-2c29bc767f4c&width=768&dpr=4&quality=100&sign=6ecfbbff&sv=2) [PreviousHTX](https://docs.origami.tech/user-guide/api-key-creation/htx) [NextBingX](https://docs.origami.tech/user-guide/api-key-creation/bingx) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/kucoin#step-three) --- # Sleep After Seconds | Origami Documentation [](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds#sleep_after_seconds-greater-than-decimal) `sleep_after_seconds` -> decimal ------------------------------------------------------------------------------------------------------------------------------------------------------------- Time to sleep after grid execution (seconds). Accepts values of integer and decimal types. It is possible to use `formula` as value. Example:[](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds#example) The orders will be executed with a delay of 300 seconds between executions. `“sleep_after_seconds”: “300"` * * * The orders will be executed with a random delay of 30 - 90 seconds between executions. `“sleep_after_seconds”: “60*(0.5+`[`random`](https://docs.origami.tech/function/functions/random) `())"` Copy 60 * (0.5 + random()) [PreviousTime Between Orders](https://docs.origami.tech/function/optional-parameters/time-between-orders) [NextIs Buy First](https://docs.origami.tech/function/optional-parameters/is-buy-first) Last updated 1 year ago --- # Optional parameters | Origami Documentation [](https://docs.origami.tech/function/optional-parameters#time_between_orders) [`time_between_orders`](https://docs.origami.tech/function/optional-parameters/time-between-orders) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Execute orders one by one with delay in seconds. [](https://docs.origami.tech/function/optional-parameters#sleep_after_seconds) [`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Time to sleep after grid execution in seconds. [](https://docs.origami.tech/function/optional-parameters#is_buy_first) [`is_buy_first`](https://docs.origami.tech/function/optional-parameters/is-buy-first) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Should buy orders place first or not. An example of a simple grid[](https://docs.origami.tech/function/optional-parameters#an-example-of-a-simple-grid) The grid will place two sell orders and two buy orders, each at a 0.5% increment from the current market price. The order amount will be calculated as 10 divided by the current market price. Orders will be placed at 1-second intervals, with a 60-second gap between each cycle. Sell orders will be placed first. Copy { "execute_price": "ticker()*(1+0.005*order_pos)", "execute_volume": "10/ticker()", "buy_orders_count": "2", "sell_orders_count": "2", "time_between_orders": "1", "sleep_after_seconds": "60", "is_buy_first": "0" } [PreviousBase logic](https://docs.origami.tech/function/base-logic) [NextTime Between Orders](https://docs.origami.tech/function/optional-parameters/time-between-orders) Last updated 1 year ago --- # BitMart | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-one) Step One ---------------------------------------------------------------------------------------- If you haven't already, go to [Bitmart's](https://www.bitmart.com/) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-two) Step Two ---------------------------------------------------------------------------------------- Verify your account and get started on the API by navigating to API Management. ![bitmart api for origami tech, api management ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FWZD0heX25VJ4GTj5LGVI%252Fimage%2520%2854%29.png%3Falt%3Dmedia%26token%3D1ba617a0-983f-4e35-99b5-0fb7113f0605&width=768&dpr=4&quality=100&sign=afbeab5d&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-three) Step Three -------------------------------------------------------------------------------------------- ![bitmart api for origami tech, set up api](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FIg3n3vOWajp7FYOonsU1%252Fimage%2520%2855%29.png%3Falt%3Dmedia%26token%3Df41a8849-5477-4c41-adb9-faa18b6ca290&width=768&dpr=4&quality=100&sign=17459feb&sv=2) Add Memo, which you will remember, click on Spot-Trade, Margin-Trade, Future-Trade and add this IP to be binded: **15.235.202.52** [PreviousBitget](https://docs.origami.tech/user-guide/api-key-creation/bitget) [NextCreate Spot Bot](https://docs.origami.tech/user-guide/create-spot-bot) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/bitmart#step-three) --- # Time Between Orders | Origami Documentation [](https://docs.origami.tech/function/optional-parameters/time-between-orders#time_between_orders-greater-than-decimal) `time_between_orders` \-> _decimal_ ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Execute orders one by one with `time_between_orders` delay (seconds) Doesn’t support custom formulas. [PreviousOptional parameters](https://docs.origami.tech/function/optional-parameters) [NextSleep After Seconds](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) Last updated 1 year ago --- # Binance | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/binance#step-one) Step One ---------------------------------------------------------------------------------------- If you haven't already, go to [Binance's](https://accounts.binance.com/register?ref=36381716) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/binance#step-two) **Step Two** -------------------------------------------------------------------------------------------- Verify your account and get started with creation of sub-account ![binance API for origami tech, go to Account management menu](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FUUT4R0p9tRVWDUIRBP9g%252Fimage.png%3Falt%3Dmedia%26token%3D7096685e-9771-4fae-ad05-3c35af806d2b&width=768&dpr=4&quality=100&sign=3e47ba4e&sv=2) ![binance api for origami tech, click on "create sub account" ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FFIBEzJM68PaqaKM4X7Fr%252Fimage%2520%281%29.png%3Falt%3Dmedia%26token%3Def8c890b-4b48-4f91-bc67-fd75bba62474&width=768&dpr=4&quality=100&sign=b58ac572&sv=2) ![binance api for origami tech, name the account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FNp98NDvIVIAvsoBx3gJr%252Fimage%2520%282%29.png%3Falt%3Dmedia%26token%3D1da89920-c702-4d01-9ab4-8a747f315293&width=768&dpr=4&quality=100&sign=8cd03c0c&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/binance#step-three) Step Three -------------------------------------------------------------------------------------------- ![binance api for origami tech, go to API management ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FekjKjoIJfK8edE0Q4WUf%252Fimage%2520%283%29.png%3Falt%3Dmedia%26token%3D1a445c5e-08ce-4519-b067-6b46f291fc94&width=768&dpr=4&quality=100&sign=d05eb193&sv=2) ![binance api for origami tech, select system generated API key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FOoeRf1CK1gkUu3q4mot3%252Fimage%2520%284%29.png%3Falt%3Dmedia%26token%3Dfff490dc-db39-42b6-933d-adcd8d574367&width=768&dpr=4&quality=100&sign=da8d87ea&sv=2) Click on “Create API”, select “System generated API Key” and click on Next. ![binance api for origami tech, select sub account and give a label to the API key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FdwHhUlk2F0OOwy1RJ4Dg%252Fimage%2520%285%29.png%3Falt%3Dmedia%26token%3D7b4f3c5c-ce0c-476c-9236-917d4dfe70e6&width=768&dpr=4&quality=100&sign=46e92d17&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/binance#step-four) Step Four ------------------------------------------------------------------------------------------ ![binance api for origami tech, go through security verification](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fpz00QEN55Ua7Hpnqo4Ao%252Fimage%2520%287%29.png%3Falt%3Dmedia%26token%3D4a15eb14-4f47-4747-a5df-156b59ee05b1&width=768&dpr=4&quality=100&sign=a3c19ed5&sv=2) To complete the puzzle, slide the puzzle piece into place. Afterwards, you must verify your API Keys by using all of the following methods: phone number verification code, email verification code, and authenticator code. [](https://docs.origami.tech/user-guide/api-key-creation/binance#step-five) **Step Five** ---------------------------------------------------------------------------------------------- Enable Restrict access to trusted IP’s only. Add **15.235.202.52** and click Confirm ![binance api for origami tech, set up API](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2KTVANiGgy2yrQhlnhDL%252Fimage%2520%288%29.png%3Falt%3Dmedia%26token%3Df1c521cf-77f1-423e-a60d-0dfa4e9c942e&width=768&dpr=4&quality=100&sign=fb70f27a&sv=2) [PreviousHyperliquid](https://docs.origami.tech/user-guide/api-key-creation/hyperliquid) [NextBybit](https://docs.origami.tech/user-guide/api-key-creation/bybit) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/binance#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/binance#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/binance#step-three) * [Step Four](https://docs.origami.tech/user-guide/api-key-creation/binance#step-four) * [Step Five](https://docs.origami.tech/user-guide/api-key-creation/binance#step-five) --- # Placing Buy and Sell Orders Based on RSI of 15-Minute Candlesticks | Origami Documentation Orders are placed at levels corresponding to an RSI of 40 for buy orders and an RSI of 60 for sell orders, or at the best bid or ask price if the RSI moves outside the specified range. Copy { "gap": "0.005", "min_low": "orderbook().bid[0].price", "max_high": "orderbook().ask[0].price", "price_low": "min(rsi_to_price(candles_15m, rsi_expected=40), orderbook().ask[0].price, min_low)", "price_high": "max(rsi_to_price(candles_15m, rsi_expected=60), orderbook().bid[0].price, max_high)", "candles_15m": "candles('m15')", "execute_price": "(price_low if side == 'buy' else price_high) * ( 1 + gap * order_pos)", "execute_volume": "cached(60, respect='order_pos')(10/execute_price *abs(order_pos))", "buy_orders_count": "5", "sell_orders_count": "5", "sleep_after_seconds": "900" } In this example, 15-minute candlestick data is used to estimate the price levels that would correspond to an RSI of 40 and 60 in the next period. [`rsi_to_price`](https://docs.origami.tech/function/technical-analysis/rsi-to-price) `(candles_15m, rsi_expected=40)` [`rsi_to_price`](https://docs.origami.tech/function/technical-analysis/rsi-to-price) `(candles_15m, rsi_expected=60)` Bids are placed at RSI 40, and asks are placed at RSI 60 with a price increment of 0.5%, which is defined in the parameter "gap". Buy orders are placed at the RSI 40 level. Sell orders are placed at the RSI 60 level. A price increment is 0.5%, as specified by the gap parameter. The volume for each order is calculated as the equivalent of 10 counter tokens multiplied by the order's sequence number. `10/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `*`[`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)` The order grid is updated every 15 minutes. `"`[`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) `": "900"` [PreviousPlacing Orders with a Spread Based on Historical Data](https://docs.origami.tech/user-guide/grids-examples/placing-orders-with-a-spread-based-on-historical-data) [NextBuying and Selling When the 15-Minute RSI Exits a Defined Range](https://docs.origami.tech/user-guide/grids-examples/buying-and-selling-when-the-15-minute-rsi-exits-a-defined-range) Last updated 11 months ago --- # BingX | Origami Documentation [](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-one) Step One -------------------------------------------------------------------------------------- If you haven't already, go to [BingX’s](https://bingx.com/) website and create an account. Proceed with KYC. [](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-two) Step Two -------------------------------------------------------------------------------------- Verify your account and get started with creation of sub-account ![bingx api for origami tech, go to sub-account settings](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F7VbhP2nBZSmwCOp9k4vX%252Fimage%2520%2842%29.png%3Falt%3Dmedia%26token%3Da66a3e0a-46b1-48cd-b706-98ebd669fb41&width=768&dpr=4&quality=100&sign=2fec6125&sv=2) ![bingx api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F6nuQ3wWvBr3B3hsejL1J%252Fimage%2520%2843%29.png%3Falt%3Dmedia%26token%3D0ecc2f55-691d-4a50-91f3-5d4a71e01a14&width=768&dpr=4&quality=100&sign=c1c1059c&sv=2) [](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-three) Step Three ------------------------------------------------------------------------------------------ ![bingx api for origami tech, create sub-account](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FnUEWekASrpdha0xZ1xWk%252Fimage%2520%2843%29.png%3Falt%3Dmedia%26token%3D032c9e77-48fe-4dae-a701-a4ac1d59dc26&width=768&dpr=4&quality=100&sign=ccb2003e&sv=2) ![bingx api for origami tech, go to api management settings](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fyq8ZvwozUID4g9pu5nrx%252Fimage%2520%2846%29.png%3Falt%3Dmedia%26token%3D4e7121a8-fabd-4a61-aaf5-3a61dd4d24a8&width=768&dpr=4&quality=100&sign=b5085372&sv=2) Click "Create API," choose the account, give it a name, enter the email code and Google Authenticator code. Stick with the Main account unless you're using sub-accounts. [](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-four) Step Four ---------------------------------------------------------------------------------------- Label the API key, Tick on Spot Trading and Perpetuals Futures Trading, add this IP to Whitelist: **15.235.202.52** ![bingx api for origami tech, create api key](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FS9SbhvBlEaDiSRlPOCPo%252Fimage%2520%2847%29.png%3Falt%3Dmedia%26token%3D0ae7df23-babc-4866-a908-734a0cd570b1&width=768&dpr=4&quality=100&sign=64937c03&sv=2) Click Confirm [PreviousKucoin](https://docs.origami.tech/user-guide/api-key-creation/kucoin) [NextBitget](https://docs.origami.tech/user-guide/api-key-creation/bitget) Last updated 1 month ago * [Step One](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-one) * [Step Two](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-two) * [Step Three](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-three) * [Step Four](https://docs.origami.tech/user-guide/api-key-creation/bingx#step-four) --- # Grids Examples | Origami Documentation Grid 1: [Selling at the Best Price with Minimum Price and Balance Constraints](https://docs.origami.tech/user-guide/grids-examples/selling-at-the-best-price-with-minimum-price-and-balance-constraints) [](https://docs.origami.tech/user-guide/grids-examples#grid-1-selling-at-the-best-price-with-minimum-price-and-balance-constraints) Copy { "gap": "0.005", "execute_price": "max(orderbook().ask[0].price-symbol().price_precision,min_ask_price)*(1+gap*(order_pos-1))", "min_ask_price": "orderbook().bid[0].price+symbol().price_precision", "execute_volume": "10/execute_price+abs(order_pos)*10/execute_price", "buy_orders_count": "0", "sell_orders_count": "5 if balance('counter').total < 5000 else 0" } Grid 2: [Selling at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/selling-at-the-best-price-considering-historical-data) [](https://docs.origami.tech/user-guide/grids-examples#grid-2-selling-at-the-best-price-considering-historical-data) Copy { "gap": "0.01", "candles_1d": "candles('d1', 'base-counter',count=30)", "execute_price": "max(orderbook().ask[0].price-symbol().price_precision,(month_mean_high+month_mean_close)/2,min_ask_price)*(1+gap*(order_pos-1))", "min_ask_price": "max(month_mean_close,orderbook().bid[0].price+symbol().price_precision*2)", "execute_volume": "10/execute_price if execute_price 5000 else 0", "sell_orders_count": "0" } Grid 4: [Buying at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/buying-at-the-best-price-considering-historical-data) [](https://docs.origami.tech/user-guide/grids-examples#grid-4-buying-at-the-best-price-considering-historical-data) Copy { "gap": "0.01", "candles_1d": "candles('d1', 'base-counter',count=30)", "execute_price": "min(orderbook().bid[0].price+symbol().price_precision,(month_mean_low+month_mean_close)/2,max_bid_price)*(1+gap*(order_pos+1))", "max_bid_price": "min(month_mean_close,orderbook().ask[0].price-symbol().price_precision*2)", "execute_volume": "10/execute_price if execute_price>month_mean_low else (10/execute_price+abs(order_pos)*10/execute_price)", "month_mean_low": "mean([price.low for price in candles_1d])", "buy_orders_count": "5 if balance('counter').total > 5000 else 0", "month_mean_close": "mean([price.close for price in candles_1d])", "sell_orders_count": "0" } Grid 5: [Placing Orders at the Best Price or with a Minimum Spread](https://docs.origami.tech/user-guide/grids-examples/placing-orders-at-the-best-price-or-with-a-minimum-spread) [](https://docs.origami.tech/user-guide/grids-examples#grid-5-placing-orders-at-the-best-price-or-with-a-minimum-spread) Copy { "gap": "0.005", "min_spread": "0.02", "pivot_price": "(orderbook().ask[0].price+orderbook().bid[0].price+ticker())/3", "execute_price": "(pivot_price*(1-min_spread/2+(order_pos+1)*gap) if pivot_price*(1-min_spread/2)<=(orderbook().bid[0].price+symbol().price_precision) else min(orderbook().bid[0].price + symbol().price_precision,orderbook().ask[0].price - symbol().price_precision)*(1+gap*(order_pos+1))) if side=='buy' else (pivot_price*(1+min_spread/2+(order_pos-1)*gap) if pivot_price*(1+min_spread/2)>=(orderbook().ask[0].price-symbol().price_precision) else max(orderbook().ask[0].price - symbol().price_precision,orderbook().bid[0].price + symbol().price_precision)*(1+gap*(order_pos-1)))", "execute_volume": "20/execute_price + 0 * abs(order_pos)/execute_price", "buy_orders_count": "5", "sell_orders_count": "5" } Grid 6: [Placing Orders with a Spread Based on Historical Data](https://docs.origami.tech/user-guide/grids-examples/placing-orders-with-a-spread-based-on-historical-data) [](https://docs.origami.tech/user-guide/grids-examples#grid-6-placing-orders-with-a-spread-based-on-historical-data) Copy { "gap_ask": "0.005", "gap_bid": "0.005", "price_ask": "max(orderbook().ask[0].price-symbol().price_precision,(two_weeks_mean_high+two_weeks_mean_close)/2,mean_high_15m,min_ask_price)", "price_bid": "min(orderbook().bid[0].price+symbol().price_precision,(two_weeks_mean_low+two_weeks_mean_close)/2,mean_low_15m,max_bid_price)", "candles_1d": "candles('d1', 'base-counter',count=14)", "spread_min": "10*symbol().price_precision", "candles_15m": "candles('m15','base-counter')", "mean_low_15m": "mean([price.low for price in candles_15m])", "execute_price": "(((price_bid+price_ask)/2-spread_min/2)*(1+gap_bid*(order_pos+1)) if side=='buy' else ((price_bid+price_ask)/2+spread_min/2)*(1+gap_ask*(order_pos-1))) if (price_ask-price_bid)two_weeks_mean_low else 10 / execute_price * abs(order_pos)) if side=='buy' else (6/execute_price if execute_price 70 else 0", "sleep_after_seconds": "300" } --- # Selling at the Best Price with Minimum Price and Balance Constraints | Origami Documentation Grid 1: Selling at the Best Price with Minimum Price and Balance Constraints Copy { "gap": "0.005", "execute_price": "max(orderbook().ask[0].price-symbol().price_precision,min_ask_price)*(1+gap*(order_pos-1))", "min_ask_price": "orderbook().bid[0].price+symbol().price_precision", "execute_volume": "10/execute_price+abs(order_pos)*10/execute_price", "buy_orders_count": "0", "sell_orders_count": "5 if balance('counter').total < 5000 else 0" } **The grid places sell orders at the best price.** An additional parameter, **gap**, is used to calculate the order prices. In this example, it is set to **0.5%**, and the price increment is calculated as: `1+gap*(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `-1)` `min_ask_price` in this case : `orderbook().bid[0].price+symbol().price_precision` **Sets the minimum sell price to 1 price\_precision above the best bid.** A specific number can also be used as a constraint. * **execute\_volume**: Sets the order volume in **Base** tokens. * For the first order, the volume corresponds to **20 Counter tokens**. * For each subsequent order, the volume increments by **10 Counter tokens**. ![](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FePjaaWbfxDW5RFocW7l8%252Fimage.png%3Falt%3Dmedia%26token%3D1aadee2e-3c88-4639-8160-f61a7d9d2415&width=768&dpr=4&quality=100&sign=5ea7c8f4&sv=2) `10/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `+`[`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)*10/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) Orders will be placed until the balance of the Counter token exceeds 5000. ![](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FSqo97gV3hDnK1KwnGvLs%252Fimage.png%3Falt%3Dmedia%26token%3Dc7f9a9d7-9679-49fb-8e9b-4a4b91a62c6e&width=768&dpr=4&quality=100&sign=4b3c220a&sv=2) `group_balance('counter').current.total` `5 if group_balance('counter').current.total < 5000 else 0` or based on the token balance**.** `base balance('base').total` `5 if balance('base').total > 5000 else 0` [PreviousGrids Examples](https://docs.origami.tech/user-guide/grids-examples) [NextSelling at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/selling-at-the-best-price-considering-historical-data) Last updated 11 months ago --- # Is Buy First | Origami Documentation [](https://docs.origami.tech/function/optional-parameters/is-buy-first#is_buy_first-greater-than-enum-1-or-0) `is_buy_first` -> enum(1|0) ---------------------------------------------------------------------------------------------------------------------------------------------- Determines the priority of placing orders within a single grid. 1 - buy orders are placed first. 0 - sell orders are placed first. [PreviousSleep After Seconds](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) [NextFunctions](https://docs.origami.tech/function/functions) Last updated 1 year ago --- # Base logic | Origami Documentation [](https://docs.origami.tech/function/base-logic#boolean-operators) Boolean operators ------------------------------------------------------------------------------------------ ### [](https://docs.origami.tech/function/base-logic#undefined) `()` Breakets can be used to combine expressions ### [](https://docs.origami.tech/function/base-logic#x-if-smth-else-y) `x if smth else y` Conditional operator. Returns `x` if `smth` is True Returns `y` if smth is False `x`, `y`, `smth` \- can be `decimal`, `function call`, `custom formula`, `math expr` or `bool` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-or-less-than-y-greater-than) ` or ` Boolean operator `or`. Returns `bool` Any non-zero value for operands casts as True (ex: 1 → True, 0 → False) Truth table: x y result True True True True False True False True True False False False ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-and-less-than-y-greater-than) ` and ` Boolean operator `and`. Returns `bool` Any non-zero value for operands casts as True (ex: 1 → True, 0 → False) Truth table: x y result True True True True False False False True False False False False ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than) ` == ` Equivalent op. Returns `bool` Truth table: x y result 1 1 True 0 1 False 1 0 False ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than) `` ` `` Boolean operator `and`. Returns `bool` Truth table: x y result 1 1 False 1 0 True 0 1 True ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-greater-than-less-than-y-greater-than) ` > ` #v1 #v2 Boolean operator `greater`. Returns `bool` Truth table: x y result 1 0 True 0 1 False 1 1 False ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-greater-than-less-than-y-greater-than-1) ` >= ` #v1 #v2 Boolean operator `greater or equivalent`. Returns `bool` Truth table: x y result 1 0 True 0 1 False 1 1 True ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-less-than-y-greater-than) ` < ` #v1 #v2 Boolean operator `less`. Returns `bool` Truth table: x y result 1 0 False 0 1 True 1 1 False ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-less-than-y-greater-than-1) ` <= ` #v1 #v2 Boolean operator `less or equivalent`. Returns `bool` Truth table: x y result 1 0 False 0 1 True 1 1 True [](https://docs.origami.tech/function/base-logic#math-operators) Math operators ------------------------------------------------------------------------------------ ### [](https://docs.origami.tech/function/base-logic#undefined-1) `()` Breakets can be used to combine expressions ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-1) ` / ` Division operator. Returns `decimal` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-2) ` * ` Multiplication operator. Returns `decimal` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than--less-than-y-greater-than) ` + ` Sum operator. Returns `decimal` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-3) ` - ` Subtraction operator. Returns `decimal` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-4) ` ** ` Exponentiation operator. Returns `decimal` ### [](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-5) ` ^ ` [PreviousExecute Volume](https://docs.origami.tech/function/required-parameters/execute-volume) [NextOptional parameters](https://docs.origami.tech/function/optional-parameters) Last updated 1 year ago * [Boolean operators](https://docs.origami.tech/function/base-logic#boolean-operators) * [()](https://docs.origami.tech/function/base-logic#undefined) * [x if smth else y](https://docs.origami.tech/function/base-logic#x-if-smth-else-y) * [ or ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-or-less-than-y-greater-than) * [ and ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-and-less-than-y-greater-than) * [ == ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than) * [\`](https://docs.origami.tech/function/base-logic#less-than-x-greater-than) * [ > ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-greater-than-less-than-y-greater-than) * [ >= ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-greater-than-less-than-y-greater-than-1) * [ < ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-less-than-y-greater-than) * [ <= ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-less-than-y-greater-than-1) * [Math operators](https://docs.origami.tech/function/base-logic#math-operators) * [()](https://docs.origami.tech/function/base-logic#undefined-1) * [ / ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-1) * [ \* ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-2) * [ + ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than--less-than-y-greater-than) * [ - ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-3) * [ \*\* ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-4) * [ ^ ](https://docs.origami.tech/function/base-logic#less-than-x-greater-than-less-than-y-greater-than-5) --- # Buying at the Best Price with Maximum Price and Balance Constraints | Origami Documentation Buying at the best price with a cap on maximum buy price and current counter token balance Copy { "gap": "0.005", "execute_price": "min(orderbook().bid[0].price+symbol().price_precision,max_bid_price)*(1+gap*(order_pos+1))", "max_bid_price": "orderbook().ask[0].price-symbol().price_precision", "execute_volume": "10/execute_price+abs(order_pos)*10/execute_price", "buy_orders_count": "5 if balance('counter').total > 5000 else 0", "sell_orders_count": "0" } The grid places buy orders at the best available price. An additional parameter, gap, is used in calculating the order prices. In this example, gap is set to 0.5%. `1+gap*(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `-1)` `max_bid_price`parameter in this case is defined as: `orderbook().ask[0].price-symbol().price_precision` which sets the maximum buy price to one price\_precision below the best ask price. Alternatively, a specific numerical value can be used to set the limit. The [`execute_volume`](https://docs.origami.tech/function/required-parameters/execute-volume) parameter determines the base token amount, equivalent to 20 counter tokens for the first order, with an increment of 10 counter tokens for each subsequent order. The formula used is: `10/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `+`[`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)*10/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) Orders will continue to be placed until the balance of the `counter` token drops below 5000. If needed, this limitation can be replaced with the aggregated balance across multiple exchanges [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('counter').current.total` `5 if` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('counter').current.total > 5000 else 0` or with the balance of the base token, defined as: [`balance`](https://docs.origami.tech/function/functions/balance) `('base').total` `5 if` [`balance`](https://docs.origami.tech/function/functions/balance) `('base').total < 5000 else 0` [PreviousSelling at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/selling-at-the-best-price-considering-historical-data) [NextBuying at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/buying-at-the-best-price-considering-historical-data) Last updated 11 months ago --- # Placing Orders at the Best Price or with a Minimum Spread | Origami Documentation Orders are placed either with a spread around the current price or at the best price if the spread exceeds the minimum set value. Copy { "gap": "0.005", "min_spread": "0.02", "pivot_price": "(orderbook().ask[0].price+orderbook().bid[0].price+ticker())/3", "execute_price": "(pivot_price*(1-min_spread/2+(order_pos+1)*gap) if pivot_price*(1-min_spread/2)<=(orderbook().bid[0].price+symbol().price_precision) else min(orderbook().bid[0].price + symbol().price_precision,orderbook().ask[0].price - symbol().price_precision)*(1+gap*(order_pos+1))) if side=='buy' else (pivot_price*(1+min_spread/2+(order_pos-1)*gap) if pivot_price*(1+min_spread/2)>=(orderbook().ask[0].price-symbol().price_precision) else max(orderbook().ask[0].price - symbol().price_precision,orderbook().bid[0].price + symbol().price_precision)*(1+gap*(order_pos-1)))", "execute_volume": "20/execute_price + 0 * abs(order_pos)/execute_price", "buy_orders_count": "5", "sell_orders_count": "5" } In this example, the order price is determined as the average of three values: * The last market trade. * The best ask price. * The best bid price. `(` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().ask[0].price +` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().bid[0].price +`[`ticker`](https://docs.origami.tech/function/functions/ticker) `())/3` Orders are then placed either at the best price or with a 2% spread if the current spread is smaller. The price increment is defined as `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `+ 1) * gap` for bids and `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `- 1) * gap` for asks, where gap is set to 0.5%. Each order is placed for the equivalent of 20 counter tokens without increasing the volume for subsequent orders. To enable volume increments, replace 0 with the desired increment value. `20/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `+ 0 *` [`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) [PreviousBuying at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples/buying-at-the-best-price-considering-historical-data) [NextPlacing Orders with a Spread Based on Historical Data](https://docs.origami.tech/user-guide/grids-examples/placing-orders-with-a-spread-based-on-historical-data) Last updated 11 months ago --- # Sell Orders Count | Origami Documentation [](https://docs.origami.tech/function/required-parameters/sell-orders-count#sell_orders_count-integer-or-formula-greater-than-integer) `sell_orders_count` \[_integer_ | _formula_ -> \[_integer_\]\] ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Non-negative number of `side=’`[`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` orders to place. Accepts values of integer and decimal types. It is possible to use `formula` as value. Supports if-else logic. When using float values, they are rounded down to the nearest whole number. Example:[](https://docs.origami.tech/function/required-parameters/sell-orders-count#example) 2 sell orders will be placed. `"sell_orders_count": "2"` * * * 5 sell orders will be placed if the current total base token group balance exceeds 5000. `"sell_orders_count": "5 if` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts#base) `').current.total > 5000 else 0"` Copy 5 if group_balance ('base').current.total > 5000 else 0 * * * 5 sell orders will be placed if the current total counter token balance less than 5000. `"sell_orders_count": "5 if` [`balance`](https://docs.origami.tech/function/structures/balance) `('counter').total < 5000 else 0"` Copy 5 if balance('counter').total < 5000 else 0 * * * A sell order will be placed if the current total counter token group balance is lower than the starting one and the first bid price is higher than the fair price, which is calculated based on the ratio of the differences in the starting and current balances of the base token and counter token. `"sell_orders_count": "1 if` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().bid[0].price > (`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').current.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').start.total)/(`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').start.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total) and` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').start.total >` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total else 0"` Copy 1 if orderbook().bid[0].price > (group_balance('base').current.total - group_balance('base').start.total) / (group_balance('counter').start.total - group_balance('counter').current.total) and group_balance('counter').start.total > group_balance('counter').current.total else 0 * * * Random number of sell orders will be placed in range \[0, 10\], rounded down. `"sell_orders_count": "`[`random`](https://docs.origami.tech/function/functions/random) `() * 10"` Copy random() * 10 [PreviousBuy Orders Count](https://docs.origami.tech/function/required-parameters/buy-orders-count) [NextExecute Price](https://docs.origami.tech/function/required-parameters/execute-price) Last updated 1 year ago --- # Buying at the Best Price Considering Historical Data | Origami Documentation Copy { "gap": "0.01", "candles_1d": "candles('d1', 'base-counter',count=30)", "execute_price": "min(orderbook().bid[0].price+symbol().price_precision,(month_mean_low+month_mean_close)/2,max_bid_price)*(1+gap*(order_pos+1))", "max_bid_price": "min(month_mean_close,orderbook().ask[0].price-symbol().price_precision*2)", "execute_volume": "10/execute_price if execute_price>month_mean_low else (10/execute_price+abs(order_pos)*10/execute_price)", "month_mean_low": "mean([price.low for price in candles_1d])", "buy_orders_count": "5 if balance('counter').total > 5000 else 0", "month_mean_close": "mean([price.close for price in candles_1d])", "sell_orders_count": "0" } Buy orders are placed at the best available price, provided it does not exceed the max\_bid\_price or the midpoint between the average closing price and the average daily low over the past month. The grid places buy orders at the best price, with an additional parameter, gap, used to calculate the order prices. In this example, the gap is set to 1%. Price reduction: `1+gap*(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `+1)` As supplementary parameters, daily candlestick data for the past 30 days is retrieved: [`candles`](https://docs.origami.tech/function/functions/candles) `('d1', '`[`base`](https://docs.origami.tech/function/shortcuts/base) `-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `',count=30)` Based on this data, the following additional parameters are calculated: Average closing price over 30 days: [`mean`](https://docs.origami.tech/function/functions/mean) `([price.close for price in candles_1d])` Average daily low over 30 days: [`mean`](https://docs.origami.tech/function/functions/mean) `([price.low for price in candles_1d])` The order price is then determined as the maximum of: * The current best bid. * The maximum bid price: max\_bid\_price. In this case minimum of the current best ask price minus two price\_precision and average closing price over 30 days. * The midpoint between the average closing price and the average daily low over the past 30 days. Orders will be placed until the counter token balance exceeds 5000 If needed, this restriction can be replaced with the aggregated balance across multiple exchanges: [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total` `5 if` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total < 5000 else 0` or the base token balance `5 if` [`balance`](https://docs.origami.tech/function/functions/balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').total < 5000 else 0` [PreviousBuying at the Best Price with Maximum Price and Balance Constraints](https://docs.origami.tech/user-guide/grids-examples/buying-at-the-best-price-with-maximum-price-and-balance-constraints) [NextPlacing Orders at the Best Price or with a Minimum Spread](https://docs.origami.tech/user-guide/grids-examples/placing-orders-at-the-best-price-or-with-a-minimum-spread) Last updated 11 months ago --- # Buy Orders Count | Origami Documentation [](https://docs.origami.tech/function/required-parameters/buy-orders-count#buy_orders_count-integer-or-formula-greater-than-integer) `buy_orders_count` \[_integer_ | _formula_ -> \[_integer_\]\] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Non-negative number of `side=’`[`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` orders to place. Accepts values of integer and decimal types. It is possible to use `formula` as value. If-else logic is also supported. When using float values, they are rounded down to the nearest whole number. Example:[](https://docs.origami.tech/function/required-parameters/buy-orders-count#example) 2 buy orders will be placed. `"buy_orders_count": "2"` * * * 5 buy orders will be placed if the current total base token balance less than 5000. `"buy_orders_count": "5 if` [`balance`](https://docs.origami.tech/function/structures/balance) `('`[`base`](https://docs.origami.tech/function/shortcuts#base) `').total < 5000 else 0"` Copy 5 if balance('base').total < 5000 else 0 * * * 5 buy orders will be placed if the current total counter token group balance exceeds 5000. `"buy_orders_count": "5 if` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total > 5000 else 0"` Copy 5 if group_balance('counter').current.total > 5000 else 0 * * * A buy order will be placed if the current total base token group balance is lower than the starting one and the first ask price is lower than the fair price, which is calculated based on the ratio of the differences in the starting and current balances of the base token and counter token. `"buy_orders_count": "1 if` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().ask[0].price < (`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').start.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').current.total)/(`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').start.total) and` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').start.total >` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').current.total else 0"` Copy 1 if orderbook().ask[0].price < (group_balance('base').start.total-group_balance('base').current.total)/(group_balance('counter').current.total-group_balance('counter').start.total) and group_balance('base').start.total > group_balance('base').current.total else 0 * * * Random number of buy order will be placed in range \[0, 10\], rounded down. `"buy_orders_count": "`[`random`](https://docs.origami.tech/function/functions/random) `() * 10"` Copy random() * 10 [PreviousRequired parameters](https://docs.origami.tech/function/required-parameters) [NextSell Orders Count](https://docs.origami.tech/function/required-parameters/sell-orders-count) Last updated 1 year ago --- # Placing Orders with a Spread Based on Historical Data | Origami Documentation Orders are placed at the best price within a defined spread, ensuring asks are not set below, and bids not set above, historical price levels. Copy { "gap_ask": "0.005", "gap_bid": "0.005", "price_ask": "max(orderbook().ask[0].price-symbol().price_precision,(two_weeks_mean_high+two_weeks_mean_close)/2,mean_high_15m,min_ask_price)", "price_bid": "min(orderbook().bid[0].price+symbol().price_precision,(two_weeks_mean_low+two_weeks_mean_close)/2,mean_low_15m,max_bid_price)", "candles_1d": "candles('d1', 'base-counter',count=14)", "spread_min": "10*symbol().price_precision", "candles_15m": "candles('m15','base-counter')", "mean_low_15m": "mean([price.low for price in candles_15m])", "execute_price": "(((price_bid+price_ask)/2-spread_min/2)*(1+gap_bid*(order_pos+1)) if side=='buy' else ((price_bid+price_ask)/2+spread_min/2)*(1+gap_ask*(order_pos-1))) if (price_ask-price_bid)two_weeks_mean_low else 10 / execute_price * abs(order_pos)) if side=='buy' else (6/execute_price if execute_pricetwo_weeks_mean_low else 10 /` [`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `*` [`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)) if` [`side`](https://docs.origami.tech/function/pre-defined-parameters#side-string) `=='`[`buy`](https://docs.origami.tech/function/pre-defined-parameters) `' else (6/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `if` [`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) ` \[_decimal_\]\] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The price value for each order in the grid. It accepts both integer and decimal inputs and allows the use of formulas as values. If-else logic is supported. Use the [`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) or [`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) side to configure buy and sell orders within a single grid. Always positive value. Can’t be zero. Supports the use of the iterable parameter [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) to facilitate the placement of multiple orders. [`execute_volume`](https://docs.origami.tech/function/required-parameters/execute-volume) can't be used in `execute_price` . Example:[](https://docs.origami.tech/function/required-parameters/execute-price#example) The order will be placed at a price of 2345.95. `"execute_price": "2345.95"` * * * The order will be executed at the current market price. `"execute_price": "`[`ticker`](https://docs.origami.tech/function/functions/ticker) `()"` Copy ticker() * * * The order will be placed at the first market bid price. `"execute_price": "`[`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().bid[0].price"` Copy orderbook().bid[0].price * * * The order will be executed at the first ask price. `"execute_price": "` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().ask[0].price"` Copy orderbook().ask[0].price * * * The order will be placed at the arithmetic average of the bid and ask prices for Bybit's ETH-USDT pair. `"execute_price": "(`[`orderbook`](https://docs.origami.tech/function/functions/orderbook) `('ETH-USDT','bybit').bid[0].price +` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `('EVER-USDT','bybit').ask[0].price) / 2"` Copy (orderbook('ETH-USDT','bybit').bid[0].price + orderbook('EVER-USDT','bybit').ask[0].price) / 2 * * * The order will be executed at the current market price if the starting total base matches the current total base. Otherwise, it will be placed at the fair price, determined by the ratio of the differences between the starting and current balances of the base and counter tokens. `"execute_price": "`[`ticker`](https://docs.origami.tech/function/functions/ticker) `() if` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').current.total ==` [`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').start.total else (`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').start.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').current.total)/(`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').current.total -`[`group_balance`](https://docs.origami.tech/function/functions/group-balance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').start.total)"` Copy ticker() if group_balance('counter').current.total == group_balance('counter').start.total else (group_balance('base').start.total-group_balance('base').current.total)/(group_balance('counter').current.total-group_balance('counter').start.total) * * * The orders will be placed at the price of the first market ask for sell orders and the first market bid for buy orders, adjusted by ±0.5%, respectively. Subsequent orders will be placed at increments of 0.5% of the price for each additional order. `"execute_price": "(` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().bid[0].price if side==’`[`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) `’ else` [`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().ask[0].price) * (1 + 0.005 *`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)"` Copy (orderbook().bid[0].price if side==’buy’ else orderbook().ask[0].price) * (1 + 0.005 * order_pos) * * * Orders will be placed at the price level where the RSI is anticipated to reach 60 on 15-minute candlesticks. `"execute_price": "`[`rsi_to_price`](https://docs.origami.tech/function/technical-analysis/rsi-to-price) `(`[`candles`](https://docs.origami.tech/function/functions/candles) `(’m15’), rsi_expected=60)"` Copy rsi_to_price(candles(’m15’), rsi_expected=60) * * * Place an order at the average closing price of the most recent 100 fifteen-minute candlesticks. `"execute_price": "`[`mean`](https://docs.origami.tech/function/functions/mean) `([candle.close for candle in` [`candles`](https://docs.origami.tech/function/functions/candles)\ `('m15')])"` Copy mean([candle.close for candle in candles('m15')]) [PreviousSell Orders Count](https://docs.origami.tech/function/required-parameters/sell-orders-count) [NextExecute Volume](https://docs.origami.tech/function/required-parameters/execute-volume) Last updated 11 months ago --- # Pre-defined parameters | Origami Documentation [](https://docs.origami.tech/function/pre-defined-parameters#order_pos) [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- This is internal counter value for orders inside one grid.It is positive for orders with `side=’`[`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` and negative for `side=’`[`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` . [](https://docs.origami.tech/function/pre-defined-parameters#side) [`side`](https://docs.origami.tech/function/pre-defined-parameters/side) ------------------------------------------------------------------------------------------------------------------------------------------------- One of two values [`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) or [`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) . [PreviousExchanges list](https://docs.origami.tech/function/exchanges-list) [NextOrder Pos](https://docs.origami.tech/function/pre-defined-parameters/order-pos) Last updated 1 year ago --- # Buying and Selling When the 15-Minute RSI Exits a Defined Range | Origami Documentation Execute buy and sell orders when the 15-minute RSI moves outside the specified range of values. Copy { "max_bid": "mean([candle.close for candle in candles_m15])", "min_ask": "mean([candle.close for candle in candles_m15])", "rsi_m15": "rsi(candles('m15', 'base-counter'), period=14, column='close')[0]", "candles_m15": "candles('m15', 'base-counter')", "execute_price": "min(orderbook().ask[0].price,max_bid) if side == 'buy' else max(orderbook().bid[0].price,min_ask)", "execute_volume": "10 / ticker()", "buy_orders_count": "1 if rsi_m15 < 30 else 0", "sell_orders_count": "1 if rsi_m15 > 70 else 0", "sleep_after_seconds": "300" } Buy Orders: Triggered when the RSI falls below 30, executed at the first ask price. Sell Orders: Triggered when the RSI rises above 70, executed at the first bid price. In this example, 15-minute candlestick data is used to calculate the average closing price [`mean`](https://docs.origami.tech/function/functions/mean) `([candle.`[`close`](https://docs.origami.tech/function/structures/candle)\ `for candle in candles_m15])` and the RSI [`rsi`](https://docs.origami.tech/function/technical-analysis/stochastic-rsi) `(`[`candles`](https://docs.origami.tech/function/functions/candles) `('m15', '`[`base`](https://docs.origami.tech/function/shortcuts/base) `-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `'), period=14, column='`[`close`](https://docs.origami.tech/function/structures/candle) `')[0]` Sell Orders: If the RSI exceeds 70, a sell order is placed every 300 seconds (as specified by `"`[`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) `": "300"`) at the best bid price, provided it is not lower than the average closing price of the last 100 fifteen-minute candlesticks. `"`[`sell_orders_count`](https://docs.origami.tech/function/required-parameters/sell-orders-count) `": "1 if rsi_m15 > 70 else 0"` Buy Orders: If the RSI falls below 30, a buy order is placed every 300 seconds at the best ask price, provided it is not higher than the average closing price of the last 100 fifteen-minute candlesticks. `"`[`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count) `": "1 if rsi_m15 < 30 else 0"` [PreviousPlacing Buy and Sell Orders Based on RSI of 15-Minute Candlesticks](https://docs.origami.tech/user-guide/grids-examples/placing-buy-and-sell-orders-based-on-rsi-of-15-minute-candlesticks) [NextRequired parameters](https://docs.origami.tech/function/required-parameters) Last updated 11 months ago --- # GroupBalance | Origami Documentation [`GroupBalance`](https://docs.origami.tech/function/structures#groupbalance) [](https://docs.origami.tech/function/structures/groupbalance#groupbalance) `GroupBalance.start [[`[`Balance`](https://docs.origami.tech/function/structures#balance)\ `]]` saved balance `GroupBalance.current [[` [`Balance`](https://docs.origami.tech/function/structures#balance)\ `]]` current balance of group [PreviousBalance](https://docs.origami.tech/function/structures/balance) [NextOrderbook](https://docs.origami.tech/function/structures/orderbook) Last updated 1 year ago --- # Selling at the Best Price Considering Historical Data | Origami Documentation [Grid 2: Selling at the Best Price Considering Historical Data](https://docs.origami.tech/user-guide/grids-examples#grid-2-prodazha-po-luchshei-cene-s-uchetom-istoricheskikh-dannykh) Selling at the best price, not lower than `min_ask_price` and the midpoint between the average closing price and the average highs of daily candles over the past month. Copy { "gap": "0.01", "candles_1d": "candles('d1', 'base-counter',count=30)", "execute_price": "max(orderbook().ask[0].price-symbol().price_precision,(month_mean_high+month_mean_close)/2,min_ask_price)*(1+gap*(order_pos-1))", "min_ask_price": "max(month_mean_close,orderbook().bid[0].price+symbol().price_precision*2)", "execute_volume": "10/execute_price if execute_price 5000 else 0` [PreviousSelling at the Best Price with Minimum Price and Balance Constraints](https://docs.origami.tech/user-guide/grids-examples/selling-at-the-best-price-with-minimum-price-and-balance-constraints) [NextBuying at the Best Price with Maximum Price and Balance Constraints](https://docs.origami.tech/user-guide/grids-examples/buying-at-the-best-price-with-maximum-price-and-balance-constraints) Last updated 11 months ago --- # Execute Volume | Origami Documentation [](https://docs.origami.tech/function/required-parameters/execute-volume#execute_volume-decimal-or-formula-greater-than-decimal) `execute_volume` \[_decimal_ | _formula_ -> \[_decimal_\]\] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Volume (amount) value for each order in grid, denominated in the base token. It accepts both integer and decimal inputs and allows the use of formulas as values. It must be borne in mind that when the quantity in the volume parameter changes and in the absence of the [`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) parameter, the grid will immediately re-place orders on the exchange, which leads to an increase in the load on the communication channel with the exchange. For correct operation, it is advisable to use the [`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) parameter and the [`cached`](https://docs.origami.tech/function/functions/cached) function. It is mandatory to use the [`cached`](https://docs.origami.tech/function/functions/cached) function or the [`sleep_after_seconds`](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds) parameter when using the [`random`](https://docs.origami.tech/function/functions/random) function. Always positive value. Can’t be zero. Supports the use of the iterable parameter [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) to facilitate the placement of multiple orders. It is possible to use the [`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) parameter, which also supports the use of [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) . Example:[](https://docs.origami.tech/function/required-parameters/execute-volume#example) The order of 2345.95 amount will be placed in the base token. `"execute_volume": "2345.95"` * * * The order will be executed in the amount of 10 divided by the market price of the base token. For example, if the counter token is USDT, then this is equivalent to placing an order of 10 USDT denominated in the base token. `"execute_volume": "10 /` [`ticker`](https://docs.origami.tech/function/functions/ticker) `()"` Copy 10 / ticker() * * * The order will be executed in the amount of 100 plus 10 multiplied by the sequence number of the order in the grid, divided by the price of the base token. For example, if the counter token is USDT, then this is equivalent to placing an order of 100 USDT plus 10 USDT multiplied by the ordinal number of the order in the grid, denominated in the base token. `"execute_volume": "(100 + 10 *` [`abs`](https://docs.origami.tech/function/functions/abs) `(`[`order_pos`](https://docs.origami.tech/function/pre-defined-parameters/order-pos) `)) /` [`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `"` Copy (100 + 10 * abs(order_pos)) / execute_price * * * The order will be executed in an amount equal to the size of the first market bid, but not exceeding 100 divided by the price of the executed order. This means that if the counter token is USDT, the order amount will be capped at a value equivalent to 100 USDT, denominated in the base token. `"execute_volume": "`[`min`](https://docs.origami.tech/function/functions/min) `(`[`orderbook`](https://docs.origami.tech/function/functions/orderbook) `().bid[0].amount,100/`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `)"` Copy min(orderbook().bid[0].amount,100/execute_price) * * * The order will be executed in an amount equal to the total of all orders up to and including the first own ask order in the market. `"execute_volume": "sum([ask.amount if ask.price <=` [`own`](https://docs.origami.tech/function/functions/own)\ `().ask[0].price else 0 for ask in` [`orderbook`](https://docs.origami.tech/function/functions/orderbook)\ `().ask])"` Copy sum([ask.amount if ask.price <= own().ask[0].price else 0 for ask in orderbook().ask]) * * * The order will be executed in the amount of 10% of the current available ETH balance, but not more than 0.2. `"execute_volume": "`[`min`](https://docs.origami.tech/function/functions/min) `(`[`balance`](https://docs.origami.tech/function/functions/balance) `('ETH').available * 0.1, 0.2)"` Copy min(balance('ETH').available * 0.1,0.2) [PreviousExecute Price](https://docs.origami.tech/function/required-parameters/execute-price) [NextBase logic](https://docs.origami.tech/function/base-logic) Last updated 11 months ago --- # Orderbook | Origami Documentation [`Orderbook`](https://docs.origami.tech/function/structures#orderbook) [](https://docs.origami.tech/function/structures/orderbook#orderbook) `Orderbook.symbol [str]` returns pair for orderbook adapted for exchange (ex: `ETH-USDT`) `Orderbook.ask [array]` array of [`OrderBookUnit`](https://docs.origami.tech/function/structures/orderbookunit) sorted by price (ascending) `Orderbook.bid [array]` array of [`OrderBookUnit`](https://docs.origami.tech/function/structures/orderbookunit) sorted by price (descending) [PreviousGroupBalance](https://docs.origami.tech/function/structures/groupbalance) [NextOrderBookUnit](https://docs.origami.tech/function/structures/orderbookunit) Last updated 1 year ago --- # Shortcuts | Origami Documentation [](https://docs.origami.tech/function/shortcuts#base) [`base`](https://docs.origami.tech/function/shortcuts/base) ----------------------------------------------------------------------------------------------------------------------- Can be used instead of token name. Resolves to Base Coin name [](https://docs.origami.tech/function/shortcuts#counter) [`counter`](https://docs.origami.tech/function/shortcuts/counter) -------------------------------------------------------------------------------------------------------------------------------- Can be used instead of token name. Resolves to Counter Coin name [PreviousCandle](https://docs.origami.tech/function/structures/candle) [NextBase](https://docs.origami.tech/function/shortcuts/base) Last updated 1 year ago --- # Counter | Origami Documentation [](https://docs.origami.tech/function/shortcuts/counter#counter) [`counter`](https://docs.origami.tech/function/shortcuts#counter) ---------------------------------------------------------------------------------------------------------------------------------------- Can be used instead of token name. Resolves to `Counter Coin` name **Important:** shortcuts can’t be used in `update_balance_formula` inside group Example:[](https://docs.origami.tech/function/shortcuts/counter#example) `balance('counter').available` [PreviousBase](https://docs.origami.tech/function/shortcuts/base) [NextExchanges list](https://docs.origami.tech/function/exchanges-list) Last updated 1 year ago --- # Base | Origami Documentation [](https://docs.origami.tech/function/shortcuts/base#base) [`base`](https://docs.origami.tech/function/shortcuts) ----------------------------------------------------------------------------------------------------------------------- Can be used instead of token name. Resolves to `Base Coin` name **Important:** shortcuts can’t be used in `update_balance_formula` inside group Example:[](https://docs.origami.tech/function/shortcuts/base#example) `balance('base').available` [PreviousShortcuts](https://docs.origami.tech/function/shortcuts) [NextCounter](https://docs.origami.tech/function/shortcuts/counter) Last updated 1 year ago --- # Order Pos | Origami Documentation [](https://docs.origami.tech/function/pre-defined-parameters/order-pos#order_pos-integer) `order_pos` \[_integer_\] ------------------------------------------------------------------------------------------------------------------------ This is internal counter value for orders inside one **grid**. It **can’t be** placed inside grid’s settings It is positive for orders with [`side`](https://docs.origami.tech/function/pre-defined-parameters/side) `=’`[`sell`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` and negative for [`side`](https://docs.origami.tech/function/pre-defined-parameters/side) `= ’`[`buy`](https://docs.origami.tech/function/pre-defined-parameters/side) `’` . The value can’t be zero. Range for the value is `[-`[`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count)\ `, -1] **∪** [1,` [`sell_orders_count`](https://docs.origami.tech/function/required-parameters/sell-orders-count)\ `]` `order_pos` can’t be used in `update_balance_formula` inside group and/or account _Examples:_ [PreviousPre-defined parameters](https://docs.origami.tech/function/pre-defined-parameters) [NextSide](https://docs.origami.tech/function/pre-defined-parameters/side) Last updated 1 year ago --- # OrderBookUnit | Origami Documentation [`OrderBookUnit`](https://docs.origami.tech/function/structures#orderbookunit) [](https://docs.origami.tech/function/structures/orderbookunit#orderbookunit) `OrderBookUnit.price [decimal]` price of order in orderbook `OrderBookUnit.amount [decimal]` amount of order in orderbook [PreviousOrderbook](https://docs.origami.tech/function/structures/orderbook) [NextSymbol](https://docs.origami.tech/function/structures/symbol) Last updated 1 year ago --- # Balance | Origami Documentation [`Balance`](https://docs.origami.tech/function/structures#balance) [](https://docs.origami.tech/function/structures/balance#balance) `Balance.available [decimal]` amount for tokens available at the time of calculating grid `Balance.reserved [decimal]` amount for tokens reserver _(ex: orders already placed)_ at the time of calculating grid `Balance.total [decimal]` amount of tokens on the account (Balance.available + Balance.reserved) at the time of calculating grid [PreviousStructures](https://docs.origami.tech/function/structures) [NextGroupBalance](https://docs.origami.tech/function/structures/groupbalance) Last updated 1 year ago --- # Symbol | Origami Documentation [`Symbol`](https://docs.origami.tech/function/structures#symbol) [](https://docs.origami.tech/function/structures/symbol#symbol) `Symbol.fee_coin` `Symbol.amount_precision` amount (base coin) rounding. Decimal 10 ^ n `Symbol.price_precision` price (counter coin) rounding. Decimal 10 ^ n (usually, n < 0) `Symbol.total_counter_min` minimum value: price \* amount, that can be used to create an order `Symbol.total_counter_last_min` minimum price \* ticker.last, that can be used to create an order `Symbol.amount_min` - minimum amount to create an order `Symbol.bid_max_multiplier` - price protection. Order can not be more than ticker.last \* bid\_max\_multiplier while placing buy order. (todo) `Symbol.ask_min_multiplier` - price protection. Order can not be less than ticker.last \* ask\_min\_multiplier while placing sell order. (todo) [PreviousOrderBookUnit](https://docs.origami.tech/function/structures/orderbookunit) [NextCandle](https://docs.origami.tech/function/structures/candle) Last updated 1 year ago --- # Candle | Origami Documentation [`Candle`](https://docs.origami.tech/function/structures#candle) [](https://docs.origami.tech/function/structures/candle#candle) `Candle.open` candle opening price. Decimal. `Candle.high` maximum candle price. Decimal. `Candle.low` minimum candle price. Decimal. `Candle.close` candle closing price. Decimal. `Candle.volume` trading volume. Decimal. `Candle.timestamp_seconds` candle time. Int. [PreviousSymbol](https://docs.origami.tech/function/structures/symbol) [NextShortcuts](https://docs.origami.tech/function/shortcuts) Last updated 1 year ago --- # Amount Before Price | Origami Documentation [](https://docs.origami.tech/function/functions/amount-before-price#amount_before_price-threshold_price-decimal-amounts-list-decimal-prices-list-decimal-side-union-ask) `amount_before_price`(_threshold\_price_:_decimal_, _amounts_: _list_\[_decimal_\], _prices_: _list_\[_decimal_\], _side_: _union_\["_ask_"|"_bid_") -> _decimal_|_None_\ \ \ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\ \ Example:\ \ [PreviousVWAP](https://docs.origami.tech/function/functions/vwap)\ [NextAmount Threshold Index](https://docs.origami.tech/function/functions/amount-threshold-index)\ \ Last updated 1 year ago --- # Structures | Origami Documentation [](https://docs.origami.tech/function/structures#balance) [Balance](https://docs.origami.tech/function/structures/balance) -------------------------------------------------------------------------------------------------------------------------------- [`balance`](https://docs.origami.tech/function/functions/balance) ; [`saved_balance`](https://docs.origami.tech/function/functions/saved-balance) [](https://docs.origami.tech/function/structures#groupbalance) [GroupBalance](https://docs.origami.tech/function/structures/groupbalance) ----------------------------------------------------------------------------------------------------------------------------------------------- [`group_balance`](https://docs.origami.tech/function/functions/group-balance) [](https://docs.origami.tech/function/structures#orderbook) [Orderbook](https://docs.origami.tech/function/structures/orderbook) -------------------------------------------------------------------------------------------------------------------------------------- [`orderbook`](https://docs.origami.tech/function/functions/orderbook) ; [`own`](https://docs.origami.tech/function/functions/own) [](https://docs.origami.tech/function/structures#orderbookunit) [OrderbookUnit](https://docs.origami.tech/function/structures/orderbookunit) -------------------------------------------------------------------------------------------------------------------------------------------------- [Orderbook](https://docs.origami.tech/function/structures/orderbook) [](https://docs.origami.tech/function/structures#symbol) [Symbol](https://docs.origami.tech/function/structures/symbol) ----------------------------------------------------------------------------------------------------------------------------- [`symbol`](https://docs.origami.tech/function/functions/symbol) [](https://docs.origami.tech/function/structures#candle) [Candle](https://docs.origami.tech/function/structures/candle) ----------------------------------------------------------------------------------------------------------------------------- [`candles`](https://docs.origami.tech/function/functions/candles) * * * [PreviousVolume Adjusted Moving Average](https://docs.origami.tech/function/technical-analysis/volume-adjusted-moving-average) [NextBalance](https://docs.origami.tech/function/structures/balance) Last updated 11 months ago --- # Exchanges list | Origami Documentation Exchanges Name ID Candles intervals [https://hitbtc.com/](https://hitbtc.com/) hitbtc 1 m1, m3, m5, m15, m30, h1, h4, d1, w1, M1 [https://www.kucoin.com/](https://www.kucoin.com/) kucoin 2 m1, m3, m5, m15, m30, h1, h2, h4, h6, h8, h12, d1, w1 [https://www.bitrue.com/](https://www.bitrue.com/) bitrue 3 m1, m5, m15, m30, h1, h2, h4, h12, d1, w1 [https://www.digifinex.com/](https://www.digifinex.com/) digifinex 4 m1, m5, m15, m30, h1, h4, h12, d1, w1 [https://www.bitmart.com/](https://www.bitmart.com/) bitmart 5 m1, m5, m15, m30, h1, h2, h4, d1, w1, M1 [https://www.binance.com/](https://www.binance.com/) binance 6 m1, m3, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [https://www.gate.io/](https://www.gate.io/) gateio 7 s10, m1, m5, m15, m30, h1, h4, h8, d1, w1 [https://www.mexc.com/](https://www.mexc.com/) mexc 8 m1, m5, m15, m30, h1, h4, d1, M1 [https://www.zbx.com/](https://www.zbx.com/) zbx 9 m1, m5, m15, m30, h1, h6, d1, w1, M1 [https://bingx.com/](https://bingx.com/) bingx 10 m1 [https://app.flatqube.io/swap](https://app.flatqube.io/swap) flatqube 13 [https://p2bp2b.com/](https://p2bp2b.com/) p2b 14 m1, h1, d1 [https://www.htx.com/](https://www.htx.com/) huobi 15 m1, m5, m15, m30, h1, h4, d1, w1, M1 [https://bit.team/](https://bit.team/) bitteam 16 m1, m5, m15 [https://coinone.co.kr/](https://coinone.co.kr/) coinone 17 m1, m3, m5, m15, m30, h1, h2, h6, d1, w1 [https://www.kraken.com/](https://www.kraken.com/) kraken 18 m1, m5, m15, m30, h1, h4, d1, w1 [https://www.coinstore.com/](https://www.coinstore.com/) coinstore 19 m1, m5, m15, m30, h1, h4, h12, d1, w1 [https://www.coinw.com/](https://www.coinw.com/) coinw 20 m1, m3, m5, m15, m30, h4 [https://www.lbank.com/](https://www.lbank.com/) lbank 22 m1, m5, m15, m30, h1, h4, d1, w1, M1 [https://www.bybit.com/](https://www.bybit.com/) bybit 23 m1, m3, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [https://www.okx.com/](https://www.okx.com/) okx 24 m1, m3, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [https://www.tokocrypto.com/](https://www.tokocrypto.com/) tokocrypto 25 m1, m3, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [https://indodax.com/](https://indodax.com/) indodax 26 [https://ston.fi/](https://ston.fi/) stonfi 28 [https://www.bitget.com/](https://www.bitget.com/) bitget 29 m1, m5, m15, m30, h1, h4, h6, h12, d1, w1 [https://poloniex.com/](https://poloniex.com/) poloniex 37 m1, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [https://dedust.io/](https://dedust.io/) dedust 38 [https://www.deepcoin.com/](https://www.deepcoin.com/) deepcoin 40 m1, m5, m15, m30, h1, h4, h12, d1, w1, M1 [https://coins.ph/](https://coins.ph/) coinsph 42 m1, m3, m5, m15, m30, h1, h2, h4, h6, h12, d1, w1, M1 [PreviousCounter](https://docs.origami.tech/function/shortcuts/counter) [NextPre-defined parameters](https://docs.origami.tech/function/pre-defined-parameters) Last updated 1 year ago --- # Symbol | Origami Documentation [](https://docs.origami.tech/function/functions/symbol#symbol-greater-than-symbol) `symbol`() -> \[[_Symbol_](https://docs.origami.tech/function/structures/symbol)\ \] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Returns [`symbol`](https://docs.origami.tech/function/structures/symbol) structure for current ticker symbol and exchange. Example:[](https://docs.origami.tech/function/functions/symbol#example) [PreviousAmount Threshold Index](https://docs.origami.tech/function/functions/amount-threshold-index) [NextBalance](https://docs.origami.tech/function/functions/balance) Last updated 9 months ago --- # Amount Threshold Index | Origami Documentation [](https://docs.origami.tech/function/functions/amount-threshold-index#amount_threshold_index-threshold-decimal-amounts-list-decimal-greater-than-decimal-or-none) `amount_threshold_index`(_threshold_: _Decimal_, _amounts_: _list_\[_decimal_\]) -> _decimal_|_None_ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Example: [PreviousAmount Before Price](https://docs.origami.tech/function/functions/amount-before-price) [NextSymbol](https://docs.origami.tech/function/functions/symbol) Last updated 1 year ago --- # Candles | Origami Documentation [](https://docs.origami.tech/function/functions/candles#candles-interval-str-symbol-str-exchange-str-count-optional-int-100-greater-than-list-candle) `candles`(_interval_: _str_, _symbol_: _str_, _exchange_: _str_, _count_: _Optional_\[_int_\] = _100_) -> _List_\[\[[_Candle_](https://docs.origami.tech/function/structures/candle)\ \]\] ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `interval` can be one of the following: `s10`, `m1`, `m3`, `m5`, `m15`, `m30`, `m45`, `h1` , `h2`, `h3`, `h4`, `h6`, `h8`, `h12`, `d1`, `w1`, `M1` If exchange does not support selected interval, the minimum supported interval will be used. Candles sorted by ascending timestamp. Candle with index \[0\] this is the newest candle. by default return list of 100 Candles and max size 100 Candles. Example: [PreviousOrderbook](https://docs.origami.tech/function/functions/orderbook) [NextVWAP](https://docs.origami.tech/function/functions/vwap) Last updated 1 year ago --- # Pivot Points | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/pivot-points#pivot-points) [Pivot Points](https://docs.origami.tech/function/technical-analysis#pivot-points) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `pivot(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]]) -> List[Pivot]` where `Pivot` this is object with fields: `pivot`, `s1`, `s2`, `s3`, `s4`, `r1`, `r2`, `r3`, `r4` [PreviousMomentum Breakout Bands](https://docs.origami.tech/function/technical-analysis/momentum-breakout-bands) [NextPercentage Price Oscillator](https://docs.origami.tech/function/technical-analysis/percentage-price-oscillator) Last updated 1 year ago --- # Create Grid | Origami Documentation [](https://docs.origami.tech/user-guide/create-grid#before-creating-a-grid) **Before Creating a Grid** ----------------------------------------------------------------------------------------------------------- #### [](https://docs.origami.tech/user-guide/create-grid#id-1.-ensure-the-following-prerequisites-are-completed) 1\. **Ensure the following prerequisites are completed:** * **Create a project**: Follow the steps to create a new project. * **Add an account**: Link your exchange account to the platform. * **Create a bot**: Set up a bot with the necessary parameters. #### [](https://docs.origami.tech/user-guide/create-grid#id-2.-proceed-to-create-a-grid) 2\. **Proceed to create a grid:** Once the above steps are completed, click the **plus button ("+")** to begin configuring the grid. ![how to Create Grid on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FDDHWj6hNZ9kF5rnqplyh%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252015.55.32.png%3Falt%3Dmedia%26token%3Dbc81d2eb-1236-4bce-ba02-78b4a199d7fa&width=768&dpr=4&quality=100&sign=74b0df9d&sv=2) [](https://docs.origami.tech/user-guide/create-grid#creating-a-grid-initial-setup) **Creating a Grid: Initial Setup** -------------------------------------------------------------------------------------------------------------------------- #### [](https://docs.origami.tech/user-guide/create-grid#id-1.-click-the--button) **1\. Click the "+" button** After clicking the **plus button ("+")**, a basic grid configuration will automatically appear, pre-filled with default values. #### [](https://docs.origami.tech/user-guide/create-grid#id-2.-default-settings) **2\. Default settings** * A single **buy order** will be placed at the **last trade price** for the current pair and exchange, as determined by the bot's configuration ( [`ticker`](https://docs.origami.tech/function/functions/ticker) `()`). * The **order size** is set to **100 tokens** of the base currency ([Base](https://docs.origami.tech/function/shortcuts#base) ). These pre-filled values provide a quick start, allowing you to adjust further settings as needed. ![Create Grid on origami tech ](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FTCoVpVNft5NgrNiCnlbo%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-20%2520%25D0%25B2%252016.48.39.png%3Falt%3Dmedia%26token%3D5a37cd3d-6d1f-4975-a177-691062296750&width=768&dpr=4&quality=100&sign=f43cd09e&sv=2) [](https://docs.origami.tech/user-guide/create-grid#mandatory-fields) Mandatory Fields: -------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-grid#id-1.-execute_price) 1\. [execute\_price](https://docs.origami.tech/function/required-parameters/execute-price) : * **Type**: Number * **Description**: The price levels at which orders will be placed. * **Formula**: Prices are calculated based on the parameter **order\_pos**, which determines the relative position of the orders. * **For Buy Orders**: The `order_pos` parameter takes values in the range `[-1,...,-`[`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count)\ `].` * **For Sell Orders**: The `order_pos` parameter takes values in the range`[1,...,`[`sell_order_count`](https://docs.origami.tech/function/required-parameters/sell-orders-count)\ `]`. This parameter ensures the grid accurately places multiple orders at varying price levels, both above and below the market price. Example:[](https://docs.origami.tech/user-guide/create-grid#example) [`ticker`](https://docs.origami.tech/function/functions/ticker) `()` [`orderbook`](https://docs.origami.tech/function/structures#orderbook) `().`[`bid`](https://docs.origami.tech/function/structures#groupbalance) `[0].`[`price`](https://docs.origami.tech/function/structures/orderbook) [`orderbook`](https://docs.origami.tech/function/structures#orderbook) `().`[`ask`](https://docs.origami.tech/function/structures/orderbook) `[0].`[`price`](https://docs.origami.tech/function/structures/orderbook) `* (1 +` [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `* 0.005)` `1000.05` `1000.05 * (1 +` [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `* 0.005)` `1000 if` [`side`](https://docs.origami.tech/function/pre-defined-parameters#side-string) `=='`[`buy`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `' else 1500` ### [](https://docs.origami.tech/user-guide/create-grid#id-2.-execute_volume) **2\.** [execute\_volume](https://docs.origami.tech/function/required-parameters/execute-volume#execute_volume-decimal-or-formula-greater-than-decimal) : * **Type**: Number * **Description**: The trading volume for each order, expressed in the **Base** token. * **Formula**: The volume is calculated based on the **order\_pos** parameter: * **For Buy Orders**: `order_pos` takes values from `[-1,...,-`[`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count)\ `].` * **For Sell Orders**: `order_pos` takes values from `[1,...,`[`sell_order_count`](https://docs.origami.tech/function/required-parameters/sell-orders-count)\ `]`. This parameter determines the amount of the base currency to be traded at each price level, ensuring consistent volume allocation across the grid. Example:[](https://docs.origami.tech/user-guide/create-grid#example-1) [`orderbook`](https://docs.origami.tech/function/structures#orderbook) `().`[`ask`](https://docs.origami.tech/function/structures/orderbook) `[0].`[`amount`](https://docs.origami.tech/function/structures/orderbook) [`orderbook`](https://docs.origami.tech/function/structures#orderbook) `().`[`bid`](https://docs.origami.tech/function/structures#groupbalance) `[0].`[`amount`](https://docs.origami.tech/function/structures/orderbook) `* (1 +` [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `* 0.005)` `5250.75` `5250.75 /`[`execute_price`](https://docs.origami.tech/function/required-parameters/execute-price) `5250.75 /` [`ticker`](https://docs.origami.tech/function/functions/ticker) `()` `1000.05 +` [`order_pos`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `* 0.005` `1000 if` [`side`](https://docs.origami.tech/function/pre-defined-parameters#side-string) `=='`[`buy`](https://docs.origami.tech/function/pre-defined-parameters#order_pos-integer) `' else 1500` ### [](https://docs.origami.tech/user-guide/create-grid#id-3.-buy_order_count) **3\.** [buy\_order\_count](https://docs.origami.tech/function/required-parameters/buy-orders-count) : * **Type**: Number * **Description**: The number of buy orders (**bid**) to be placed for the [**Base**](https://docs.origami.tech/function/shortcuts/base#base) token. * **Formula**: Defines the total count of buy orders, with prices determined using the **order\_pos** parameter in the range `[-1,...,-`[`buy_orders_count`](https://docs.origami.tech/function/required-parameters/buy-orders-count)\ `]`. ### [](https://docs.origami.tech/user-guide/create-grid#id-4.-sell_order_count) **4\.** [**sell\_order\_count**](https://docs.origami.tech/function/required-parameters/sell-orders-count#sell_orders_count-integer-or-formula-greater-than-integer) **:** * **Type**: Number * **Description**: The number of sell orders (**ask**) to be placed for the [**Base**](https://docs.origami.tech/function/shortcuts/base#base) token. * **Formula**: Defines the total count of sell orders, with prices determined using the **order\_pos** parameter in the range `[1,...,`[`sell_order_count`](https://docs.origami.tech/function/required-parameters/sell-orders-count)\ `]`. These parameters ensure that the grid creates the specified number of buy and sell orders at their respective price levels. Example:[](https://docs.origami.tech/user-guide/create-grid#example-2) `5` `5 if` [`ticker`](https://docs.origami.tech/function/functions/ticker) `() > 0.05 else 0` `5 if` [`balance`](https://docs.origami.tech/function/functions/balance) `('counter').`[`total`](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) `< 5000 else 0` `5 if` [`group_balance`](https://docs.origami.tech/function/structures/groupbalance) `('`[`base`](https://docs.origami.tech/function/shortcuts/base) `').`[`current`](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) `.`[`total`](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) `> 10000 else 0` [](https://docs.origami.tech/user-guide/create-grid#optional-fields) **Optional Fields** --------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-grid#id-1.-time_between_orders) 1\. [time\_between\_orders](https://docs.origami.tech/function/optional-parameters/time-between-orders) : * **Type**: Number * **Description**: The time interval (in seconds) between placing successive orders in a single grid. * **Purpose**: Reduces the frequency of API requests to the exchange, helping avoid exceeding the exchange's rate limits. ### [](https://docs.origami.tech/user-guide/create-grid#id-2.-sleep_after_seconds) 2\. [**sleep\_after\_seconds**](https://docs.origami.tech/function/optional-parameters/sleep-after-seconds#sleep_after_seconds-greater-than-decimal) : * **Type**: Number * **Description**: The time interval (in seconds) between grid updates. * **Purpose**: Controls how often the grid is refreshed, balancing performance and API usage efficiency. These fields are not mandatory but can optimize grid operations by managing API request frequency and reducing the likelihood of exceeding exchange limits. Example:[](https://docs.origami.tech/user-guide/create-grid#example-3) `300` `300 * (1 +` [`random`](https://docs.origami.tech/function/functions/random) `())` `300 + 150 *` [`random`](https://docs.origami.tech/function/functions/random) `()` [](https://docs.origami.tech/user-guide/create-grid#post-only) **Post-Only** --------------------------------------------------------------------------------- * **Description**: When this option is enabled, users act as market makers. * **Functionality**: * If the **Post-Only** option is selected, any limit order you place will never immediately match with an existing order in the order book. * Instead, it ensures that your order always enters the order book as a maker order, providing liquidity rather than taking it. This option is useful for users looking to avoid taker fees or ensure their orders contribute to market liquidity. [](https://docs.origami.tech/user-guide/create-grid#working-with-the-grid) **Working with the Grid** --------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-grid#id-1.-activating-the-grid) 1\. **Activating the Grid** * To activate the grid, toggle the **Toggle Switch** to the **enabled** state. This action will initiate the grid and start executing the configured trading strategy. ![activating grid on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252Fp9RAjvH1HghovBuWwSL2%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.07.47.png%3Falt%3Dmedia%26token%3D0b8b2a8e-6b49-4baf-840e-fead88952e5d&width=768&dpr=4&quality=100&sign=cbdc703a&sv=2) [](https://docs.origami.tech/user-guide/create-grid#adding-additional-parameters) **Adding Additional Parameters** ----------------------------------------------------------------------------------------------------------------------- * To create and configure additional parameters for your grid, click the **\+ Add Row** button. This allows you to define custom settings or expand the functionality of your grid configuration as needed. ![adding parameters to the grid](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FOOIYIjwHesvikLKLzbOn%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.10.00.png%3Falt%3Dmedia%26token%3Dc6f06f46-560f-4736-8cda-4345ee3526bb&width=768&dpr=4&quality=100&sign=bfae4243&sv=2) [](https://docs.origami.tech/user-guide/create-grid#configuring-additional-parameters) **Configuring Additional Parameters** --------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-grid#id-1.-enter-variable-name-and-value) **1\. Enter Variable Name and Value** * In the newly added row, input the **variable name** and its corresponding **value**. * You can create auxiliary parameters to be used in formulas for more advanced configurations. ### [](https://docs.origami.tech/user-guide/create-grid#id-2.-save-changes) 2\. **Save Changes** * After making any adjustments to the grid, ensure you **save the changes** to apply the new settings. This approach enables dynamic and flexible grid customization tailored to specific trading strategies. ![save changes on origami tech new grid](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FBaQukLJ3dNVull2kJx0C%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.35.36.png%3Falt%3Dmedia%26token%3D8d9374a8-73d9-4ff6-8a4d-ac887c636216&width=768&dpr=4&quality=100&sign=bafc08d5&sv=2) [](https://docs.origami.tech/user-guide/create-grid#previewing-calculated-orders) **Previewing Calculated Orders** ----------------------------------------------------------------------------------------------------------------------- * To view the pre-calculated orders based on the logic defined in the grid, click the **Research** button. This feature allows you to verify and analyze the orders before activation, ensuring the grid is configured correctly and aligns with your trading strategy. ![Previewing Calculated Orders on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F1FxpkNNJBYZSDSu5glPJ%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-23%2520%25D0%25B2%252000.59.43.png%3Falt%3Dmedia%26token%3Df2f877ec-75be-460e-bff5-e6006360d345&width=768&dpr=4&quality=100&sign=f01c4a2e&sv=2) #### [](https://docs.origami.tech/user-guide/create-grid#custom-parameter-with-floating-point-decimal-value) Custom parameter with floating point (decimal) value It is possible to create custom parameters with decimal or integer value _Example:_ _Create custom parameter_ `_spread_` _and use it in_ [execute\_price](https://docs.origami.tech/function/required-parameters/execute-price) #### [](https://docs.origami.tech/user-guide/create-grid#custom-formula) Custom formula Also, it is possible to create custom formula as parameter’s value and use parameter’s key as alias for it. 1. Define new parameter with some name (ex: `spread`) 2. Define parameter value with some formula (ex: [`random`](https://docs.origami.tech/function/functions/random) `() * 2`) An example of using additional parameters to set a grid with a spread of 1% and a step of 2% for subsequent orders. ![creating custom formula on the grid for origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FcV0nkNr0ayjfmZInRB4z%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.39.08.png%3Falt%3Dmedia%26token%3D8baa1043-9751-4361-bf6d-2b37fa12a15d&width=768&dpr=4&quality=100&sign=e1351219&sv=2) [](https://docs.origami.tech/user-guide/create-grid#editing-in-json-format) **Editing in JSON Format** ----------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/user-guide/create-grid#id-1.-switch-to-json-mode) 1\. **Switch to JSON Mode** * Click the **Turn into JSON** button to enable editing the grid in JSON format. ### [](https://docs.origami.tech/user-guide/create-grid#id-2.-use-cases) 2\. Use Cases: * Quickly **insert** a previously saved or pre-written grid configuration. * **Copy** the current grid settings for reuse or backup. * Make detailed edits directly in the JSON structure for faster and precise adjustments. ### [](https://docs.origami.tech/user-guide/create-grid#id-3.-save-changes) 3\. Save Changes * After editing, ensure you save the configuration to apply the updates. This feature is ideal for users who prefer direct JSON manipulation or need to efficiently manage complex grid setups. ![save changes on the grid on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FLSumNPfjdLOOjVuMzmPX%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.35.36.png%3Falt%3Dmedia%26token%3Db5b0091c-f4ee-46ac-9027-1d1dec5e2417&width=768&dpr=4&quality=100&sign=6a2627e5&sv=2) [](https://docs.origami.tech/user-guide/create-grid#verifying-variables-before-saving) **Verifying Variables Before Saving** --------------------------------------------------------------------------------------------------------------------------------- 1. **Preview Variables** * Before saving your changes in JSON format, click the **Show Form** button. 2. **Purpose**: * This step ensures that all variables and parameters are correctly recorded and properly mapped to the grid's logic. 3. **Save Changes** * Once verified, proceed to save the configuration to finalize the grid setup. This process helps avoid errors and ensures the grid operates as intended. ![Verifying Variables Before Saving on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252FjoO9LYhIzJeMoEfeqC2S%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.47.15.png%3Falt%3Dmedia%26token%3D35f66280-9c05-4e59-aed6-99dad3a27865&width=768&dpr=4&quality=100&sign=b1ff0c8b&sv=2) ![save form and Verifying Variables Before Saving](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F2RwCXk2TAuMetooouJvk%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.51.30.png%3Falt%3Dmedia%26token%3D243bf404-0c21-454a-bda2-c184d23aa23e&width=768&dpr=4&quality=100&sign=f0f1171a&sv=2) ![bot grid set up on origami tech](https://docs.origami.tech/~gitbook/image?url=https%3A%2F%2F3075831504-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fh6BkURa7HNU017yGuhBt%252Fuploads%252F6zwST3VZ4IC0sHkPXbf5%252F%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202024-12-22%2520%25D0%25B2%252016.51.48.png%3Falt%3Dmedia%26token%3D6435e9f2-80e0-4406-8197-dac69c6a63bc&width=768&dpr=4&quality=100&sign=fe26dcf3&sv=2) * * * [PreviousCreate Futures Bot](https://docs.origami.tech/user-guide/create-futures-bot) [NextGrids Examples](https://docs.origami.tech/user-guide/grids-examples) Last updated 1 month ago * [Before Creating a Grid](https://docs.origami.tech/user-guide/create-grid#before-creating-a-grid) * [Creating a Grid: Initial Setup](https://docs.origami.tech/user-guide/create-grid#creating-a-grid-initial-setup) * [Mandatory Fields:](https://docs.origami.tech/user-guide/create-grid#mandatory-fields) * [1\. execute\_price:](https://docs.origami.tech/user-guide/create-grid#id-1.-execute_price) * [2\. execute\_volume:](https://docs.origami.tech/user-guide/create-grid#id-2.-execute_volume) * [3\. buy\_order\_count:](https://docs.origami.tech/user-guide/create-grid#id-3.-buy_order_count) * [4\. sell\_order\_count:](https://docs.origami.tech/user-guide/create-grid#id-4.-sell_order_count) * [Optional Fields](https://docs.origami.tech/user-guide/create-grid#optional-fields) * [1\. time\_between\_orders:](https://docs.origami.tech/user-guide/create-grid#id-1.-time_between_orders) * [2\. sleep\_after\_seconds:](https://docs.origami.tech/user-guide/create-grid#id-2.-sleep_after_seconds) * [Post-Only](https://docs.origami.tech/user-guide/create-grid#post-only) * [Working with the Grid](https://docs.origami.tech/user-guide/create-grid#working-with-the-grid) * [1\. Activating the Grid](https://docs.origami.tech/user-guide/create-grid#id-1.-activating-the-grid) * [Adding Additional Parameters](https://docs.origami.tech/user-guide/create-grid#adding-additional-parameters) * [Configuring Additional Parameters](https://docs.origami.tech/user-guide/create-grid#configuring-additional-parameters) * [1\. Enter Variable Name and Value](https://docs.origami.tech/user-guide/create-grid#id-1.-enter-variable-name-and-value) * [2\. Save Changes](https://docs.origami.tech/user-guide/create-grid#id-2.-save-changes) * [Previewing Calculated Orders](https://docs.origami.tech/user-guide/create-grid#previewing-calculated-orders) * [Editing in JSON Format](https://docs.origami.tech/user-guide/create-grid#editing-in-json-format) * [1\. Switch to JSON Mode](https://docs.origami.tech/user-guide/create-grid#id-1.-switch-to-json-mode) * [2\. Use Cases:](https://docs.origami.tech/user-guide/create-grid#id-2.-use-cases) * [3\. Save Changes](https://docs.origami.tech/user-guide/create-grid#id-3.-save-changes) * [Verifying Variables Before Saving](https://docs.origami.tech/user-guide/create-grid#verifying-variables-before-saving) Copy { "execute_price": "ticker() * (1 - spread / 2 + order_pos * gap if side=='buy' else 1 + spread / 2 + order_pos * gap)", "execute_volume": "50 / execute_price", "buy_orders_count": "3", "sell_orders_count": "3", "spread": "0.01", "gap": "0.02" } --- # Percent B | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/percent-b#percent-b) [Percent B](https://docs.origami.tech/function/technical-analysis#percent-b) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- `percent_b(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14, colum: str = "close") -> List[Decimal]` [PreviousPercentage Price Oscillator](https://docs.origami.tech/function/technical-analysis/percentage-price-oscillator) [NextStop-and-Reverse](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) Last updated 1 year ago --- # Mean | Origami Documentation [](https://docs.origami.tech/function/functions/mean#mean-list-decimal-greater-than-decimal) `mean`(_list_\[_decimal_\]) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------------------------ Returns decimal Compute the arithmetic mean (average) of the given list elements Example:[](https://docs.origami.tech/function/functions/mean#example) `mean([2.2, 2.5])` → `2.35` [PreviousGroup Balance](https://docs.origami.tech/function/functions/group-balance) [NextMedian](https://docs.origami.tech/function/functions/median) Last updated 1 year ago --- # Sum | Origami Documentation [PreviousRandom](https://docs.origami.tech/function/functions/random) [NextCached](https://docs.origami.tech/function/functions/cached) --- # Stochastic RSI | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/stochastic-rsi#stochastic-rsi) [Stochastic RSI](https://docs.origami.tech/function/technical-analysis#stochastic-rsi) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ `stochrsi(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], rsi_period: int = 14, stoch_period: int = 14) -> List[Decimal]` [PreviousStochastic Oscillator %K](https://docs.origami.tech/function/technical-analysis/stochastic-oscillator-k) [NextTrue Range](https://docs.origami.tech/function/technical-analysis/true-range) Last updated 1 year ago --- # Average True Range | Origami Documentation `atr(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14) -> List[Decimal]` [](https://docs.origami.tech/function/technical-analysis/average-true-range#average-true-range-atr) Average True Range (ATR) --------------------------------------------------------------------------------------------------------------------------------- [PreviousRSI to price](https://docs.origami.tech/function/technical-analysis/rsi-to-price) [NextBollinger Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands) Last updated 11 months ago --- # Momentum Breakout Bands | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/momentum-breakout-bands#momentum-breakout-bands) [Momentum Breakout Bands](https://docs.origami.tech/function/technical-analysis#momentum-breakout-bands) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ `mobo(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 10, multiplier: float = 0.8, column: str = "close") -> List[[ BBANDS ]]` [PreviousKeltner Channels](https://docs.origami.tech/function/technical-analysis/keltner-channels) [NextPivot Points](https://docs.origami.tech/function/technical-analysis/pivot-points) Last updated 1 year ago --- # VWAP | Origami Documentation [](https://docs.origami.tech/function/functions/vwap#vwap-amounts-list-decimal-prices-list-decimal-greater-than-decimal-or-none) `vwap`(_amounts_:_list_\[_decimal_\], _prices_: _list_\[_decimal_\]) -> _decimal_|_None_ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The volume-weighted average price (VWAP) is a metric that represents the ratio of the total traded value of a token to the aggregate trading volume during a specific period. It serves as an indicator of the average trading price over that period. Returns decimal Compute the volume-weighted average price[](https://docs.origami.tech/function/functions/vwap#compute-the-volume-weighted-average-price) `VWAP = Σ (Volume * Price) / Σ Volume` recommended to use `Price = ( High + Low + Close ) / 3` Example: [PreviousCandles](https://docs.origami.tech/function/functions/candles) [NextAmount Before Price](https://docs.origami.tech/function/functions/amount-before-price) Last updated 1 year ago --- # Count | Origami Documentation [](https://docs.origami.tech/function/functions/count#count-list-any-greater-than-int) `count`(_list_\[_Any_\]) -> _int_ ----------------------------------------------------------------------------------------------------------------------------- Returns the number of list elements Example:[](https://docs.origami.tech/function/functions/count#example) `count([orderbook().ask])` → `50` `count([ask.price for ask in orderbook().ask if ask.price < 1200])` `→` `23` [PreviousLogn](https://docs.origami.tech/function/functions/logn) [NextRandom](https://docs.origami.tech/function/functions/random) Last updated 11 months ago --- # Abs | Origami Documentation [](https://docs.origami.tech/function/functions/abs#abs-decimal-greater-than-decimal) `abs`(_decimal_) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------ Returns the absolute value of the given number Example:[](https://docs.origami.tech/function/functions/abs#example) `abs(-0.1)` `→` `0.1` `abs(0.1)` `→` `0.1` [PreviousExp](https://docs.origami.tech/function/functions/exp) [NextLogn](https://docs.origami.tech/function/functions/logn) Last updated 1 year ago --- # Saved Balance | Origami Documentation [](https://docs.origami.tech/function/functions/saved-balance#saved_balance-coin-str-account_id-optional-int-greater-than-balance) `saved_balance`(_coin_: _str_, _account\_id_: _Optional_\[_int_\]) -> \[[_Balance_](https://docs.origami.tech/function/structures/balance)\ \] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Returns structure that can be used to obtain balance of tokens saved at the moment when `update_balance_formula` returns `True` or any other non-zero value If `account_id` is empty - uses current exchange for bot’s account id `coin` check \[`balance`\] specification **Important:** can’t be used in `update_balance_formula` inside group Example:[](https://docs.origami.tech/function/functions/saved-balance#example) `saved_balance('ETH').available` → 100.2 `saved_balance('base').reserved` → 200.3 `saved_balance(’counter’).total` → 300.5 `saved_balance('USDT').total` → 400.55 [PreviousBalance](https://docs.origami.tech/function/functions/balance) [NextGroup Balance](https://docs.origami.tech/function/functions/group-balance) Last updated 1 year ago --- # RSI to price | Origami Documentation `rsi_to_price`([_candles_](https://docs.origami.tech/function/functions/candles) : _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\], _rsi\_expected_: _float_, _period_: _int_ = 14, _column_\="_close_") -> _Decimal_ * **Parametres:** * **candles:** List\[\[[Candle](https://docs.origami.tech/function/structures#candle)\ \]\] List of candles * **rsi\_expected:** float 70 typically signals that an asset is overbought, below 30 suggests it is oversold. * **period:** int, default 14 Period of RSI ema * **column:** str, default 'close' OHLC - Open high low close. * **Returns:** * Price Example[](https://docs.origami.tech/function/technical-analysis/rsi-to-price#example) [](https://docs.origami.tech/function/technical-analysis/rsi-to-price#relative-strenth-index-rsi-to-price) [Relative Strenth Index (RSI)](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) to price --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [PreviousRelative Strenght Index](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) [NextAverage True Range](https://docs.origami.tech/function/technical-analysis/average-true-range) Last updated 11 months ago --- # Orderbook | Origami Documentation [](https://docs.origami.tech/function/functions/orderbook#orderbook-symbol-optional-str-exchange-optional-str-or-int-greater-than-orderbook) `orderbook`(_symbol_: _Optional_\[_str_\], _exchange_: _Optional_\[_str_|_int_\]) -> \[[_Orderbook_](https://docs.origami.tech/function/structures/orderbook)\ \] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Returns orderbook in [Orderbook](https://docs.origami.tech/function/structures/orderbook) structure. **Parameters:** **symbol :** _**str, default 'base-counter'**_ Use token symbols in the 'symbol-symbol' format. Example: `'ETH-USDT'`,`'`[`base`](https://docs.origami.tech/function/shortcuts/base) `-USDT'`,`’ETH-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `’`. If `symbol` is empty - uses current symbol for bot. Shortcuts [`base`](https://docs.origami.tech/function/shortcuts/base) and [`counter`](https://docs.origami.tech/function/shortcuts/counter) could be used. **exchange : int|str, default bot's exchange** If `symbol` is empty - uses current symbol for bot. (ex.: `'ETH-USDT'`, [`base`](https://docs.origami.tech/function/shortcuts/base) `-USDT`,`’ETH-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `’`) If `exchange` is empty - uses current exchange for bot’s account `symbol` must be specified for usage in `update_balance_formula` inside group `exchange` must be specified for usage in `update_balance_formula` inside group Example:[](https://docs.origami.tech/function/functions/orderbook#example) `orderbook().bid[0].price` → 0.65… `orderbook('`[`base`](https://docs.origami.tech/function/shortcuts/base) `-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `').bid[0].price` → 0.65… `orderbook().bid[0].amount` → 300.51 `orderbook(’`[`base`](https://docs.origami.tech/function/shortcuts/base) `-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `’,'mexc').bid[0].amount` → 300.51 `orderbook(’ETH-USDT’).bid[0].amount` → 3000 `orderbook('BTC-ETH', exchange='gateio').bid[0].amount` → 300.51 `orderbook(exchange=8).ask[0].amount` → 300.51 `orderbook(exchange='mexc').ask[0].amount` → 100.23 [PreviousTicker](https://docs.origami.tech/function/functions/ticker) [NextCandles](https://docs.origami.tech/function/functions/candles) Last updated 1 year ago --- # Min | Origami Documentation [](https://docs.origami.tech/function/functions/min#min-tuple-decimal-...-greater-than-decimal) `min`(_tuple_\[_decimal_,...\]) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------------------------------- Returns min value from provided parameters Example:[](https://docs.origami.tech/function/functions/min#example) `min(0.1, 0.2)` `→` `0.2` [PreviousMax](https://docs.origami.tech/function/functions/max) [NextExp](https://docs.origami.tech/function/functions/exp) Last updated 1 year ago --- # Group Balance | Origami Documentation [](https://docs.origami.tech/function/functions/group-balance#group_balance-coin-str-group_id-optional-int-greater-than-groupbalance) `group_balance`(_coin_: _str_, _group\_id_: _Optional_\[_int_\]) -> \[[_GroupBalance_](https://docs.origami.tech/function/structures/groupbalance)\ \] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Returns structure that can be used to obtain balance of tokens saved at the moment when `update_balance_formula` **in group** returns `True` or any other non-zero value If `group_id` is empty - uses current exchange for bot’s account.group\_id `coin` check \[`balance`\] specification Example:[](https://docs.origami.tech/function/functions/group-balance#example) `group_balance('USDT').start.available` → 100.2 `group_balance('ETH').start.reserved` → 2.3056 `group_balance(’base’).current.available` → 300.5 `group_balance('counter').current.total` → 300.5 `group_balance('base', group_id=100).start.total` → 100.1 [PreviousSaved Balance](https://docs.origami.tech/function/functions/saved-balance) [NextMean](https://docs.origami.tech/function/functions/mean) Last updated 1 year ago --- # Exponential Moving Average | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/exponential-moving-average#exponential-moving-average) [Exponential Moving Average](https://docs.origami.tech/function/technical-analysis#exponential-moving-average) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ `ema(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14, column: str = "close") -> List[Decimal]` [PreviousDonchian Channel](https://docs.origami.tech/function/technical-analysis/donchian-channel) [NextKaufman Efficiency Indicator](https://docs.origami.tech/function/technical-analysis/kaufman-efficiency-indicator) Last updated 1 year ago --- # Var | Origami Documentation [](https://docs.origami.tech/function/functions/var#var-name-str-default-decimal-cache_by-tuple) `var`(_name_: _str_, _default_: _decimal_, _cache\_by_: _tuple_\=()) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Function that is used for holding dynamic variables. Returns object that supports: `get() -> decimal` returns value of variable or default if unset `set(value: decimal, ttl: decimal=inf) -> decimal` set value to `value` , returns value `ttl` - optional ttl of variable, default to inf Examples: `get` returns 5 if variable unset Set variable’s value to 10 Example: [PreviousIs NaN](https://docs.origami.tech/function/functions/is-nan) [NextTechnical analysis](https://docs.origami.tech/function/technical-analysis) Last updated 1 year ago --- # Random | Origami Documentation [](https://docs.origami.tech/function/functions/random#random-greater-than-decimal) `random`() -> _decimal_ ---------------------------------------------------------------------------------------------------------------- returns random decimal value in range `[0, 1]` Be careful using this function in execute\_price or execute\_volume. Usage without cached will lead to unstoppable recreate of the grid. [PreviousCount](https://docs.origami.tech/function/functions/count) [NextSum](https://docs.origami.tech/function/functions/sum) Last updated 1 year ago --- # Kaufman Efficiency Indicator | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/kaufman-efficiency-indicator#kaufman-efficiency-indicator) [Kaufman Efficiency Indicator](https://docs.origami.tech/function/technical-analysis#kaufman-efficiency-indicator) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `er(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14, column: str = "close") -> List[Decimal]` [PreviousExponential Moving Average](https://docs.origami.tech/function/technical-analysis/exponential-moving-average) [NextKaufman's Adaptive Moving Average](https://docs.origami.tech/function/technical-analysis/kaufmans-adaptive-moving-average) Last updated 1 year ago --- # Stochastic Oscillator %K | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/stochastic-oscillator-k#stochastic-oscillator-k) [Stochastic Oscillator %K](https://docs.origami.tech/function/technical-analysis#stochastic-oscillator-k) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `stoch(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14) -> List[Decimal]` [PreviousStop-and-Reverse](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) [NextStochastic RSI](https://docs.origami.tech/function/technical-analysis/stochastic-rsi) Last updated 1 year ago --- # Max | Origami Documentation [](https://docs.origami.tech/function/functions/max#max-tuple-decimal-...-greater-than-decimal) `max`(_tuple_\[_decimal_,...\]) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------------------------------- Returns max value from provided parameters Example:[](https://docs.origami.tech/function/functions/max#example) `max(0.1, 0.2)` `→` `0.2` [PreviousMedian](https://docs.origami.tech/function/functions/median) [NextMin](https://docs.origami.tech/function/functions/min) Last updated 1 year ago --- # Stop-and-Reverse | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/stop-and-reverse#stop-and-reverse) [Stop-and-Reverse](https://docs.origami.tech/function/technical-analysis#stop-and-reverse) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `sar(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], af: float = 0.02, amax: float = 0.2) -> List[Decimal]` [PreviousPercent B](https://docs.origami.tech/function/technical-analysis/percent-b) [NextStochastic Oscillator %K](https://docs.origami.tech/function/technical-analysis/stochastic-oscillator-k) Last updated 1 year ago --- # Exp | Origami Documentation [](https://docs.origami.tech/function/functions/exp#exp-decimal-greater-than-decimal) `exp`(_decimal_) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------ Returns decimal Compute the exponent value Example:[](https://docs.origami.tech/function/functions/exp#example) `exp(5)` `→` `148.4131591025766` [PreviousMin](https://docs.origami.tech/function/functions/min) [NextAbs](https://docs.origami.tech/function/functions/abs) Last updated 1 year ago --- # Ticker | Origami Documentation [](https://docs.origami.tech/function/functions/ticker#ticker-symbol-optional-str-exchange-optional-int-or-str-greater-than-decimal) `ticker`(_symbol_: _Optional_\[_str_\], _exchange_: _Optional_\[_int_|_str_\]) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Returns last price for `symbol` on `exchange` . **Parameters:** **symbol :** _**str**_**,** _**default 'base-counter'**_ Use token symbols in the 'symbol-symbol' format. Example: `'ETH-USDT'`,`'`[`base`](https://docs.origami.tech/function/shortcuts/base) `-USDT'`,`’ETH-`[`counter`](https://docs.origami.tech/function/shortcuts/counter) `’`. If `symbol` is empty - uses current symbol for bot. Shortcuts [`base`](https://docs.origami.tech/function/shortcuts/base) and [`counter`](https://docs.origami.tech/function/shortcuts/counter) could be used. **exchange :** _**int|str**_**,** _**default bot's exchange**_ If `exchange` is empty - uses current exchange for bot’s account. Exchanges names and indexes could be found in [Exchange list](https://docs.origami.tech/function/exchanges-list) . **Returns:** _**Decimal**_ Example:[](https://docs.origami.tech/function/functions/ticker#example) Returns the last price for current bot's symbol and exchange. Copy ticker() * * * Returns the last price from Bybit for current bot's symbol. [Exchange Names](https://docs.origami.tech/function/exchanges-list) . Copy ticker('base-counter','bybit') * * * Returns Bybit's last price for current bot's symbol. [Exchange ID](https://docs.origami.tech/function/exchanges-list) . Copy ticker('base-counter',23) * * * Returns Binance's last price for current bot's base in ETH. [Exchange Names](https://docs.origami.tech/function/exchanges-list) . Copy ticker('base-ETH','binance') * * * Returns Gate's last price for ETH in USDT. Copy ticker('ETH-USDT','gateio') * * * Converts current bot's Base in ETH price to price in USDT. Copy ticker('base-ETH')*ticker('ETH-USDT','bybit') [PreviousFunctions](https://docs.origami.tech/function/functions) [NextOrderbook](https://docs.origami.tech/function/functions/orderbook) Last updated 10 months ago --- # Balance | Origami Documentation [](https://docs.origami.tech/function/functions/balance#balance-coin-str-account_id-optional-int-greater-than-balance) `balance`(_coin_: _str_, _account\_id_: _Optional_\[_int_\]) -> \[[_Balance_](https://docs.origami.tech/function/structures/balance)\ \] ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Parametrs: coin: {‘base’, ‘counter’, token ticker} `coin` \[shortcuts\] can’t be used in `update_balance_formula` inside group account\_id: int, default current bot account id Account id you can find in URL [https://terminal.bitmaker.fi/accounts/add?accountID=10](https://terminal.bitmaker.fi/accounts/add?accountID=10) `account_id` should be specified for usage in `update_balance_formula` inside group Returns: Returns structure that can be used to obtain balance of tokens on the account Example:[](https://docs.origami.tech/function/functions/balance#example) `balance('USDT').available` → 1000.2 `balance('ETH').reserved` → 20.3 `balance(’BTC’).total` → 1.5 `balance(’counter’).reserved` → 6.55 `balance('base').total` → 300.5 `balance('base', account_id=100).total` → 10 [PreviousSymbol](https://docs.origami.tech/function/functions/symbol) [NextSaved Balance](https://docs.origami.tech/function/functions/saved-balance) Last updated 1 year ago --- # Remove NaN | Origami Documentation [](https://docs.origami.tech/function/functions/remove-nan#remove_nan-list-decimal-greater-than-list-decimal) `remove_nan`(_list_\[_decimal_\]) -> _list_\[_decimal_\] --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Returns list with dropped decimal(Nan) Example:[](https://docs.origami.tech/function/functions/remove-nan#example) `remove_nan([0.2, 0.1, Nan])` `→` `[0.2, 0.1]` [PreviousCached](https://docs.origami.tech/function/functions/cached) [NextIs NaN](https://docs.origami.tech/function/functions/is-nan) Last updated 1 year ago --- # Keltner Channels | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/keltner-channels#keltner-channels) [Keltner Channels](https://docs.origami.tech/function/technical-analysis#keltner-channels) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `kc(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 20, atr_period: int = 10, kc_mult: float: 2) -> List[KC]` where `KC` this is object with fields `upper`, `lower` [PreviousKaufman's Adaptive Moving Average](https://docs.origami.tech/function/technical-analysis/kaufmans-adaptive-moving-average) [NextMomentum Breakout Bands](https://docs.origami.tech/function/technical-analysis/momentum-breakout-bands) Last updated 1 year ago --- # Percentage Price Oscillator | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/percentage-price-oscillator#percentage-price-oscillator) [Percentage Price Oscillator](https://docs.origami.tech/function/technical-analysis#percentage-price-oscillator) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `ppo(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], fast: int = 12, slow: int = 26, signal: int = 9, column: str = "close") -> List[PPO]` where `PPO` this is object with fields: `ppo`, `signal`, `histogram` [PreviousPivot Points](https://docs.origami.tech/function/technical-analysis/pivot-points) [NextPercent B](https://docs.origami.tech/function/technical-analysis/percent-b) Last updated 1 year ago --- # Triple Exponential Moving Average Oscillator | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/triple-exponential-moving-average-oscillator#triple-exponential-moving-average-oscillator) [Triple Exponential Moving Average Oscillator](https://docs.origami.tech/function/technical-analysis#triple-exponential-moving-average-oscillator) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ `trix(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14, column: str = "close") -> List[Decimal]` [PreviousTrue Range](https://docs.origami.tech/function/technical-analysis/true-range) [NextVolume Adjusted Moving Average](https://docs.origami.tech/function/technical-analysis/volume-adjusted-moving-average) Last updated 1 year ago --- # Is NaN | Origami Documentation [](https://docs.origami.tech/function/functions/is-nan#is_nan-decimal-greater-than-bool) `is_nan`(_decimal_) -> _bool_ --------------------------------------------------------------------------------------------------------------------------- Returns bool True if input Nan and False if input not Nan Example:[](https://docs.origami.tech/function/functions/is-nan#example) `is_nan(Nan)` → `true` `is_nan(1.1)` → `false` [PreviousRemove NaN](https://docs.origami.tech/function/functions/remove-nan) [NextVar](https://docs.origami.tech/function/functions/var) Last updated 1 year ago --- # Volume Adjusted Moving Average | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/volume-adjusted-moving-average#volume-adjusted-moving-average) [Volume Adjusted Moving Average](https://docs.origami.tech/function/technical-analysis#volume-adjusted-moving-average) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `vama(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], period: int = 14, column: str = "close") -> List[Decimal]` [PreviousTriple Exponential Moving Average Oscillator](https://docs.origami.tech/function/technical-analysis/triple-exponential-moving-average-oscillator) [NextStructures](https://docs.origami.tech/function/structures) Last updated 1 year ago --- # Logn | Origami Documentation [](https://docs.origami.tech/function/functions/logn#logn-x-decimal-greater-than-decimal) `logn`(_x_: _decimal_) -> _decimal_ ---------------------------------------------------------------------------------------------------------------------------------- Natural log. Returns `decimal` [PreviousAbs](https://docs.origami.tech/function/functions/abs) [NextCount](https://docs.origami.tech/function/functions/count) Last updated 1 year ago --- # Cached | Origami Documentation [](https://docs.origami.tech/function/functions/cached#cached-ttl-int-respect-str-order_pos-cached_value-str) `cached`(_ttl_: _int_, _respect_: _str_ \=’_order\_pos_’)(_cached\_value_: _str_) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Function that is typically used for caching equitation results of `cached_value` formula. `cached_value` string representation is used as a key for cache `ttl` positive integer which is defines time-to-live for cache `respect` one of (default `order_pos`): * `order_pos` - calculate `cached_value` for each order in grid * `grid` - calculate `cached_value` for the whole grid * `bot` - calculate `cached_value` for the whole bot * `global` - calculate `cached_value` . Results are used for all bots `respect=”order_pos”` must not be used with `update_balance_formula` inside group and bot `respect=”grid”` must not be used with `update_balance_formula` inside group and bot `respect=”bot”` must not be used with `update_balance_formula` inside group `respect='order_pos'` orders are the same during `ttl` seconds `respect='grid'` all orders are placed with the same inside one grid during `ttl` seconds Grids must exist to use this type of cache due to the need to get the `grid.id` but the price changes between grids `respect='bot'` all orders are placed with the same over the all grids in one bot during `ttl` seconds \*Warning: bot must exist to use this type of cache due to the need to get the `bot.id` `respect='global'` all orders are placed with the same over the all bots during `ttl` seconds Example: [PreviousSum](https://docs.origami.tech/function/functions/sum) [NextRemove NaN](https://docs.origami.tech/function/functions/remove-nan) Last updated 1 year ago --- # Median | Origami Documentation [](https://docs.origami.tech/function/functions/median#median-list-decimal-greater-than-decimal) `median`(_list_\[_decimal_\]) -> _decimal_ ------------------------------------------------------------------------------------------------------------------------------------------------ Returns decimal Compute the median of the given list elements Example:[](https://docs.origami.tech/function/functions/median#example) `median([2.2, 2.5, 5.5])` `→` `2.5` [PreviousMean](https://docs.origami.tech/function/functions/mean) [NextMax](https://docs.origami.tech/function/functions/max) Last updated 1 year ago --- # True Range | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/true-range#true-range) [True Range](https://docs.origami.tech/function/technical-analysis#true-range) -------------------------------------------------------------------------------------------------------------------------------------------------------------------- `tr(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]]) -> List[Decimal]` [PreviousStochastic RSI](https://docs.origami.tech/function/technical-analysis/stochastic-rsi) [NextTriple Exponential Moving Average Oscillator](https://docs.origami.tech/function/technical-analysis/triple-exponential-moving-average-oscillator) Last updated 1 year ago --- # Kaufman's Adaptive Moving Average | Origami Documentation [](https://docs.origami.tech/function/technical-analysis/kaufmans-adaptive-moving-average#kaufmans-adaptive-moving-average) [Kaufman's Adaptive Moving Average](https://docs.origami.tech/function/technical-analysis#kaufmans-adaptive-moving-average) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- `kama(`[`candles`](https://docs.origami.tech/function/functions/candles) `: List[[`[`Candle`](https://docs.origami.tech/function/structures#candle)\ `]], er: int = 10, fast: int = 2, slow: int = 30, period: int = 20, column: str = "close") -> List[Decimal]` [PreviousKaufman Efficiency Indicator](https://docs.origami.tech/function/technical-analysis/kaufman-efficiency-indicator) [NextKeltner Channels](https://docs.origami.tech/function/technical-analysis/keltner-channels) Last updated 1 year ago --- # Bollinger Bands | Origami Documentation `bbands`([_candles_](https://docs.origami.tech/function/functions/candles) : _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\], _period_: _int_ \= 20, _multiplier_: _float_ \= 2, _column_: _str_ \= "_close_") -> _List_\[_BBANDS_\] * Parametrs: * _candles_: _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\] * _period_: _int, default 20_ * _multiplier_: _float, default 2_ * _column: str, deafault 'close'_ * OHCLV - open high close low * _Returns:_ * `BBANDS` this is object with fields `upper`, `middle`, `lower` [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#bollinger-bands) Bollinger Bands -------------------------------------------------------------------------------------------------------------- Bollinger Bands serve as a technical analysis tool used to identify when prices may be high or low in comparison to recent trends. Constructing Bollinger Bands Bollinger Bands are created by plotting three lines based on the price movements of a security. The central line represents the intermediate-term trend, usually calculated as a 20-day simple moving average (SMA) of closing prices. The upper and lower bands are drawn at a set number of standard deviations above and below the central line, typically two standard deviations. To calculate the bands, the number of periods used for the SMA and the standard deviation must be determined. The standard deviation indicates the degree of price variation, while the number of standard deviations determines how wide the bands are. Although settings can be customized, the standard setup of a 20-day SMA with two standard deviations is most common. The upper band is calculated by adding two standard deviations to the central SMA, while the lower band is found by subtracting two standard deviations. The distance between the upper and lower bands varies depending on market volatility—when volatility increases, the bands widen, and when volatility decreases, the bands narrow. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#key-takeaways) Key Takeaways * Bollinger Bands are a technical analysis tool designed to assess the relative high and low of an asset’s price by examining its historical fluctuations. * These bands consist of three lines: a central moving average, and an upper and lower band positioned at specific distances from this central line. * The upper and lower bands are typically set at two standard deviations above and below the 20-day simple moving average (SMA). * This construction provides a framework to measure market volatility and determine potential overbought or oversold conditions. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#the-role-of-bollinger-bands) The Role of Bollinger Bands The bands are a direct reflection of the market’s price volatility. As volatility rises, the bands widen, indicating larger price fluctuations. Conversely, when volatility decreases, the bands contract, signaling a period of consolidation. Traders often use Bollinger Bands to identify potential entry and exit points. When an asset’s price approaches or breaches the upper band, it may indicate that the asset is overbought and due for a price correction. Similarly, when the price nears the lower band, it suggests the asset may be oversold and a price rebound is likely. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#understanding-moves-within-the-bands) Understanding Moves Within the Bands The construction of Bollinger Bands is grounded in the principles of statistical analysis, specifically the normal distribution. Standard deviation, a measure of how much a value deviates from its average, is used to define the distance between the bands. The bands are typically set two standard deviations from the SMA, which theoretically contains 95% of an asset's price movements if the price distribution follows a normal curve. This statistical framework helps capture the majority of price fluctuations while accounting for typical volatility. The bands adjust dynamically to market changes, ensuring their relevance across different market conditions. When prices breach the upper or lower bands, it suggests that the asset is trading at an extreme relative to its recent history. A breach of the upper band could signal an overbought condition, while a breach of the lower band may indicate an oversold condition. However, prices can remain outside these bands for extended periods during strong trends. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#signals-at-the-upper-band) Signals at the Upper Band When the price reaches or exceeds the upper band, this can indicate that the asset is overbought, signaling a potential reversal or slowdown in momentum. This scenario often occurs when the price exceeds its typical trading range, suggesting that buyers may be exhausting their enthusiasm. The movement of the price beyond the upper band also signifies heightened volatility. The widening of the bands indicates that price fluctuations have become more significant, often in response to news events, earnings reports, or shifts in market sentiment. For traders employing mean reversion strategies, the upper band can serve as a price target. In markets without a clear trend, hitting the upper band could signal an opportunity to sell or short the asset, with the expectation that the price will move back toward the central band. During a strong uptrend, it is not uncommon for the price to repeatedly touch or even stay above the upper band for extended periods. This persistent movement above the upper band may indicate sustained buying pressure and a continuation of the trend. However, confirmation from other indicators is recommended to ensure that the uptrend is not weakening. The upper band can also serve as a potential breakout point. A price move that starts at the upper band and continues beyond it could indicate the beginning of a new trend, particularly if accompanied by increased trading volume. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#signals-at-the-lower-band) Signals at the Lower Band The lower band of Bollinger Bands is used to identify oversold conditions. When the price touches or falls below the lower band, it may indicate that the asset is undervalued or that selling pressure has gone too far. This condition could lead to a price reversal or a pause in the downward trend. Just as the upper band signifies increased volatility, the lower band marks greater volatility in the context of a downtrend. A price breach of the lower band could indicate that the asset is experiencing significant bearish sentiment. For mean reversion traders, the lower band presents a potential buying opportunity. If the price has fallen to the lower band, it might rebound toward the central band or even higher, particularly in a market without a strong downtrend. However, if the price stays below the lower band for an extended period, this could signal the onset of a stronger downtrend. Continued movement below the band may indicate that bearish momentum is likely to persist. Traders should confirm this signal with other indicators to avoid false signals. A decisive move below the lower band, accompanied by high trading volume, could suggest the start of a new bearish trend, warranting a sell or short position. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#what-widening-bands-mean) What Widening Bands Mean When Bollinger Bands widen, it indicates an increase in volatility, as the price moves further away from the SMA. This heightened volatility can result from various factors, including economic news, earnings releases, or significant shifts in market sentiment. Widening bands often signal the beginning of a major price trend. As volatility increases, the likelihood of sustained price movements in one direction also rises. Traders should confirm these signals with other technical indicators or price patterns before taking action. Widening bands can also occur after a period of contraction, known as a "squeeze." A squeeze often precedes a breakout, although the direction of the breakout is uncertain. To gauge the potential direction, traders should monitor the price movement in relation to the bands and other technical indicators. ### [](https://docs.origami.tech/function/technical-analysis/bollinger-bands#what-tightening-bands-mean) What Tightening Bands Mean A contraction of the bands suggests lower volatility, with price movements becoming more confined. Tightening bands indicate that market interest may be waning, and price fluctuations are becoming smaller. Despite reduced volatility, tightening bands can be a precursor to major price movements or breakouts. Traders closely watch for a breakout after a period of tight bands, as these are often followed by strong trends in either direction. Tightening bands also indicate uncertainty in the market. If prices remain within a narrow range, traders may wait for new information or a breakout event to trigger a more decisive price movement. How Reliable are Bollinger Bands? The reliability of Bollinger Bands as a predictive tool depends on several factors: * Asset Characteristics * Different assets exhibit varying degrees of volatility, affecting the utility of Bollinger Bands. Assets prone to sudden volatility spikes may behave unpredictably within the bands. * Parameter Settings * The standard settings for Bollinger Bands are a 20-period SMA and bands placed at two standard deviations. However, these parameters can be adjusted depending on the asset or time frame being analyzed. * Complementary Indicators * Bollinger Bands work best when used in conjunction with other technical indicators, such as volume or momentum oscillators like the RSI or MACD. These additional tools can help confirm signals and provide further context. * Outlier Events * Bollinger Bands assume a normal distribution of price returns, but financial markets often experience "fat tails," where prices deviate significantly from the mean. In such cases, prices can breach the bands without indicating a reversal or significant change. Another strategy based on Bollinger Bands is the Bollinger Bounce, which involves buying or selling when the price rebounds from the upper or lower bands toward the central line. This strategy works well in ranging markets where prices oscillate between the bands without a clear trend. In conclusion, while Bollinger Bands are a powerful tool for assessing market volatility and identifying potential entry and exit points, they should be used in conjunction with other indicators and analysis techniques to confirm trading signals and manage risk effectively. Limitations of Using Bollinger Bands Bollinger Bands, while a valuable tool in technical analysis, do have several limitations that traders should be mindful of. * First, they are a lagging indicator, meaning they react to price movements rather than predict them. As a result, they may signal changes only after the price has already begun to move, potentially causing traders to miss the optimal moment for action. * Second, during periods of high market volatility, when the bands expand significantly, Bollinger Bands can sometimes produce false signals. In such times, price movements may breach the bands without indicating a true reversal, leading to misleading or premature conclusions. * Third, the default settings of Bollinger Bands—using a 20-day simple moving average (SMA) and two standard deviations—may not be appropriate for every trading scenario. These settings, while effective in many cases, may need adjustment depending on the asset or market conditions being analyzed. * Finally, while Bollinger Bands can provide useful insights, they are often more reliable when used in conjunction with other indicators, such as volume analysis or momentum oscillators. Relying solely on Bollinger Bands without additional confirmation can result in poor trading decisions, as they may not capture the full scope of market dynamics. In short, while Bollinger Bands are a powerful tool for identifying price extremes and volatility, traders should use them with caution and in combination with other strategies to ensure more accurate predictions and sound decision-making. [PreviousAverage True Range](https://docs.origami.tech/function/technical-analysis/average-true-range) [NextDonchian Channel](https://docs.origami.tech/function/technical-analysis/donchian-channel) Last updated 11 months ago * [Bollinger Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands#bollinger-bands) * [Key Takeaways](https://docs.origami.tech/function/technical-analysis/bollinger-bands#key-takeaways) * [The Role of Bollinger Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands#the-role-of-bollinger-bands) * [Understanding Moves Within the Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands#understanding-moves-within-the-bands) * [Signals at the Upper Band](https://docs.origami.tech/function/technical-analysis/bollinger-bands#signals-at-the-upper-band) * [Signals at the Lower Band](https://docs.origami.tech/function/technical-analysis/bollinger-bands#signals-at-the-lower-band) * [What Widening Bands Mean](https://docs.origami.tech/function/technical-analysis/bollinger-bands#what-widening-bands-mean) * [What Tightening Bands Mean](https://docs.origami.tech/function/technical-analysis/bollinger-bands#what-tightening-bands-mean) --- # Relative Strenght Index | Origami Documentation `rsi`([_candles_](https://docs.origami.tech/function/functions/candles) : _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\], _period_: _int_ \= 14, _column_: _str_ \= "_close_") -> _List_\[_Decimal_\] * Parameters: * _candles_: _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\] * _period_: _int, default 14_ * _column: str, deafault 'close'_ OHLCV - Open high low close * **Returns: Decimal** Returns number, in range \[0,100\], that indicates that the market is oversold or overbought. Example:[](https://docs.origami.tech/function/technical-analysis/relative-strenght-index#example) [](https://docs.origami.tech/function/technical-analysis/relative-strenght-index#relative-strenght-index-rsi) Relative Strenght Index (RSI) ------------------------------------------------------------------------------------------------------------------------------------------------ Offering insights into the speed and extent of price movements to assess whether an asset is overbought or oversold. By gauging recent price changes, it provides valuable signals regarding the strength of a trend, aiding traders in making informed decisions. Key Insights: * the RSI helps traders detect bullish or bearish momentum * A reading above 70 typically signals that an asset is overbought, while a reading below 30 suggests it is oversold. * In certain market conditions, when the RSI crosses below the overbought level or above the oversold level, traders may interpret this as a signal to buy or sell. * The RSI is most effective within trading ranges and less reliable in trending markets. RSI\=100−(1001+Average GainAverage Loss)\\textbf{RSI}=100-\\left( \\frac{100}{1+\\frac{\\text{Average Gain}}{\\text{Average Loss}}} \\right)RSI\=100−(1+Average LossAverage Gain​100​) ### [](https://docs.origami.tech/function/technical-analysis/relative-strenght-index#how-the-rsi-functions) How the RSI Functions: The RSI compares the average strength of an asset’s price movements on up days to its strength on down days. By doing so, it provides a ratio that helps assess whether the security is experiencing an overextension in either direction. This comparison, when interpreted alongside price movements, offers traders a glimpse into potential future price behavior. When used in conjunction with other technical indicators, the RSI can enhance a trader's ability to make informed decisions, refining entry and exit strategies. The Significance of RSI: * Trend Validation and Reversals: RSI aids traders in confirming prevailing trends and signaling potential reversals. * Overbought and Oversold Conditions: It helps identify when securities may be excessively bought or sold, offering an early warning for price corrections. * Short-Term Signals: For short-term traders, the RSI can serve as a valuable tool, providing actionable buy and sell signals. * Complementary to Other Indicators: The RSI is most potent when used alongside other technical indicators, offering additional support to trading strategies. [PreviousTechnical analysis](https://docs.origami.tech/function/technical-analysis) [NextRSI to price](https://docs.origami.tech/function/technical-analysis/rsi-to-price) Last updated 11 months ago * [Relative Strenght Index (RSI)](https://docs.origami.tech/function/technical-analysis/relative-strenght-index#relative-strenght-index-rsi) * [How the RSI Functions:](https://docs.origami.tech/function/technical-analysis/relative-strenght-index#how-the-rsi-functions) --- # Functions | Origami Documentation [](https://docs.origami.tech/function/functions#market-data) Market Data ----------------------------------------------------------------------------- ### [](https://docs.origami.tech/function/functions#ticker) [`ticker`](https://docs.origami.tech/function/functions/ticker) The current market price of the latest traid on the market. ### [](https://docs.origami.tech/function/functions#orderbook) [`orderbook`](https://docs.origami.tech/function/functions/orderbook) Orderbook from the market in the [Orderbook](https://docs.origami.tech/function/structures/orderbook) structure. ### [](https://docs.origami.tech/function/functions#candles) [`candles`](https://docs.origami.tech/function/functions/candles) Market candlesticks in the [Candle](https://docs.origami.tech/function/structures/candle) structure. ### [](https://docs.origami.tech/function/functions#own) [`own`](https://docs.origami.tech/function/functions/own) Self orders in the [Orderbook](https://docs.origami.tech/function/structures/orderbook) structure. ### [](https://docs.origami.tech/function/functions#vwap) [`vwap`](https://docs.origami.tech/function/functions/vwap) Calculates the volume-weighted average. ### [](https://docs.origami.tech/function/functions#amount_before_price) [`amount_before_price`](https://docs.origami.tech/function/functions/amount-before-price) The amount of basic tokens up to a certain price. ### [](https://docs.origami.tech/function/functions#amount_threshold_index) [`amount_threshold_index`](https://docs.origami.tech/function/functions/amount-threshold-index) * * * [](https://docs.origami.tech/function/functions#balances-and-exchange-info) Balances and Exchange info ----------------------------------------------------------------------------------------------------------- ### [](https://docs.origami.tech/function/functions#symbol) [`symbol`](https://docs.origami.tech/function/functions/symbol) Exchange information in [Symbol](https://docs.origami.tech/function/structures/symbol) structure. ### [](https://docs.origami.tech/function/functions#balance) [`balance`](https://docs.origami.tech/function/functions/balance) Token balance of certain exchange in [Balance](https://docs.origami.tech/function/structures/balance) structure. ### [](https://docs.origami.tech/function/functions#saved_balance) [`saved_balance`](https://docs.origami.tech/function/functions/saved-balance) Saved token balance of certain exchange in [Balance](https://docs.origami.tech/function/structures/balance) structure. ### [](https://docs.origami.tech/function/functions#group_balance) [`group_balance`](https://docs.origami.tech/function/functions/group-balance) The sum of the token balances from all exchanges in the group in [Group Balace](https://docs.origami.tech/function/structures/groupbalance) structure. * * * [](https://docs.origami.tech/function/functions#calculations) Calculations ------------------------------------------------------------------------------- ### [](https://docs.origami.tech/function/functions#mean) [`mean`](https://docs.origami.tech/function/functions/mean) Compute the arithmetic mean (average) of the given list elements. ### [](https://docs.origami.tech/function/functions#median) [`median`](https://docs.origami.tech/function/functions/median) Compute the median of the given list elements. ### [](https://docs.origami.tech/function/functions#max) [`max`](https://docs.origami.tech/function/functions/max) Returns max value of the given list elements. ### [](https://docs.origami.tech/function/functions#min) [`min`](https://docs.origami.tech/function/functions/min) Returns min value of the given list elements. ### [](https://docs.origami.tech/function/functions#exp) [`exp`](https://docs.origami.tech/function/functions/exp) Calculates the exponent value. ### [](https://docs.origami.tech/function/functions#abs) [`abs`](https://docs.origami.tech/function/functions/abs) Returns the absolute value of the given number. ### [](https://docs.origami.tech/function/functions#logn) [`logn`](https://docs.origami.tech/function/functions/logn) Calculates the value of the natural logarithm. ### [](https://docs.origami.tech/function/functions#count) [`count`](https://docs.origami.tech/function/functions/count) Returns the number of the given list elements. ### [](https://docs.origami.tech/function/functions#random) [`random`](https://docs.origami.tech/function/functions/random) Random decimal value in range \[0, 1\]. ### [](https://docs.origami.tech/function/functions#sum) [`sum`](https://docs.origami.tech/function/functions/sum) Sum of the given list elements. * * * [](https://docs.origami.tech/function/functions#other) Other ----------------------------------------------------------------- ### [](https://docs.origami.tech/function/functions#cached) [`cached`](https://docs.origami.tech/function/functions/cached) Used to cache the results of calculating the cached\_value formula for the ttl time in seconds. ### [](https://docs.origami.tech/function/functions#remove_nan) [`remove_nan`](https://docs.origami.tech/function/functions/remove-nan) Drop decimal(Nan) of the given list elements. ### [](https://docs.origami.tech/function/functions#is_nan) [`is_nan`](https://docs.origami.tech/function/functions/is-nan) True if input Nan and False if input not Nan. ### [](https://docs.origami.tech/function/functions#var) [`var`](https://docs.origami.tech/function/functions/var) [PreviousIs Buy First](https://docs.origami.tech/function/optional-parameters/is-buy-first) [NextTicker](https://docs.origami.tech/function/functions/ticker) Last updated 11 months ago * [Market Data](https://docs.origami.tech/function/functions#market-data) * [Balances and Exchange info](https://docs.origami.tech/function/functions#balances-and-exchange-info) * [Calculations](https://docs.origami.tech/function/functions#calculations) * [Other](https://docs.origami.tech/function/functions#other) --- # Technical analysis | Origami Documentation [`rsi`](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) [](https://docs.origami.tech/function/technical-analysis#relative-strenght-index) [Relative Strenght Index](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [`rsi_to_price`](https://docs.origami.tech/function/technical-analysis/rsi-to-price) [](https://docs.origami.tech/function/technical-analysis#rsi-to-price) [RSI to price](https://docs.origami.tech/function/technical-analysis/rsi-to-price) --------------------------------------------------------------------------------------------------------------------------------------------------------------- [`atr`](https://docs.origami.tech/function/technical-analysis/average-true-range) [](https://docs.origami.tech/function/technical-analysis#average-true-range) [Average True Range](https://docs.origami.tech/function/technical-analysis/average-true-range) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`bbands`](https://docs.origami.tech/function/technical-analysis/bollinger-bands) [](https://docs.origami.tech/function/technical-analysis#bollinger-bands) [Bollinger Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [`do`](https://docs.origami.tech/function/technical-analysis/donchian-channel) [](https://docs.origami.tech/function/technical-analysis#donchian-channel) [Donchian Channel](https://docs.origami.tech/function/technical-analysis/donchian-channel) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`ema`](https://docs.origami.tech/function/technical-analysis/exponential-moving-average) [](https://docs.origami.tech/function/technical-analysis#exponential-moving-average) [Exponential Moving Average](https://docs.origami.tech/function/technical-analysis/exponential-moving-average) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`er`](https://docs.origami.tech/function/technical-analysis/kaufman-efficiency-indicator) [](https://docs.origami.tech/function/technical-analysis#kaufman-efficiency-indicator) [Kaufman Efficiency Indicator](https://docs.origami.tech/function/technical-analysis/kaufman-efficiency-indicator) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`kama`](https://docs.origami.tech/function/technical-analysis/kaufmans-adaptive-moving-average) [](https://docs.origami.tech/function/technical-analysis#kaufmans-adaptive-moving-average) [Kaufman's Adaptive Moving Average](https://docs.origami.tech/function/technical-analysis/kaufmans-adaptive-moving-average) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`kc`](https://docs.origami.tech/function/technical-analysis/keltner-channels) [](https://docs.origami.tech/function/technical-analysis#keltner-channels) [Keltner Channels](https://docs.origami.tech/function/technical-analysis/keltner-channels) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`mobo`](https://docs.origami.tech/function/technical-analysis/momentum-breakout-bands) [](https://docs.origami.tech/function/technical-analysis#momentum-breakout-bands) [Momentum Breakout Bands](https://docs.origami.tech/function/technical-analysis/momentum-breakout-bands) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [`pivot`](https://docs.origami.tech/function/technical-analysis/pivot-points) [](https://docs.origami.tech/function/technical-analysis#pivot-points) [Pivot Points](https://docs.origami.tech/function/technical-analysis/pivot-points) --------------------------------------------------------------------------------------------------------------------------------------------------------------- [`ppo`](https://docs.origami.tech/function/technical-analysis/percentage-price-oscillator) [](https://docs.origami.tech/function/technical-analysis#percentage-price-oscillator) [Percentage Price Oscillator](https://docs.origami.tech/function/technical-analysis/percentage-price-oscillator) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ [`percent_b`](https://docs.origami.tech/function/technical-analysis/percent-b) [](https://docs.origami.tech/function/technical-analysis#percent-b) [Percent B](https://docs.origami.tech/function/technical-analysis/percent-b) ------------------------------------------------------------------------------------------------------------------------------------------------------ [`sar`](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) [](https://docs.origami.tech/function/technical-analysis#stop-and-reverse) [Stop-and-Reverse](https://docs.origami.tech/function/technical-analysis/stop-and-reverse) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`stoch`](https://docs.origami.tech/function/technical-analysis/stochastic-oscillator-k) [](https://docs.origami.tech/function/technical-analysis#stochastic-oscillator-k) [Stochastic Oscillator %K](https://docs.origami.tech/function/technical-analysis/stochastic-oscillator-k) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`stochrsi`](https://docs.origami.tech/function/technical-analysis/stochastic-rsi) [](https://docs.origami.tech/function/technical-analysis#stochastic-rsi) [Stochastic RSI](https://docs.origami.tech/function/technical-analysis/stochastic-rsi) --------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`tr`](https://docs.origami.tech/function/technical-analysis/true-range) [](https://docs.origami.tech/function/technical-analysis#true-range) [True Range](https://docs.origami.tech/function/technical-analysis/true-range) --------------------------------------------------------------------------------------------------------------------------------------------------------- [`trix`](https://docs.origami.tech/function/technical-analysis/triple-exponential-moving-average-oscillator) [](https://docs.origami.tech/function/technical-analysis#triple-exponential-moving-average-oscillator) [Triple Exponential Moving Average Oscillator](https://docs.origami.tech/function/technical-analysis/triple-exponential-moving-average-oscillator) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [`vama`](https://docs.origami.tech/function/technical-analysis#volume-adjusted-moving-average) [](https://docs.origami.tech/function/technical-analysis#volume-adjusted-moving-average) [Volume Adjusted Moving Average](https://docs.origami.tech/function/technical-analysis/volume-adjusted-moving-average) --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- [PreviousVar](https://docs.origami.tech/function/functions/var) [NextRelative Strenght Index](https://docs.origami.tech/function/technical-analysis/relative-strenght-index) Last updated 11 months ago --- # Donchian Channel | Origami Documentation `do`([_candles_](https://docs.origami.tech/function/functions/candles) : _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\], _upper\_period_: _int_ \= 20, _lower\_period_: _int_ = 5) -> _List_\[\[_BBANDS_\]\] * Parametrs: * _candles_: _List_\[\[[_Candle_](https://docs.origami.tech/function/structures#candle)\ \]\] * _upper\_period_: _int, default 20_ * _lower\_period_: _int, default 5_ * _Returns:_ * `BBANDS` this is object with fields `upper`, `middle`, `lower` [](https://docs.origami.tech/function/technical-analysis/donchian-channel#donchian-channel) Donchian Channel ----------------------------------------------------------------------------------------------------------------- Donchian Channels: A Key Tool for Identifying Breakout Points ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#key-takeaways) Key Takeaways * Donchian channels are a popular tool, particularly among commodity traders. * The channel consists of two boundary lines: the upper line, representing the highest price of a security over a set number of periods, and the lower line, representing the lowest price over the same period. * These channels are versatile, offering various practical applications for both traders and investors. * When combined with other technical indicators, such as moving averages, volume indicators, and the moving average convergence/divergence (MACD), Donchian channels can provide a more complete view of the market. * Donchian channels can help clarify trends and breakout signals, though their effectiveness depends on careful consideration of period length, market conditions, risk, and the integration with other indicators. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#structure-of-donchian-channels) Structure of Donchian Channels The Donchian channel is formed by plotting two boundary lines. The upper line indicates the highest price of an asset over a defined period, while the lower line reflects the lowest price over the same period. The default setting is typically 20 periods, corresponding to the number of trading days in a month. An optional middle line is often included, representing the average of the upper and lower boundaries. This tool is especially effective in trending markets, allowing traders to visualize price volatility and momentum. When the price breaches the upper boundary, it may signal a buying opportunity, suggesting a bullish trend. Conversely, a break below the lower boundary can indicate a bearish signal, prompting a potential sell. However, in range-bound markets, Donchian channels can yield frequent false signals, making it essential to use them alongside other indicators to confirm trends and filter out noise. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#calculating-donchian-channels) Calculating Donchian Channels The key elements of Donchian channels are the upper band, the lower band, and, optionally, the middle band. The middle band is the average of the upper and lower bands. The primary variable is the period (N), which determines the channel's sensitivity. A smaller value for N makes the channel more responsive to price movements, while a larger N captures broader price trends. Traders typically use shorter periods for short-term trading and longer periods for long-term trend-following strategies. #### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#upper-band) Upper Band: This is calculated by identifying the highest price of an asset over a specified number of periods (N). Upper\=Highest High(N)\\text{Upper}=\\text{Highest High}\\left( \\text{N} \\right)Upper\=Highest High(N) #### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#lower-band) Lower Band: This is the lowest price of the asset over the same number of periods (N). Lower\=Lowest Low(N)\\text{Lower}=\\text{Lowest Low}\\left( \\text{N} \\right)Lower\=Lowest Low(N) #### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#middle-band) Middle Band: The average of the upper and lower bands. Middle\=Upper+Lower2\\text{Middle}=\\frac{\\text{Upper}+\\text{Lower}}{2}Middle\=2Upper+Lower​ ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#practical-applications-of-donchian-channels) Practical Applications of Donchian Channels Donchian channels serve a variety of purposes in technical analysis: * Identifying Trends * Donchian channels are especially useful for identifying the prevailing market trend. When the price consistently trades near the upper band, it signals a strong uptrend, indicating bullish sentiment. Conversely, trading near the lower band signals a downtrend, reflecting bearish sentiment. * Breakout Signals * Donchian channels excel at spotting breakout opportunities. A breakout above the upper band indicates potential for further price increases, while a break below the lower band may signal a selling or short-selling opportunity, suggesting the price will continue to decline. * Support and Resistance Levels * The upper and lower bands often act as support and resistance levels. Traders monitor these levels closely to make buy or sell decisions. For example, a bounce off the lower band may suggest a buying opportunity, while resistance at the upper band could be a cue to sell. * Stop-Loss and Exit Points * Donchian channels are useful for setting stop-loss orders and determining exit points. For instance, placing a stop-loss just below the lower band when buying can help limit potential losses if the market moves unfavorably. * Volatility Measure * The width of the Donchian channel can serve as an indicator of market volatility. A wider channel indicates higher volatility, as the price fluctuates more dramatically over the defined period, while a narrower channel suggests lower volatility. * Filtering Market Noise * For longer-term trading strategies, setting a longer period for the Donchian channel can help filter out market noise, allowing traders to focus on significant price movements. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#integrating-donchian-channels-with-other-indicators) Integrating Donchian Channels with Other Indicators To strengthen trading strategies, Donchian channels can be combined with other technical analysis tools. When used in conjunction with the Relative Strength Index (RSI), moving averages, or MACD, Donchian channels can provide a more comprehensive understanding of market trends and help confirm breakout signals. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#factors-to-consider-when-using-donchian-channels) Factors to Consider When Using Donchian Channels * Selecting the Period Length * The default period setting is 20, but traders may adjust this to suit their strategy. Shorter periods are more responsive to recent price moves, ideal for short-term trading, while longer periods smooth price data, making them better for long-term trend-following strategies. * Market Conditions * Donchian channels are most effective in trending markets. In range-bound or sideways markets, they may generate frequent false signals. Thus, traders must consider overall market conditions and may use other indicators to determine the market phase. * Risk Management * Risk management is crucial in trading. Donchian channels can help set stop-loss orders strategically, either at the lower band for long positions or the upper band for short positions, to mitigate potential losses. * Combining with Other Indicators * To confirm signals and reduce the likelihood of false breakouts, it is beneficial to use Donchian channels alongside other technical indicators such as RSI, MACD, or moving averages. This approach provides a more comprehensive market view. * False Breakouts * A challenge with Donchian channels is the risk of false breakouts. The price may break through a boundary only to reverse direction shortly after, leading to misleading signals. Traders must be cautious and prepared for these potential reversals. * Adjusting for Different Assets * Each asset behaves differently, so it is essential to adjust the Donchian channel settings according to the characteristics of the specific asset or market. * Market Context * Donchian channels focus solely on price data and do not consider broader economic factors, news events, or market sentiment. Therefore, they should be used in conjunction with a broader analysis that takes into account these additional influences. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#limitations-and-risks-of-donchian-channels) Limitations and Risks of Donchian Channels Donchian channels have inherent limitations and risks: * Lagging Indicator * Since Donchian channels are based on historical price data, they react to price movements rather than predicting them, leading to potential delays in entry and exit signals. * False Breakouts * False breakouts are a significant risk, as the price may briefly breach a band before reversing direction, leading to premature trading decisions. * Sideways Markets * In range-bound or sideways markets, Donchian channels may produce frequent false signals, resulting in potential losses. * Overreliance * Relying solely on Donchian channels for trading decisions can be risky. They should be used in conjunction with other tools and strategies for more accurate market analysis. * Improper Period Settings * The effectiveness of Donchian channels depends on the period setting (N). An incorrect setting may lead to ineffective or misleading signals, depending on market conditions and asset characteristics. * Market Context * Donchian channels do not take into account broader market conditions or external factors like economic data or news events, which may significantly impact asset prices. ### [](https://docs.origami.tech/function/technical-analysis/donchian-channel#understanding-the-reliability-of-donchian-channels) Understanding the Reliability of Donchian Channels The reliability of Donchian channels, like any technical analysis tool, varies depending on the market conditions, asset types, and the way they are incorporated into a broader trading strategy. While they are useful for identifying trends and breakouts, traders must be mindful of their limitations and combine them with other indicators and sound trading practices for a more holistic approach. [PreviousBollinger Bands](https://docs.origami.tech/function/technical-analysis/bollinger-bands) [NextExponential Moving Average](https://docs.origami.tech/function/technical-analysis/exponential-moving-average) Last updated 11 months ago * [Donchian Channel](https://docs.origami.tech/function/technical-analysis/donchian-channel#donchian-channel) * [Key Takeaways](https://docs.origami.tech/function/technical-analysis/donchian-channel#key-takeaways) * [Structure of Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#structure-of-donchian-channels) * [Calculating Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#calculating-donchian-channels) * [Practical Applications of Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#practical-applications-of-donchian-channels) * [Integrating Donchian Channels with Other Indicators](https://docs.origami.tech/function/technical-analysis/donchian-channel#integrating-donchian-channels-with-other-indicators) * [Factors to Consider When Using Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#factors-to-consider-when-using-donchian-channels) * [Limitations and Risks of Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#limitations-and-risks-of-donchian-channels) * [Understanding the Reliability of Donchian Channels](https://docs.origami.tech/function/technical-analysis/donchian-channel#understanding-the-reliability-of-donchian-channels) --- # Own | Origami Documentation [](https://docs.origami.tech/function/functions/own#own-symbol-optional-str-bot_id-optional-int-greater-than-orderbook) `own`(_symbol_: _Optional_\[_str_\], _bot\_id_: _Optional_\[_int_\]) -> \[[_Orderbook_](https://docs.origami.tech/function/structures/orderbook)\ \] -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If `bot_id` is empty - uses current bot If `symbol` is empty - uses current bot Example:[](https://docs.origami.tech/function/functions/own#example) `own().bid[0].price` `→ 0.65…` Last updated 1 year ago ---