LogoLogo
Back to HaasOnline.comSwitch to Trade Platform
3.x
3.x
  • Welcome
  • Getting Started
    • Using Local API Server
    • Authentication
    • Response
      • Error Codes
  • HaasScript
    • Using HaasScript
      • HaasScript Facts
      • Charting
      • Order Handling
      • Interval
      • Input Fields
      • Positions Handling
        • Fee correction
      • Position Information
      • Memory Management
      • Optimizations
      • Signal Handling
      • Trading
    • Script Editor
      • Syntax
      • Parameters
      • Interaction
    • Visual Editor
      • Blocks
      • Parameters
      • Flow Control
      • Interaction
    • Custom Commands
    • Tutorials
      • Trade Bot Guide
        • Creating A Trade Bot
          • Visual Editor Guide
          • Script Editor Guide
          • Custom Containers
        • Customizing Indicators
        • Customizing Safeties
        • Customizing Insurances
        • Creating Easy Indicators
      • Unmanaged Trading Guide
        • Executing Orders
        • Managing Orders
        • Managing Positions
        • Managing Wallet
      • Script Editor
        • Classes
        • MadHatter BBands
        • Percentage Price Change
      • Visual Editor
        • Importing Scripts
        • SmoothRSI
        • Scalper Bot
    • Commands
      • Array Helpers
      • Charting
      • Constants
      • Custom Commands Helpers
      • Easy Indicators
      • Easy Insurances
      • Easy Safeties
      • Equations
      • Flow Control
      • Input Fields
      • Input Settings
      • Mathematical
      • Memory Helpers
      • Miscellaneous
      • Order Handling
      • Order Information
      • Position Information
      • Position Prices
      • Price Data
      • Price Market Information
      • Profit Information
      • Settings
      • Signal Helpers
      • String Helpers
      • Technical Analysis
      • Technical Analysis Helpers
      • Time Information
      • Trade Actions (Managed)
      • Trade Actions (Unmanaged)
      • Trade Bot
      • Trade Market Information
      • Wallet
  • API Endpoints
    • Software API
    • Market Data API
    • Account Data API
    • Trade Data API
    • Advanced Order API
    • Trade Bot API
    • Custom Trade Bot API
    • ENUMS
    • Data Objects
  • Examples
    • Script Bots (C#)
      • Scalper Trade Bot
      • Flash Crash Trade Bot
    • Script Indicators (C#)
      • Indicator Script
      • Technical Analysis Library
    • Pshai Scripts (C#)
      • BBands Ext
      • BBands Ext v2
      • Chaikin A/D Line
      • Calibrator
      • Pshai's RVI
    • Scripted Driver
  • Other Resources
    • YouTube
    • Guides & Tutorials
    • Questions & Answers
    • Community Projects
  • Need Help?
    • Ask on Discord
    • Submit Support Ticket
Powered by GitBook
On this page
  • NewGuid
  • Parse
  • ParseCsv
  • ParseJson
  • StringContains
  • StringExplode
  • StringFromQuery
  • StringIndexOf
  • StringJoin
  • StringSplit
  • SubString

Was this helpful?

  1. HaasScript
  2. Commands

String Helpers

NewGuid

Creates an unique identifier.

  • NewGuid()

Returns the unique identifier as string.

Return Type: String

Parse

Converts the value to a specific type.

  • Parse(value, type)

Returns the converted value or nil if parsing fails.

Return Type: Dynamic

Parameter Name

Parameter Type

Required

Suggested

value

Dynamic

True

-

type

Enum

True

NumberType, ListNumberType, BooleanType, StringType

ParseCsv

Parses CSV data string and returns it as an object. URLs are also supported.

  • ParseCsv(csv, [ hasHeaders ], [ columnDelimiter ], [ rowDelimiter ])

Object containing the parsed information.

Return Type: Dynamic

Parameter Name

Parameter Type

Required

Suggested

csv

String

True

Text, Input, SessionGet, Load

hasHeaders

Boolean

False

True, IsTrue, False, IsFalse, Or, Branch, Equals, IsBiggerThan, IsSmallerThan, IsBiggerOrSmallerThan, IsAnyOrderOpen, IsOrderFilled, IsOrderOpen, IsTradeAmountEnough

columnDelimiter

String

False

Text, Input, SessionGet, Load

rowDelimiter

String

False

Text, Input, SessionGet, Load

ParseJson

Parses JSON data string and returns it as an object. URLs are also supported.

  • ParseJson(json)

Object containing the parsed information.

Return Type: Dynamic

Parameter Name

Parameter Type

Required

Suggested

json

String

True

Text, Input, SessionGet, Load

StringContains

Returns a value indicating whether a specified substring occurs within this string.

  • StringContains(value, searchValue)

Returns true if the specified substring occurs within this string.

Return Type: Boolean

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

searchValue

String

True

Text, Input, SessionGet, Load

StringExplode

Splits a string into substrings that are based on the characters in an array.

  • StringExplode(value, delimiter)

Returns an array of strings.

Return Type: ListDynamic

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

delimiter

String

True

Text, Input, SessionGet, Load

StringFromQuery

Split a string on '&' and '='.

  • StringFromQuery(value)

Returns an key-value based table.

Return Type: ListDynamic

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

StringIndexOf

Gets the zero-based index of the first occurrence of the specified string in the current.

  • StringIndexOf(value, searchValue)

Returns a zero-based index of the first occurrence of the specified string.

Return Type: Number

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

searchValue

String

True

Text, Input, SessionGet, Load

StringJoin

Concatenates 2 string with an optional separator.

  • StringJoin(value1, value2, [ separator ])

Returns the concatenated string.

Return Type: String

Parameter Name

Parameter Type

Required

Suggested

value1

Dynamic

True

Text, Number, Load, SessionGet

value2

Dynamic

True

Text, Number, Load, SessionGet

separator

String

False

Text, Input, SessionGet, Load

StringSplit

Splits a string into substrings that are based on the characters in an array.

  • StringSplit(value, delimiter)

Returns an array of strings.

Return Type: ListDynamic

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

delimiter

String

True

Text, Input, SessionGet, Load

SubString

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

  • SubString(value, start, length)

Substring of the main value.

Return Type: String

Parameter Name

Parameter Type

Required

Suggested

value

String

True

Text, Input, SessionGet, Load

start

Number

True

Input, Number, SessionGet

length

Number

True

Input, Number, SessionGet

PreviousSignal HelpersNextTechnical Analysis

Last updated 4 years ago

Was this helpful?