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
  • DeactivateAfterEnterOrder
  • DeactivateAfterExitOrder
  • DeactivateAfterXActiveMinutes
  • DeactivateAfterXIdleMinutes
  • DeactivateAfterXOrders
  • DeactivateAfterXPositions
  • DeactivateOnLoss
  • DeactivateOnProfit
  • DynamicStopLoss
  • DynamicTakeProfit
  • GrowingTrailingStopLoss
  • ShrinkingTrailingStopLoss
  • StopLoss
  • StopLossROI
  • TakeProfit
  • TakeProfitROI
  • TrailingArmStopLoss
  • TrailingStopLoss

Was this helpful?

  1. Haasscript
  2. Commands
  3. Trade Bots

Easy Safeties

DeactivateAfterEnterOrder

Deactivates the bot after an enter order has been completed.

Syntax: DeactivateAfterEnterOrder([ positionCount ])

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

positionCount

Number

False

Input,Number,SessionGet

DeactivateAfterExitOrder

Deactivates the bot after an exit order has been completed.

Syntax: DeactivateAfterExitOrder([ positionCount ])

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

positionCount

Number

False

Input,Number,SessionGet

DeactivateAfterXActiveMinutes

Deactivates the bot when the is active for a certain time.

Syntax: DeactivateAfterXActiveMinutes(minutes)

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

minutes

Number

True

Input,Number,SessionGet

DeactivateAfterXIdleMinutes

Deactivates the bot if the last completed order is a number of minutes in the past. Timeout starts after the first completed order.

Syntax: DeactivateAfterXIdleMinutes(minutes)

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

minutes

Number

True

Input,Number,SessionGet

DeactivateAfterXOrders

Deactivates the bot after a number of orders has been completed.

Syntax: DeactivateAfterXOrders([ count ])

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

count

Number

False

Input,Number,SessionGet

DeactivateAfterXPositions

Deactivates the bot after a number of positions has been completed.

Syntax: DeactivateAfterXPositions([ count ])

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

count

Number

False

Input,Number,SessionGet

DeactivateOnLoss

Deactivates the bot when there is no open position and the ROI based losses have reached a certain level.

Syntax: DeactivateOnLoss(maxLoss)

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

maxLoss

Number

True

Input,Number,SessionGet

DeactivateOnProfit

Deactivates the bot when there is no open position and the ROI based profits have reached a certain level.

Syntax: DeactivateOnProfit(minProfit)

Returns true when the bot has been deactivated.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

minProfit

Number

True

Input,Number,SessionGet

DynamicStopLoss

Calculates the dynamic stop loss price and compares it with the current exit price.

Syntax: DynamicStopLoss(percentage, [ depth ], [ positionId ], [ direction ])

Returns true is the stop loss price has been breached.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

depth

Number

False

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

DynamicTakeProfit

Calculates the dynamic take profit price and compares it with the current exit price.

Syntax: DynamicTakeProfit(percentage, [ depth ], [ positionId ], [ direction ])

Returns true is the take profit price has been breached.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

depth

Number

False

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

GrowingTrailingStopLoss

Keeps track of the highest/lowest recorded price and adjust the stop loss accordingly. The higher the price change the more the trailing distances grows.

Syntax: GrowingTrailingStopLoss(percentage, growPercentage, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

growPercentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

ShrinkingTrailingStopLoss

Keeps track of the highest/lowest recorded price and adjust the stop loss accordingly. The higher the price change the more the trailing distances shrinks.

Syntax: ShrinkingTrailingStopLoss(percentage, shrinkPercentage, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

shrinkPercentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

StopLoss

Calculates the current percentage change from the average enter price and compares it with the stop loss value.

Syntax: StopLoss(percentage, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

StopLossROI

Calculates the defined position's current ROI percentage and gives a signal if the set loss is reached.

Syntax: StopLossROI(percentage, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

TakeProfit

Calculates the current percentage change from the average enter price and compares it with the take profit value.

Syntax: TakeProfit(percentage, [ positionId ], [ direction ])

Returns true if the take profit has been reached.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

TakeProfitROI

Calculates the defined position's current ROI percentage and gives a signal if the set profit is reached.

Syntax: TakeProfitROI(percentage, [ positionId ], [ direction ])

Returns true if the take profit has been reached.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

TrailingArmStopLoss

Keeps track of the highest/lowest recorded price and adjust the stop loss accordingly when the arm% has been reached.

Syntax: TrailingArmStopLoss(percentage, arm, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

arm

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

TrailingStopLoss

Keeps track of the highest/lowest recorded price and adjust the stop loss accordingly.

Syntax: TrailingStopLoss(percentage, [ positionId ], [ direction ])

Returns true if the stop loss has been hit.

Return type: Boolean

Parameter Name
Parameter Type
Required
Suggestions

percentage

Number

True

Input,Number,SessionGet

positionId

String

False

Load

direction

Enum

False

PositionLong,PositionShort,NoPosition

PreviousEasy IndicatorsNextEasy Insurances

Last updated 1 year ago

Was this helpful?