Origami Documentation
User GuideFunction
  • User Guide
    • Create Project
    • Add accounts
    • API Key Creation
      • Hyperliquid
      • Binance
      • Bybit
      • OKX
      • Gate io
      • Mexc
      • HTX
      • Kucoin
      • BingX
      • Bitget
      • BitMart
    • Create Spot Bot
    • Create Futures Bot
    • Create Grid
  • Function
    • Required parameters
      • Buy Orders Count
      • Sell Orders Count
      • Execute Price
      • Execute Volume
    • Base logic
    • Optional parameters
      • Time Between Orders
      • Sleep After Seconds
      • Is Buy First
    • Functions
      • Ticker
      • Orderbook
      • Candles
      • VWAP
      • Amount Before Price
      • Amount Threshold Index
      • Symbol
      • Balance
      • Saved Balance
      • Group Balance
      • Mean
      • Median
      • Max
      • Min
      • Exp
      • Abs
      • Logn
      • Count
      • Random
      • Sum
      • Cached
      • Remove NaN
      • Is NaN
      • Var
    • Technical analysis
      • Relative Strenght Index
      • RSI to price
      • Average True Range
      • Bollinger Bands
      • Donchian Channel
      • Exponential Moving Average
      • Kaufman Efficiency Indicator
      • Kaufman's Adaptive Moving Average
      • Keltner Channels
      • Momentum Breakout Bands
      • Pivot Points
      • Percentage Price Oscillator
      • Percent B
      • Stop-and-Reverse
      • Stochastic Oscillator %K
      • Stochastic RSI
      • True Range
      • Triple Exponential Moving Average Oscillator
      • Volume Adjusted Moving Average
    • Structures
      • Balance
      • GroupBalance
      • Orderbook
      • OrderBookUnit
      • Symbol
      • Candle
    • Shortcuts
      • Base
      • Counter
    • Exchanges list
    • Pre-defined parameters
      • Order Pos
      • Side
Powered by GitBook
On this page
  1. Function
  2. Functions

Cached

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:

PreviousSumNextRemove NaN

Last updated 6 months ago