LogoLogo
Back to HaasOnline.comSwitch to Developer API
4.x
4.x
  • Welcome
  • TradeServer Cloud
    • Overview
    • Security
    • Troubleshooting
  • TradeServer Enterprise
    • Overview
    • Updates
    • Security
    • Installation
      • Windows
      • MacOS
      • Linux
    • Configuration
      • License Key
      • Login credentials
      • Hosting
        • Linux VPS Hosting
    • Special features
      • Price history
      • Backups
      • Machine Learning
        • Built-in Machine Learning
        • Custom Machine Learning
      • Scripted Exchange API (Coming Soon)
      • Local API (Coming Soon)
    • Troubleshooting
  • Interface
    • General Interface
      • Left Menu
      • Upper Right Items
        • Account data
        • Execute trade
        • AI Chatbots
          • Chatbot Julia
          • Chatbot David
          • Chatbot Thomas
        • Notifications
        • Menu
          • Exchange accounts
          • Settings
          • License information
          • Change Logs
          • Logout
      • Status bar
        • Price tickers
    • Dashboard
    • Bots
      • Bot management
      • Bot templates
    • HaasScript
      • Web Editor
      • Backtest Lab
        • Lab test setup
      • Backtest History
      • Manage Scripts
      • Manage Signals
    • Tools
      • Marketview
      • Market intelligence
      • Exchange profiler
      • Markets explorer
      • News
    • Finance
      • Portfolio
      • External Wallet
  • Haasscript
    • About
      • Change Log
    • Tutorials
      • Bot building
        • Trade-bot building
        • Visual bot building
        • Scripted bot building
      • Usage
        • HaasScript
          • Interval
          • Markets
          • Input Fields
          • Memory Management
          • Signal Handling
          • Position Information
          • Positions Handling
            • Fee correction
          • Order Handling
          • Trading
          • Charting
          • Optimizations
        • Visual Editor
          • Blocks
          • Parameters
          • Flow Control
          • Interaction
        • Script Editor
          • Classes
        • Managed Trading
        • Unmanaged Trading
    • Commands
      • Trade Bots
        • TradeBot Containers
        • Easy Indicators
        • Easy Safeties
        • Easy Insurances
      • Helpers
        • Array Helpers
        • Custom Command Helpers
        • Enumerations
        • Equations
        • Mathematical
        • Memory Helpers
        • Signal Helpers
        • String Helpers
        • Miscellaneous
        • Technical Analysis Helpers
      • Input data
        • Bot Settings
        • Input fields
        • Price Market Information
        • Script Settings
        • Time Information
        • Trade Market Information
      • Prices
      • Technical Analysis
      • Charting
      • Trading
        • Managed Trade Commands
        • Unmanaged Trade Commands
        • Order Information
        • Order Handeling
        • Position Information
        • Position Price Information
        • Profit Information
        • Wallet Information
      • Social Media
    • Built-in Bots
      • Version 3 bots
        • C# Scripted Bot
        • Email bot
        • Trendline Bot
        • Triangle Arbitrage Bot
      • Accumulation Bot
      • Enhanced RSI bot
      • FlashCrash (Grid) Bot
      • Crypto Index Bot
      • Intellibot Alice
      • Inter Exchange Arbitrage Bot
      • MadHatter Bot
      • Market Making Bot
      • Order Bot
      • PingPong Bot
      • Scalper bot
      • Zone-Recovery Bot
    • Community Bots
      • Simple Grid Bot (SPOT)
      • Simple Grid Bot (FUTURES)
      • Simple Market Maker (SPOT)
      • Simple Market Maker (FUTURES)
  • Usage
    • First Usage
    • Setup Exchange
      • Adding an API to the Platform
      • Binance
      • Binance US
      • Bit2me
      • Bitfinex
      • Bitget
      • BitMEX
      • ❌Bitpanda
      • Bitstamp
      • ❌Bittrex
      • Bybit
      • ❌Cex.IO (Legacy API)
      • ❌Coinbase
      • ❌Crypto.com
      • Deribit
      • Gemini
      • Gleec
      • ❌HitBTC
      • Huobi
      • ❌Ionomy
      • Kraken
      • Kraken Futures
      • KuCoin
      • KuCoin Futures
      • LBank
      • ❌OKCoin
      • OKX
      • OKX-Futures
      • OKX-Swap
      • Phemex
      • Poloniex
      • Poloniex Futures
      • WooX
    • Setup Telegram Notification Bot
    • Setup Discord Notification Bot
    • Use Signals
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Submit Support Ticket
Powered by GitBook
On this page
  • AmountCurrency
  • AmountDecimals
  • AmountLabel
  • AmountStep
  • BaseCurrency
  • ContractName
  • ContractValue
  • IsTradeAmountEnough
  • MakersFee
  • MarketType
  • MinimumTradeAmount
  • ParseTradeAmount
  • ParseTradePrice
  • PriceDecimals
  • PriceStep
  • ProfitCurrency
  • ProfitLabel
  • QuoteCurrency
  • QuoteDecimals
  • QuoteStep
  • SetFee
  • TakersFee
  • TradeMarketContainer
  • UnderlyingAsset
  • UsedMargin

Was this helpful?

  1. Haasscript
  2. Commands
  3. Input data

Trade Market Information

AmountCurrency

Gets the amount label. For reflection, in case the market is Bitstamp BTC/USDit will return 'BTC'. When we are on BitMEX XBT/USD (XBTUSD), it will return 'contract(s)'.

Syntax: AmountCurrency([ market ])

Returns the amount label as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

AmountDecimals

Returns a number of how many decimals is allowed for order amounts.

Syntax: AmountDecimals([ market ], [ amount ])

Returns the allowed decimal count.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

amount

Number

False

Input,Number,SessionGet

AmountLabel

Gets the amount label. For reflection, in case the market is Bitstamp BTC/USDit will return 'BTC'. When we are on BitMEX XBT/USD (XBTUSD), it will return 'contract(s)'.

Syntax: AmountLabel([ market ])

Returns the amount label as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

AmountStep

Returns the minimum allowed trade amount step for market.

Syntax: AmountStep([ market ])

Returns the trade amount step size.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

BaseCurrency

Returns the base currency of the market. For reflection, in case we are on Bitstamp BTC/USD it will return 'BTC'.

Syntax: BaseCurrency([ market ])

Returns the base currency as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

ContractName

Gets the contract name of the market.

Syntax: ContractName([ market ])

Returns the contract name of the market.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

ContractValue

Gets the value of a single contract, defined in their denomination.

Syntax: ContractValue([ market ])

Returns the value of a single contract, defined in their denomination.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

IsTradeAmountEnough

Gets whether or not the trade amount is high enough for exchange limits.

Syntax: IsTradeAmountEnough(market, price, amount, [ logWarning ])

Returns whether or not the trade amount is high enough for exchange limits.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

market

String

True

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

True

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

amount

Number

True

logWarning

Boolean

False

MakersFee

Gets makers fee of the market.

Syntax: MakersFee([ market ])

Returns makers fee of the market.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

MarketType

Gets the market type enumeration of the market.

Syntax: MarketType([ market ])

Returns SpotTrading, MarginTrading or LeverageTrading.

Return type: Enum

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

MinimumTradeAmount

Calculates the minimum trade amount on a certain price while keeping exchange specifications in consideration.

Syntax: MinimumTradeAmount([ market ], [ price ])

Returns the minimum trade amount taking the decimal count, minimum amount and volume into account.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

False

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

ParseTradeAmount

Parses the trade amount to exchange specifications.

Syntax: ParseTradeAmount(market, price, amount)

Returns the trade amount adjusted for exchange specifications.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

True

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

True

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

amount

Number

True

ParseTradePrice

Parses the trade price to exchange specifications.

Syntax: ParseTradePrice(market, price)

Returns the trade price adjusted for exchange specifications.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

True

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

True

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

PriceDecimals

Returns a number of how many decimals is allowed for order prices.

Syntax: PriceDecimals([ market ], [ price ])

Returns the allowed decimal count.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

False

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

PriceStep

Returns the minimum allowed price step for market.

Syntax: PriceStep([ market ])

Returns the price step size.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

ProfitCurrency

Returns the profit label. For reflection, in case the market is Bitstamp BTC/USD it will return 'USD'. When we are on BitMEX XBT/USD (XBTUSD), it will return 'XBT'.

Syntax: ProfitCurrency([ market ])

Returns the profit label as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

ProfitLabel

Returns the profit label. For reflection, in case the market is Bitstamp BTC/USD it will return 'USD'. When we are on BitMEX XBT/USD (XBTUSD), it will return 'XBT'.

Syntax: ProfitLabel([ market ])

Returns the profit label as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

QuoteCurrency

Returns the quote currency of the market. For reflection, in case we are on Bitstamp BTC/USD it will return 'USD'.

Syntax: QuoteCurrency([ market ])

Returns the quote currency as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

QuoteDecimals

Returns a number of how many decimals is allowed for order prices.

Syntax: QuoteDecimals([ market ], [ price ])

Returns the allowed decimal count.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

False

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

QuoteStep

Returns the minimum allowed price step for market.

Syntax: QuoteStep([ market ])

Returns the price step size.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

SetFee

Saves a custom fee percentage which is used in back tests and returned by Fee().

Syntax: SetFee(percentage, [ market ])

Return type: Void

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

market

String

False

InputAccount,InputAccountMarket,InputMarket,AccountGuid

TakersFee

Gets takers fee of the market.

Syntax: TakersFee([ market ])

Returns takers fee of the market.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

TradeMarketContainer

Retrieves all the information on the trade market.

Syntax: TradeMarketContainer([ market ])

Returns the market information on an array.

Return type: Dynamic

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

UnderlyingAsset

Returns the underlying assets of the market. For reflection, in case we are on Bitstamp BTC/USD it will return 'BTC'. When we are on BitMEX XBT/USD (XBTUSD), it will return 'XBT'.

Syntax: UnderlyingAsset([ market ])

Returns the underlying assets as string.

Return type: String

Parameter Name
Parameter Type
Required
Suggestions

market

String

False

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

UsedMargin

Calculates the used margin for a specific position.

Syntax: UsedMargin(market, price, amount, leverage)

Returns the amount in the underlying currency value.

Return type: Number

Parameter Name
Parameter Type
Required
Suggestions

market

String

True

InputAccountMarket,InputMarket,InputPriceSourceMarket,PriceMarket

price

Number

True

GetBuyPrices,GetSellPrices,GetOpenPrices,GetHighPrices,GetLowPrices,GetClosePrices,GetHighLowPrices,GetHighLowClosePrices,GetOpenClosePrices,GetOpenHighLowClosePrices,GetBodyHighPrices,GetBodyLowPrices

amount

Number

True

leverage

Number

True

Input,Number,Leverage

PreviousTime InformationNextPrices

Last updated 1 year ago

Was this helpful?