From 296d8017ff1c730acdfac74a3bd888e46da00350 Mon Sep 17 00:00:00 2001 From: FiretronP75 Date: Wed, 13 Dec 2023 15:57:11 -0600 Subject: [PATCH] Update to the latest Haas definitions. --- haas-production/hs.custom-commands.def.lua | 35 + .../hs.enumerations-margin-mode.def.lua | 10 + .../hs.enumerations-position-mode.def.lua | 10 + .../hs.enumerations-trading.def.lua | 16 - haas-production/hs.machine-learning.def.lua | 4 + haas-production/hs.mathematical.def.lua | 6 +- haas-production/hs.memory-helpers.def.lua | 12 + .../hs.position-information.def.lua | 6 + haas-production/hs.profit-information.def.lua | 14 + haas-production/hs.wallet.def.lua | 14 + haas-staging/hs.custom-commands.def.lua | 42 + .../hs.enumerations-margin-mode.def.lua | 10 + .../hs.enumerations-position-mode.def.lua | 10 + haas-staging/hs.enumerations-trading.def.lua | 16 - haas-staging/hs.machine-learning.def.lua | 4 + haas-staging/hs.mathematical.def.lua | 6 +- haas-staging/hs.memory-helpers.def.lua | 12 + haas-staging/hs.position-information.def.lua | 6 + haas-staging/hs.profit-information.def.lua | 14 + haas-staging/hs.wallet.def.lua | 14 + src/category/category-production.sample.ts | 4 +- src/category/category-staging.sample.ts | 4 +- src/category/category.raw.ts | 2 + src/command/command-production.sample.ts | 1257 ++++++++++++++++- src/command/command-staging.sample.ts | 401 +++++- 25 files changed, 1873 insertions(+), 56 deletions(-) create mode 100644 haas-production/hs.enumerations-margin-mode.def.lua create mode 100644 haas-production/hs.enumerations-position-mode.def.lua create mode 100644 haas-staging/hs.enumerations-margin-mode.def.lua create mode 100644 haas-staging/hs.enumerations-position-mode.def.lua diff --git a/haas-production/hs.custom-commands.def.lua b/haas-production/hs.custom-commands.def.lua index 0bf323d..87f033b 100644 --- a/haas-production/hs.custom-commands.def.lua +++ b/haas-production/hs.custom-commands.def.lua @@ -229,6 +229,19 @@ function CC_EMAMA_LB(chartIndex, interval) end --- @return void function CC_FlashCrashSlot(basePrice, index, amount, spread, startWithBuy) end +--- The optional parameters of CC_HMA. +--- @shape OptionalParametersOf_CC_HMA +--- @field maType Enum | nil Type of Moving Average + +--- Hull Moving Average by pshai +--- @param source number[] Source data. Suggestions: ClosePrices, Prices +--- @param period number Period Length. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @param maType Enum Optional - Type of Moving Average. Suggestions: InputMaTypes +--- @return number[] Hull Moving Average values array +--- @overload fun(source: number[], period: number): number[] +--- @overload fun(source: number[], period: number, optionalParameters: OptionalParametersOf_CC_HMA): number[] +function CC_HMA(source, period, maType) end + --- The optional parameters of CC_HullMA. --- @shape OptionalParametersOf_CC_HullMA --- @field Source number[] | nil The source data @@ -407,6 +420,28 @@ function CC_ScalperChannel_LB(chartIndex, interval) end --- @overload fun(chartIndex: number, optionalParameters: OptionalParametersOf_CC_SQZMOM_LB): Enum function CC_SQZMOM_LB(chartIndex, interval) end +--- The optional parameters of CC_SQZMOM_LB_Ext. +--- @shape OptionalParametersOf_CC_SQZMOM_LB_Ext +--- @field ma_type Enum | nil BB Moving Average Type +--- @field ma_type_kc Enum | nil KC Moving Average Type +--- @field ma_type_r Enum | nil Range Moving Average Type + +--- Squeeze Momentum Indicator - LazyBear +--- @param source number[] Source prices for calculations. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, ClosePrices, Prices, CurrentPrice, GetBodyHighPrices, GetBodyLowPrices, GetVolume, HeikenClosePrices, OHLCPrices, HeikinOpenPrices, HighPrices, HLCPrices, HLPrices, LowPrices, OCPrices, OpenPrices, SourcePrices +--- @param length number BB Lenght. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @param mult number BB MultFactor. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @param length_kc number KC Length. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @param mult_kc number KC MultFactor. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @param ma_type Enum Optional - BB Moving Average Type. Suggestions: InputMaTypes, DemaType, EmaType, KamaType, MamaType, SmaType, T3Type, TemaType, TrimaType, WmaType +--- @param ma_type_kc Enum Optional - KC Moving Average Type. Suggestions: InputMaTypes, DemaType, EmaType, KamaType, MamaType, SmaType, T3Type, TemaType, TrimaType, WmaType +--- @param ma_type_r Enum Optional - Range Moving Average Type. Suggestions: InputMaTypes, DemaType, EmaType, KamaType, MamaType, SmaType, T3Type, TemaType, TrimaType, WmaType +--- @return number[] SQZMOM values. Output Suggestions: BoolToSignal, ConvertSignal, MapSignal, DelaySignal, GetAboveBelowSignal, GetBuySellLevelSignal, GetConsensusSignal, GetCrossOverUnderSignal, GetRemoteSignal, GetSuperSignal, GetThresholdSignal, GetUnanimousSignal, GetWeightedConsensusSignal, IgnoreSignalIf, PositionToBool, ReverseSignal, SaveRemoteSignal, SignalMapper, SignalProperties, SignalToBool, SignalToLog, SignalWeight, UseSignalIf, Plot +--- @overload fun(source: number[], length: number, mult: number, length_kc: number, mult_kc: number): number[] +--- @overload fun(source: number[], length: number, mult: number, length_kc: number, mult_kc: number, ma_type: Enum): number[] +--- @overload fun(source: number[], length: number, mult: number, length_kc: number, mult_kc: number, ma_type: Enum, ma_type_kc: Enum): number[] +--- @overload fun(source: number[], length: number, mult: number, length_kc: number, mult_kc: number, optionalParameters: OptionalParametersOf_CC_SQZMOM_LB_Ext): number[] +function CC_SQZMOM_LB_Ext(source, length, mult, length_kc, mult_kc, ma_type, ma_type_kc, ma_type_r) end + --- Schaff Trend Cycle --- @param data number[] Source data. Suggestions: ClosePrices, Prices --- @param depth number STC Depth. Suggestions: Input diff --git a/haas-production/hs.enumerations-margin-mode.def.lua b/haas-production/hs.enumerations-margin-mode.def.lua new file mode 100644 index 0000000..206f640 --- /dev/null +++ b/haas-production/hs.enumerations-margin-mode.def.lua @@ -0,0 +1,10 @@ +--- Enumerations Margin Mode + +--- Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() +--- @class CrossMarginMode : Enum +CrossMarginMode = {} + +--- Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() +--- @class IsolatedMarginMode : Enum +IsolatedMarginMode = {} + diff --git a/haas-production/hs.enumerations-position-mode.def.lua b/haas-production/hs.enumerations-position-mode.def.lua new file mode 100644 index 0000000..e07ebb9 --- /dev/null +++ b/haas-production/hs.enumerations-position-mode.def.lua @@ -0,0 +1,10 @@ +--- Enumerations Position Mode + +--- Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() +--- @class HedgePositionMode : Enum +HedgePositionMode = {} + +--- Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() +--- @class OneWayPositionMode : Enum +OneWayPositionMode = {} + diff --git a/haas-production/hs.enumerations-trading.def.lua b/haas-production/hs.enumerations-trading.def.lua index 047624e..c213d34 100644 --- a/haas-production/hs.enumerations-trading.def.lua +++ b/haas-production/hs.enumerations-trading.def.lua @@ -1,17 +1,5 @@ --- Enumerations Trading ---- Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() ---- @class CrossMarginMode : Enum -CrossMarginMode = {} - ---- Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() ---- @class HedgePositionMode : Enum -HedgePositionMode = {} - ---- Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() ---- @class IsolatedMarginMode : Enum -IsolatedMarginMode = {} - --- Enumeration, returns a market type enum. Used by MarketType() --- @class LeverageTrading : Enum LeverageTrading = {} @@ -20,10 +8,6 @@ LeverageTrading = {} --- @class MarginTrading : Enum MarginTrading = {} ---- Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() ---- @class OneWayPositionMode : Enum -OneWayPositionMode = {} - --- Enumeration, returns a market type enum. Used by MarketType() --- @class SpotTrading : Enum SpotTrading = {} diff --git a/haas-production/hs.machine-learning.def.lua b/haas-production/hs.machine-learning.def.lua index fa28414..5bcee4e 100644 --- a/haas-production/hs.machine-learning.def.lua +++ b/haas-production/hs.machine-learning.def.lua @@ -6,6 +6,10 @@ --- @return boolean. Output Suggestions: Or, And, IsTrue, IsFalse, Not, BoolToSignal, IfElse, Switch, IfElseIf, DoBuy, DoLong, DoSell, DoShort, DoExitPosition, DoFlipPosition, DoSignal, PlaceBuyOrder, PlaceSellOrder, PlaceGoLongOrder, PlaceGoShortOrder, PlaceExitLongOrder, PlaceExitShortOrder, PlaceExitPositionOrder, PlaceCancelledOrder function IsAbnormal(dataset, multiplier) end +--- Looks to the crypto trading news and returns the sentiment of it +--- @return number. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot +function NewsSentiment() end + --- Reads the given data and tries to give a forecast --- @param dataset number[] Dataset. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, GetBodyHighPrices, GetBodyLowPrices --- @param L number Length of the window on the series for building the trajectory matrix (L). Suggestions: Input diff --git a/haas-production/hs.mathematical.def.lua b/haas-production/hs.mathematical.def.lua index 365f7f7..fae70b5 100644 --- a/haas-production/hs.mathematical.def.lua +++ b/haas-production/hs.mathematical.def.lua @@ -252,10 +252,10 @@ function PercentageChange(input1, input2) end PI = {} --- Calculates a specified number/table raised to the specified power number/table. ---- @param input1 number | table First source value(s). Suggestions: Input ---- @param input2 number | table Second source value(s). Suggestions: Input +--- @param value number | table The base value. Suggestions: Input +--- @param power number | table The power value. Suggestions: Input --- @return number | table Returns a specified number/table raised to the specified power number/table. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot -function Pow(input1, input2) end +function Pow(value, power) end --- The optional parameters of Random. --- @shape OptionalParametersOf_Random diff --git a/haas-production/hs.memory-helpers.def.lua b/haas-production/hs.memory-helpers.def.lua index 01d56ea..66adc05 100644 --- a/haas-production/hs.memory-helpers.def.lua +++ b/haas-production/hs.memory-helpers.def.lua @@ -5,6 +5,12 @@ --- @return void function Delete(key) end +--- Initialize a file that can be exported later. +--- @param name string Unique name of the file +--- @param headers string[] Header definition +--- @return void +function InitExportData(name, headers) end + --- The optional parameters of Load. --- @shape OptionalParametersOf_Load --- @field defaultValue any | nil Default value for when no data is saved on the key. Default is nil. @@ -50,3 +56,9 @@ function LogWarning(message) end --- @return void function Save(key, value) end +--- Write data to a file that can be exported later. File size is unlimited, use with caution. +--- @param name string Name of the file to write the data to. +--- @param values string[] The values to write to the file. Needs to match the number of headers defined in InitExportData. +--- @return void +function WriteExportData(name, values) end + diff --git a/haas-production/hs.position-information.def.lua b/haas-production/hs.position-information.def.lua index 3d5d6b3..556d791 100644 --- a/haas-production/hs.position-information.def.lua +++ b/haas-production/hs.position-information.def.lua @@ -156,6 +156,9 @@ function LongAmount(market) end --- @field amount number The amount open in the position. Suggestions: PlaceExitLongOrder, PlaceExitShortOrder, PlaceSellOrder, PlaceBuyOrder --- @field profit number The realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan --- @field roi number The ROI based on the used margin and realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan +--- @field openTime number Timestamp (in unix) when the position was opened. Suggestions: IsBiggerThan, IsSmallerThan +--- @field updatedTime number Timestamp (in unix) when the position was last updated. Suggestions: IsBiggerThan, IsSmallerThan +--- @field closeTime number Timestamp (in unix) when the position was closed. If position is still open, value will be 0. Suggestions: IsBiggerThan, IsSmallerThan --- @field [1] string The position identifier. Suggestions: PlaceExitPositionOrder --- @field [2] string The market of the position. Suggestions: ClosePrices, Prices, AskPrices, BuyPrices, BidPrices, SellPrices --- @field [3] boolean Set on true when the direction is long. Suggestions: Or, And, IsTrue, IsFalse, Not, BoolToSignal, IfElse, Switch, IfElseIf, DoBuy, DoLong, DoSell, DoShort, DoExitPosition, DoFlipPosition, DoSignal, PlaceBuyOrder, PlaceSellOrder, PlaceGoLongOrder, PlaceGoShortOrder, PlaceExitLongOrder, PlaceExitShortOrder, PlaceExitPositionOrder, PlaceCancelledOrder @@ -164,6 +167,9 @@ function LongAmount(market) end --- @field [6] number The amount open in the position. Suggestions: PlaceExitLongOrder, PlaceExitShortOrder, PlaceSellOrder, PlaceBuyOrder --- @field [7] number The realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan --- @field [8] number The ROI based on the used margin and realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [9] number Timestamp (in unix) when the position was opened. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [10] number Timestamp (in unix) when the position was last updated. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [11] number Timestamp (in unix) when the position was closed. If position is still open, value will be 0. Suggestions: IsBiggerThan, IsSmallerThan --- The optional parameters of PositionContainer. --- @shape OptionalParametersOf_PositionContainer diff --git a/haas-production/hs.profit-information.def.lua b/haas-production/hs.profit-information.def.lua index ec3904d..21fb841 100644 --- a/haas-production/hs.profit-information.def.lua +++ b/haas-production/hs.profit-information.def.lua @@ -73,6 +73,13 @@ function GetCurrentROI(direction, market) end --- @field highestPointInProfit number Highest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field lowestPointInProfit number Lowest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field totalMarginUsed number Total Margin Used. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field averageMargin number Average Margin used per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field averageProfit number Average Profit per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field closedPositions number Closed Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field profitablePositions number Profitable Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field losingPositions number Losing Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field executedOrders number Executed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field completedOrders number Completed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [1] number Max. DrawDown in percentages. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [2] number Max. DrawDown in underlying asset. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [3] number Sharpe Ratio. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot @@ -91,6 +98,13 @@ function GetCurrentROI(direction, market) end --- @field [16] number Highest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [17] number Lowest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [18] number Total Margin Used. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [19] number Average Margin used per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [20] number Average Profit per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [21] number Closed Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [22] number Profitable Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [23] number Losing Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [24] number Executed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [25] number Completed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- The optional parameters of GetTradingReport. --- @shape OptionalParametersOf_GetTradingReport diff --git a/haas-production/hs.wallet.def.lua b/haas-production/hs.wallet.def.lua index 7834ba7..52695d9 100644 --- a/haas-production/hs.wallet.def.lua +++ b/haas-production/hs.wallet.def.lua @@ -43,6 +43,20 @@ function Balance(accountId, coin, market) end --- @overload fun(optionalParameters: OptionalParametersOf_BalanceAmount): number function BalanceAmount(accountId, coin, market) end +--- The optional parameters of MarginToTradeAmount. +--- @shape OptionalParametersOf_MarginToTradeAmount +--- @field market string | nil The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example. + +--- Convert margin to a trade amount. In spot markets, the margin is anticipated to be in the quote currency (e.g., USDT in BTC/USDT). For leverage markets, the margin is expected to be in the underlying currency. +--- @param price number The price used in the conversion from margin to trade amount. Suggestions: Input +--- @param margin number The margin used to calculate the trade amount. Suggestions: Input +--- @param leverage number Leverage ratio. Use 0 for cross-margin. Suggestions: Input, Leverage +--- @param market string Optional - The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example. Suggestions: InputAccountMarket, InputMarket, InputPriceSourceMarket, PriceMarket +--- @return number Returns the calculated trade amount based on the margin. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot, PlaceBuyOrder, PlaceGoLongOrder, PlaceGoShortOrder +--- @overload fun(price: number, margin: number, leverage: number): number +--- @overload fun(price: number, margin: number, leverage: number, optionalParameters: OptionalParametersOf_MarginToTradeAmount): number +function MarginToTradeAmount(price, margin, leverage, market) end + --- The optional parameters of MaxExitLongAmount. --- @shape OptionalParametersOf_MaxExitLongAmount --- @field market string | nil The guid returned by AccountGuid(), InputAccount or InputAccountMarket for example. diff --git a/haas-staging/hs.custom-commands.def.lua b/haas-staging/hs.custom-commands.def.lua index 1a8a141..80a20a6 100644 --- a/haas-staging/hs.custom-commands.def.lua +++ b/haas-staging/hs.custom-commands.def.lua @@ -229,6 +229,48 @@ function CC_EMAMA_LB(chartIndex, interval) end --- @return void function CC_FlashCrashSlot(basePrice, index, amount, spread, startWithBuy) end +--- The object returned by CC_HSP. +--- @class ResultOf_CC_HSP +--- @field open number[] Open prices +--- @field high number[] High prices +--- @field low number[] Low prices +--- @field close number[] Close prices +--- @field volume number[] Volumes +--- @field ask number[] Ask prices +--- @field bid number[] Bid prices +--- @field hl number[] Median prices +--- @field hlc number[] Typical prices +--- @field hlcc number[] Weighted Close prices +--- @field ohlc number[] Average prices +--- @field [1] number[] Open prices +--- @field [2] number[] High prices +--- @field [3] number[] Low prices +--- @field [4] number[] Close prices +--- @field [5] number[] Volumes +--- @field [6] number[] Ask prices +--- @field [7] number[] Bid prices +--- @field [8] number[] Median prices +--- @field [9] number[] Typical prices +--- @field [10] number[] Weighted Close prices +--- @field [11] number[] Average prices + +--- The optional parameters of CC_HSP. +--- @shape OptionalParametersOf_CC_HSP +--- @field interval number | nil Price data interval +--- @field market string | nil Market for data +--- @field hlcStyle boolean | nil When enabled, the data returned will be adjusted for HLC instead of OHLC. Meaning that the OHL data can change. + +--- Returns o, h, l, c, v, a, b, hl, hlc, hlcc, ohlc data arrays with latest ticker data added. Based on Pshai's [HighSpeedPrices Returns OHLCV] Added: ask, bid (changed OutputIndex 1-7 so it matches included CurrentPrice: ohlcvab object key order) and Weighted Close Price to get All variations on price found in HTS +--- @param interval number Optional - Price data interval. Suggestions: InputInterval +--- @param market string Optional - Market for data. Suggestions: PriceMarket, InputMarket, InputAccountMarket +--- @param hlcStyle boolean Optional - When enabled, the data returned will be adjusted for HLC instead of OHLC. Meaning that the OHL data can change. Suggestions: Input, InputAccount, InputAccountMarket, InputButton, InputCdlTypes, InputConstant, InputGroupHeader, InputInterval, InputLrTypes, InputMarket, InputMaTypes, InputOptions, InputOrderType, InputPriceSource, InputPriceSourceMarket, InputSignalManagement, InputSignalTypes, InputSourcePrice, InputTable, InputTableColumn, InputTableOptions, AccountGuid, CurrentInterval, Fee, Leverage, PriceMarket, TradeAmount +--- @return ResultOf_CC_HSP +--- @overload fun(): ResultOf_CC_HSP +--- @overload fun(interval: number): ResultOf_CC_HSP +--- @overload fun(interval: number, market: string): ResultOf_CC_HSP +--- @overload fun(optionalParameters: OptionalParametersOf_CC_HSP): ResultOf_CC_HSP +function CC_HSP(interval, market, hlcStyle) end + --- The optional parameters of CC_HullMA. --- @shape OptionalParametersOf_CC_HullMA --- @field Source number[] | nil The source data diff --git a/haas-staging/hs.enumerations-margin-mode.def.lua b/haas-staging/hs.enumerations-margin-mode.def.lua new file mode 100644 index 0000000..206f640 --- /dev/null +++ b/haas-staging/hs.enumerations-margin-mode.def.lua @@ -0,0 +1,10 @@ +--- Enumerations Margin Mode + +--- Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() +--- @class CrossMarginMode : Enum +CrossMarginMode = {} + +--- Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() +--- @class IsolatedMarginMode : Enum +IsolatedMarginMode = {} + diff --git a/haas-staging/hs.enumerations-position-mode.def.lua b/haas-staging/hs.enumerations-position-mode.def.lua new file mode 100644 index 0000000..e07ebb9 --- /dev/null +++ b/haas-staging/hs.enumerations-position-mode.def.lua @@ -0,0 +1,10 @@ +--- Enumerations Position Mode + +--- Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() +--- @class HedgePositionMode : Enum +HedgePositionMode = {} + +--- Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() +--- @class OneWayPositionMode : Enum +OneWayPositionMode = {} + diff --git a/haas-staging/hs.enumerations-trading.def.lua b/haas-staging/hs.enumerations-trading.def.lua index 047624e..c213d34 100644 --- a/haas-staging/hs.enumerations-trading.def.lua +++ b/haas-staging/hs.enumerations-trading.def.lua @@ -1,17 +1,5 @@ --- Enumerations Trading ---- Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() ---- @class CrossMarginMode : Enum -CrossMarginMode = {} - ---- Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() ---- @class HedgePositionMode : Enum -HedgePositionMode = {} - ---- Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported() ---- @class IsolatedMarginMode : Enum -IsolatedMarginMode = {} - --- Enumeration, returns a market type enum. Used by MarketType() --- @class LeverageTrading : Enum LeverageTrading = {} @@ -20,10 +8,6 @@ LeverageTrading = {} --- @class MarginTrading : Enum MarginTrading = {} ---- Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported() ---- @class OneWayPositionMode : Enum -OneWayPositionMode = {} - --- Enumeration, returns a market type enum. Used by MarketType() --- @class SpotTrading : Enum SpotTrading = {} diff --git a/haas-staging/hs.machine-learning.def.lua b/haas-staging/hs.machine-learning.def.lua index fa28414..5bcee4e 100644 --- a/haas-staging/hs.machine-learning.def.lua +++ b/haas-staging/hs.machine-learning.def.lua @@ -6,6 +6,10 @@ --- @return boolean. Output Suggestions: Or, And, IsTrue, IsFalse, Not, BoolToSignal, IfElse, Switch, IfElseIf, DoBuy, DoLong, DoSell, DoShort, DoExitPosition, DoFlipPosition, DoSignal, PlaceBuyOrder, PlaceSellOrder, PlaceGoLongOrder, PlaceGoShortOrder, PlaceExitLongOrder, PlaceExitShortOrder, PlaceExitPositionOrder, PlaceCancelledOrder function IsAbnormal(dataset, multiplier) end +--- Looks to the crypto trading news and returns the sentiment of it +--- @return number. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot +function NewsSentiment() end + --- Reads the given data and tries to give a forecast --- @param dataset number[] Dataset. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, GetBodyHighPrices, GetBodyLowPrices --- @param L number Length of the window on the series for building the trajectory matrix (L). Suggestions: Input diff --git a/haas-staging/hs.mathematical.def.lua b/haas-staging/hs.mathematical.def.lua index 365f7f7..fae70b5 100644 --- a/haas-staging/hs.mathematical.def.lua +++ b/haas-staging/hs.mathematical.def.lua @@ -252,10 +252,10 @@ function PercentageChange(input1, input2) end PI = {} --- Calculates a specified number/table raised to the specified power number/table. ---- @param input1 number | table First source value(s). Suggestions: Input ---- @param input2 number | table Second source value(s). Suggestions: Input +--- @param value number | table The base value. Suggestions: Input +--- @param power number | table The power value. Suggestions: Input --- @return number | table Returns a specified number/table raised to the specified power number/table. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot -function Pow(input1, input2) end +function Pow(value, power) end --- The optional parameters of Random. --- @shape OptionalParametersOf_Random diff --git a/haas-staging/hs.memory-helpers.def.lua b/haas-staging/hs.memory-helpers.def.lua index 01d56ea..66adc05 100644 --- a/haas-staging/hs.memory-helpers.def.lua +++ b/haas-staging/hs.memory-helpers.def.lua @@ -5,6 +5,12 @@ --- @return void function Delete(key) end +--- Initialize a file that can be exported later. +--- @param name string Unique name of the file +--- @param headers string[] Header definition +--- @return void +function InitExportData(name, headers) end + --- The optional parameters of Load. --- @shape OptionalParametersOf_Load --- @field defaultValue any | nil Default value for when no data is saved on the key. Default is nil. @@ -50,3 +56,9 @@ function LogWarning(message) end --- @return void function Save(key, value) end +--- Write data to a file that can be exported later. File size is unlimited, use with caution. +--- @param name string Name of the file to write the data to. +--- @param values string[] The values to write to the file. Needs to match the number of headers defined in InitExportData. +--- @return void +function WriteExportData(name, values) end + diff --git a/haas-staging/hs.position-information.def.lua b/haas-staging/hs.position-information.def.lua index 3d5d6b3..556d791 100644 --- a/haas-staging/hs.position-information.def.lua +++ b/haas-staging/hs.position-information.def.lua @@ -156,6 +156,9 @@ function LongAmount(market) end --- @field amount number The amount open in the position. Suggestions: PlaceExitLongOrder, PlaceExitShortOrder, PlaceSellOrder, PlaceBuyOrder --- @field profit number The realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan --- @field roi number The ROI based on the used margin and realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan +--- @field openTime number Timestamp (in unix) when the position was opened. Suggestions: IsBiggerThan, IsSmallerThan +--- @field updatedTime number Timestamp (in unix) when the position was last updated. Suggestions: IsBiggerThan, IsSmallerThan +--- @field closeTime number Timestamp (in unix) when the position was closed. If position is still open, value will be 0. Suggestions: IsBiggerThan, IsSmallerThan --- @field [1] string The position identifier. Suggestions: PlaceExitPositionOrder --- @field [2] string The market of the position. Suggestions: ClosePrices, Prices, AskPrices, BuyPrices, BidPrices, SellPrices --- @field [3] boolean Set on true when the direction is long. Suggestions: Or, And, IsTrue, IsFalse, Not, BoolToSignal, IfElse, Switch, IfElseIf, DoBuy, DoLong, DoSell, DoShort, DoExitPosition, DoFlipPosition, DoSignal, PlaceBuyOrder, PlaceSellOrder, PlaceGoLongOrder, PlaceGoShortOrder, PlaceExitLongOrder, PlaceExitShortOrder, PlaceExitPositionOrder, PlaceCancelledOrder @@ -164,6 +167,9 @@ function LongAmount(market) end --- @field [6] number The amount open in the position. Suggestions: PlaceExitLongOrder, PlaceExitShortOrder, PlaceSellOrder, PlaceBuyOrder --- @field [7] number The realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan --- @field [8] number The ROI based on the used margin and realized + unrealized profits. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [9] number Timestamp (in unix) when the position was opened. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [10] number Timestamp (in unix) when the position was last updated. Suggestions: IsBiggerThan, IsSmallerThan +--- @field [11] number Timestamp (in unix) when the position was closed. If position is still open, value will be 0. Suggestions: IsBiggerThan, IsSmallerThan --- The optional parameters of PositionContainer. --- @shape OptionalParametersOf_PositionContainer diff --git a/haas-staging/hs.profit-information.def.lua b/haas-staging/hs.profit-information.def.lua index ec3904d..21fb841 100644 --- a/haas-staging/hs.profit-information.def.lua +++ b/haas-staging/hs.profit-information.def.lua @@ -73,6 +73,13 @@ function GetCurrentROI(direction, market) end --- @field highestPointInProfit number Highest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field lowestPointInProfit number Lowest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field totalMarginUsed number Total Margin Used. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field averageMargin number Average Margin used per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field averageProfit number Average Profit per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field closedPositions number Closed Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field profitablePositions number Profitable Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field losingPositions number Losing Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field executedOrders number Executed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field completedOrders number Completed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [1] number Max. DrawDown in percentages. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [2] number Max. DrawDown in underlying asset. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [3] number Sharpe Ratio. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot @@ -91,6 +98,13 @@ function GetCurrentROI(direction, market) end --- @field [16] number Highest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [17] number Lowest Point in total PNL. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- @field [18] number Total Margin Used. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [19] number Average Margin used per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [20] number Average Profit per position. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [21] number Closed Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [22] number Profitable Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [23] number Losing Positions count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [24] number Executed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot +--- @field [25] number Completed Orders count. Suggestions: IsBiggerThan, IsSmallerThan, Log, Plot --- The optional parameters of GetTradingReport. --- @shape OptionalParametersOf_GetTradingReport diff --git a/haas-staging/hs.wallet.def.lua b/haas-staging/hs.wallet.def.lua index 7834ba7..52695d9 100644 --- a/haas-staging/hs.wallet.def.lua +++ b/haas-staging/hs.wallet.def.lua @@ -43,6 +43,20 @@ function Balance(accountId, coin, market) end --- @overload fun(optionalParameters: OptionalParametersOf_BalanceAmount): number function BalanceAmount(accountId, coin, market) end +--- The optional parameters of MarginToTradeAmount. +--- @shape OptionalParametersOf_MarginToTradeAmount +--- @field market string | nil The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example. + +--- Convert margin to a trade amount. In spot markets, the margin is anticipated to be in the quote currency (e.g., USDT in BTC/USDT). For leverage markets, the margin is expected to be in the underlying currency. +--- @param price number The price used in the conversion from margin to trade amount. Suggestions: Input +--- @param margin number The margin used to calculate the trade amount. Suggestions: Input +--- @param leverage number Leverage ratio. Use 0 for cross-margin. Suggestions: Input, Leverage +--- @param market string Optional - The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example. Suggestions: InputAccountMarket, InputMarket, InputPriceSourceMarket, PriceMarket +--- @return number Returns the calculated trade amount based on the margin. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot, PlaceBuyOrder, PlaceGoLongOrder, PlaceGoShortOrder +--- @overload fun(price: number, margin: number, leverage: number): number +--- @overload fun(price: number, margin: number, leverage: number, optionalParameters: OptionalParametersOf_MarginToTradeAmount): number +function MarginToTradeAmount(price, margin, leverage, market) end + --- The optional parameters of MaxExitLongAmount. --- @shape OptionalParametersOf_MaxExitLongAmount --- @field market string | nil The guid returned by AccountGuid(), InputAccount or InputAccountMarket for example. diff --git a/src/category/category-production.sample.ts b/src/category/category-production.sample.ts index 6898bdb..8b33fd1 100644 --- a/src/category/category-production.sample.ts +++ b/src/category/category-production.sample.ts @@ -48,5 +48,7 @@ export const categoryProductionSample: CategoryRaw = { "44": "Enumerations Array filter Types", "45": "Social Media", "46": "Enumerations Source Price Types", - "47": "MAchine Learning" + "47": "MAchine Learning", + "48": "Enumerations Position Mode", + "49": "Enumerations Margin Mode" }; diff --git a/src/category/category-staging.sample.ts b/src/category/category-staging.sample.ts index 8cf6705..3fe533e 100644 --- a/src/category/category-staging.sample.ts +++ b/src/category/category-staging.sample.ts @@ -48,5 +48,7 @@ export const categoryStagingSample: CategoryRaw = { "44": "Enumerations Array filter Types", "45": "Social Media", "46": "Enumerations Source Price Types", - "47": "MAchine Learning" + "47": "MAchine Learning", + "48": "Enumerations Position Mode", + "49": "Enumerations Margin Mode" }; diff --git a/src/category/category.raw.ts b/src/category/category.raw.ts index 126f48b..68593a6 100644 --- a/src/category/category.raw.ts +++ b/src/category/category.raw.ts @@ -48,5 +48,7 @@ export interface CategoryRaw { '45': string; '46': string; '47': string; + '48': string; + '49': string; } diff --git a/src/command/command-production.sample.ts b/src/command/command-production.sample.ts index 50c0e11..d7e92e7 100644 --- a/src/command/command-production.sample.ts +++ b/src/command/command-production.sample.ts @@ -5517,6 +5517,85 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "ScriptId": "dac9692ba28544e693e24094572cca8d", + "IsValid": true, + "CommandName": "CC_CompareScaledLast", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Compares the last price of two different assets by scaling them.", + "ReturnDescription": "true if last value of source1 is relatively greater when scaled compared to last value of source2 when scaled", + "Parameters": [ + { + "Index": 0, + "Name": "source1", + "Type": 7, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The first source data to compare.", + "ScriptType": null, + "Suggestion": [ + 5201, + 5200, + 5211, + 5213, + 5215, + 5216, + 5212, + 5208, + 5202, + 5205, + 5203, + 5204, + 5206, + 5207, + 5209, + 5214 + ] + }, + { + "Index": 0, + "Name": "source2", + "Type": 7, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The second source data to compare.", + "ScriptType": null, + "Suggestion": [ + 5201, + 5200, + 5211, + 5213, + 5215, + 5216, + 5212, + 5208, + 5202, + 5205, + 5203, + 5204, + 5206, + 5207, + 5209, + 5214 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 3, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "c5145ec90a6920c0dd95bf95852370e8", "IsValid": true, @@ -5663,6 +5742,42 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "ScriptId": "25813c7a071142bea85f7d66f463b765", + "IsValid": true, + "CommandName": "CC_CountDecimals", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Returns the number of decimal places in a number.", + "ReturnDescription": "the number of decimal places in a number", + "Parameters": [ + { + "Index": 0, + "Name": "value", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "something like 1.234", + "ScriptType": null, + "Suggestion": [ + 7215, + 7209 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "f6e0dfc58e640d039feba897bf92729b", "IsValid": true, @@ -6925,6 +7040,382 @@ export const commandProductionSample: CommandRaw[] = [ "OutputSuggestions": [], "ChangeTypes": [] }, + { + "ScriptId": "e96b636bd83447798e9c27c9b14c40cc", + "IsValid": true, + "CommandName": "CC_FormatDateTime", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Formats a unix datetime number (to \"YYYY-MM-DD at HH:MM\" by default).", + "ReturnDescription": "The formatted unix datetime number.", + "Parameters": [ + { + "Index": 0, + "Name": "unix", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The unix datetime number to format.", + "ScriptType": null, + "Suggestion": [ + 6801, + 6811, + 6816, + 6810, + 6806, + 6805, + 6804, + 6803, + 6808, + 6802, + 6807, + 6809, + 6813, + 6800, + 6815, + 6812, + 6814 + ] + }, + { + "Index": 0, + "Name": "dateDelimiter", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The characters between the year and month, and between the month and day.", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "dateTimeDelimiter", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The characters between the date and time.", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "timeDelimiter", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The characters between the hour and minute, and between the minute and second.", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "includeSeconds", + "Type": 3, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "If true, the seconds will be included in the formatted time.", + "ScriptType": null, + "Suggestion": [ + 3212, + 3203 + ] + }, + { + "Index": 0, + "Name": "includeTime", + "Type": 3, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "If true, the formatted time will be included.", + "ScriptType": null, + "Suggestion": [ + 3212, + 3203 + ] + }, + { + "Index": 0, + "Name": "includeYear", + "Type": 3, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "If true, the year will be included in the formatted date.", + "ScriptType": null, + "Suggestion": [ + 3212, + 3203 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 0, + "OutputSuggestions": [ + 4208, + 4200, + 4201, + 4202, + 4207, + 4203, + 4204, + 4205, + 4206 + ], + "ChangeTypes": [] + }, + { + "ScriptId": "6a42e2af46c14ec5a8bcf24a16fc95ac", + "IsValid": true, + "CommandName": "CC_FormatRoundedPercent", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Formats a number to be rounded and have the percent symbol.", + "ReturnDescription": "The formatted value.", + "Parameters": [ + { + "Index": 0, + "Name": "input", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The number to format.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "digits", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The digits to round to.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "symbol", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The symbol to append.", + "ScriptType": null, + "Suggestion": [ + 4406, + 3400, + 4205, + 4200 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 0, + "OutputSuggestions": [ + 4201 + ], + "ChangeTypes": [] + }, + { + "ScriptId": "4dbb99cd56214a1ca850a598042f7456", + "IsValid": true, + "CommandName": "CC_FormatRoundedQuoteCurrency", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Formats a number to be rounded and have the quote currency symbol.", + "ReturnDescription": "Formatted Value", + "Parameters": [ + { + "Index": 0, + "Name": "Input", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The number to format", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "Digits", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The digits to round to", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "Symbol", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The symbol to append", + "ScriptType": null, + "Suggestion": [ + 4406, + 3400, + 4205, + 4200 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 0, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "ed60c416350040bfb493d5e4b0cc55ce", + "IsValid": true, + "CommandName": "CC_FormatRoundedQuoteCurrency", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Formats a number to be rounded and have the quote currency symbol.", + "ReturnDescription": "Formatted Value", + "Parameters": [ + { + "Index": 0, + "Name": "Input", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The number to format", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "market", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The currency market", + "ScriptType": null, + "Suggestion": [ + 3402, + 3406, + 3604 + ] + }, + { + "Index": 0, + "Name": "Digits", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The digits to round to", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "Symbol", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The symbol to append", + "ScriptType": null, + "Suggestion": [ + 4406, + 3400, + 4205, + 4200 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 0, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "cee3de40cda14e59b6d2b27cd5e48c48", "IsValid": true, @@ -7002,6 +7493,97 @@ export const commandProductionSample: CommandRaw[] = [ "OutputSuggestions": [], "ChangeTypes": [] }, + { + "ScriptId": "b9a91095b35e4ba0a626a88366c780ca", + "IsValid": true, + "CommandName": "CC_HMA", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Hull Moving Average by pshai", + "ReturnDescription": "Hull Moving Average values array", + "Parameters": [ + { + "Index": 0, + "Name": "source", + "Type": 7, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Source data", + "ScriptType": null, + "Suggestion": [ + 5201 + ] + }, + { + "Index": 0, + "Name": "period", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Period Length", + "ScriptType": null, + "Suggestion": [ + 3400, + 3401, + 3402, + 3423, + 3413, + 3420, + 3414, + 3404, + 3405, + 3406, + 3407, + 3408, + 3409, + 3410, + 3411, + 3422, + 3418, + 3424, + 3415, + 3417, + 3416, + 3600, + 3601, + 3602, + 3603, + 3604, + 3605, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "maType", + "Type": 2, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "Type of Moving Average", + "ScriptType": null, + "Suggestion": [ + 3407 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 7, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "f6d75fa59fd52eb6849395b2953d03d0", "IsValid": true, @@ -8016,6 +8598,245 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "ScriptId": "acd97aeeb98448828e5d7243636f5c55", + "IsValid": true, + "CommandName": "CC_QuoteDecimals", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Returns the number of decimal places supported by the QuoteCurrency.", + "ReturnDescription": "the number of decimal places supported by the QuoteCurrency", + "Parameters": [ + { + "Index": 0, + "Name": "market", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The market.", + "ScriptType": null, + "Suggestion": [ + 3402, + 3406, + 3604 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "28eb727366084af6a17f93ba92f4747c", + "IsValid": true, + "CommandName": "CC_ReportMaxRiskPoint", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Adds a custom report on your worst point of liquidation risk.", + "ReturnDescription": "", + "Parameters": [], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "79e699ff4e404bcc83ae70b8d86e6cb0", + "IsValid": true, + "CommandName": "CC_ReportMaxRiskPoint", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Adds a custom report on your worst point of liquidation risk.", + "ReturnDescription": "", + "Parameters": [], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "98d42a0f96a14c99afa5673269666023", + "IsValid": true, + "CommandName": "CC_ReportMaxRiskPointV2", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Adds a custom report on your worst point of liquidation risk.", + "ReturnDescription": "", + "Parameters": [ + { + "Index": 0, + "Name": "walletAmount", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "The bot will start with this amount and adjust according to its profits. Set to -1 to use the real wallet balance.", + "ScriptType": null, + "Suggestion": [ + 3400, + 3401, + 3402, + 3423, + 3413, + 3420, + 3414, + 3404, + 3405, + 3406, + 3407, + 3408, + 3409, + 3410, + 3411, + 3422, + 3418, + 3424, + 3415, + 3417, + 3416, + 3600, + 3601, + 3602, + 3603, + 3604, + 3605 + ] + }, + { + "Index": 0, + "Name": "willError", + "Type": 3, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": true, + "Description": "If true, will log an error when there is a probable liquidation, which also ends a backtest early.If false, will log a warning when there is a probable liquidation.", + "ScriptType": null, + "Suggestion": [ + 3212, + 3203 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "9a3a36fe48ed414facde7601293d9e1d", + "IsValid": true, + "CommandName": "CC_ReportOpenPositions", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Adds a custom report on your open positions.", + "ReturnDescription": "", + "Parameters": [], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, + { + "ScriptId": "9103df6520a54538be5dfc786e839632", + "IsValid": true, + "CommandName": "CC_Scale100", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Converts a value to a scale of 0 to 100.", + "ReturnDescription": "the value converted to the 0 to 100 scale", + "Parameters": [ + { + "Index": 0, + "Name": "value", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The number to convert.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "source", + "Type": 7, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The source data the value belongs to.", + "ScriptType": null, + "Suggestion": [ + 5201, + 5200, + 5211, + 5213, + 5215, + 5216, + 5212, + 5208, + 5202, + 5205, + 5203, + 5204, + 5206, + 5207, + 5209, + 5214 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "e80f2247aef27f8d5a7b6a9c689811ad", "IsValid": true, @@ -8546,6 +9367,41 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "ScriptId": "8e274a8e03974bdf9f294cf842c849be", + "IsValid": true, + "CommandName": "CC_TrueOnInterval", + "Command": 600, + "CommandType": 1, + "Category": 3, + "Description": "Returns true every interval and false in between intervals.", + "ReturnDescription": "true every interval and false in between intervals", + "Parameters": [ + { + "Index": 0, + "Name": "interval", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The interval at which true should be returned instead of false.", + "ScriptType": null, + "Suggestion": [ + 3404 + ] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": false, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 3, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "ScriptId": "81f9740cc9249946efae7333ff42ff3c", "IsValid": true, @@ -11660,7 +12516,7 @@ export const commandProductionSample: CommandRaw[] = [ "Description": "Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported()", "ReturnDescription": "Returns the cross-margin mode enum.", "CommandType": 15, - "Category": 12, + "Category": 49, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -23218,6 +24074,125 @@ export const commandProductionSample: CommandRaw[] = [ 4201, 408 ] + }, + { + "Index": 0, + "Name": "averageMargin", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Average Margin used per position.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "averageProfit", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Average Profit per position.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "closedPositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Closed Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "profitablePositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Profitable Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "losingPositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Losing Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "executedOrders", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Executed Orders count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "completedOrders", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Completed Orders count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] } ], "IsConstant": false, @@ -23979,7 +24954,7 @@ export const commandProductionSample: CommandRaw[] = [ "Description": "Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported()", "ReturnDescription": "Returns the hedge-position mode enum.", "CommandType": 15, - "Category": 12, + "Category": 48, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -26197,6 +27172,51 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "InitExportData", + "Command": 8400, + "CommandType": 1, + "Category": 22, + "Description": "Initialize a file that can be exported later.", + "ReturnDescription": null, + "Parameters": [ + { + "Index": 0, + "Name": "name", + "Type": 0, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Unique name of the file", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "headers", + "Type": 103, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Header definition", + "ScriptType": null, + "Suggestion": [] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "CommandName": "InNeckType", "Command": 7828, @@ -28896,7 +29916,7 @@ export const commandProductionSample: CommandRaw[] = [ "Description": "Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported()", "ReturnDescription": "Returns the isolated-margin mode enum.", "CommandType": 15, - "Category": 12, + "Category": 49, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -33033,6 +34053,106 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "MarginToTradeAmount", + "Parameters": [ + { + "Index": 0, + "Name": "price", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The price used in the conversion from margin to trade amount.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "margin", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The margin used to calculate the trade amount", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "leverage", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Leverage ratio. Use 0 for cross-margin.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 3603 + ] + }, + { + "Index": 0, + "Name": "market", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example.", + "ScriptType": null, + "Suggestion": [ + 3402, + 3406, + 3411, + 3604 + ] + } + ], + "Command": 7609, + "CommandType": 1, + "Category": 39, + "Description": "Convert margin to a trade amount. In spot markets, the margin is anticipated to be in the quote currency (e.g., USDT in BTC/USDT). For leverage markets, the margin is expected to be in the underlying currency.", + "ReturnDescription": "Returns the calculated trade amount based on the margin.", + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [ + 3202, + 3204, + 3209, + 3205, + 3201, + 4008, + 4033, + 4025, + 4018, + 4000, + 4041, + 408, + 7400, + 7404, + 7405 + ], + "ChangeTypes": [] + }, { "CommandName": "MarginTrading", "Command": 2801, @@ -35173,6 +36293,37 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "NewsSentiment", + "Parameters": [], + "Command": 8302, + "CommandType": 1, + "Category": 47, + "Description": "Looks to the crypto trading news and returns the sentiment of it", + "ReturnDescription": null, + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [ + 3202, + 3204, + 3209, + 3205, + 3201, + 4008, + 4033, + 4025, + 4018, + 4000, + 4041, + 408 + ], + "ChangeTypes": [] + }, { "CommandName": "NilDataType", "Command": 7901, @@ -35885,7 +37036,7 @@ export const commandProductionSample: CommandRaw[] = [ "Description": "Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported()", "ReturnDescription": "Returns the one-way-position mode enum.", "CommandType": 15, - "Category": 12, + "Category": 48, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -41759,6 +42910,51 @@ export const commandProductionSample: CommandRaw[] = [ 3205, 3209 ] + }, + { + "Index": 0, + "Name": "openTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was opened.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] + }, + { + "Index": 0, + "Name": "updatedTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was last updated.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] + }, + { + "Index": 0, + "Name": "closeTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was closed. If position is still open, value will be 0", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] } ], "IsConstant": false, @@ -41999,13 +43195,13 @@ export const commandProductionSample: CommandRaw[] = [ "Parameters": [ { "Index": 0, - "Name": "input1", + "Name": "value", "Type": 6, "IsRequired": true, "IsHidden": false, "IsField": false, "AllowNull": false, - "Description": "First source value(s).", + "Description": "The base value", "ScriptType": null, "Suggestion": [ 3400, @@ -42014,13 +43210,13 @@ export const commandProductionSample: CommandRaw[] = [ }, { "Index": 0, - "Name": "input2", + "Name": "power", "Type": 6, "IsRequired": true, "IsHidden": false, "IsField": false, "AllowNull": false, - "Description": "Second source value(s).", + "Description": "The power value", "ScriptType": null, "Suggestion": [ 3400, @@ -54105,6 +55301,51 @@ export const commandProductionSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "WriteExportData", + "Command": 8401, + "CommandType": 1, + "Category": 22, + "Description": "Write data to a file that can be exported later. File size is unlimited, use with caution.", + "ReturnDescription": null, + "Parameters": [ + { + "Index": 0, + "Name": "name", + "Type": 0, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Name of the file to write the data to.", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "values", + "Type": 103, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The values to write to the file. Needs to match the number of headers defined in InitExportData.", + "ScriptType": null, + "Suggestion": [] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "CommandName": "WWS", "Parameters": [ diff --git a/src/command/command-staging.sample.ts b/src/command/command-staging.sample.ts index 660c417..e7face6 100644 --- a/src/command/command-staging.sample.ts +++ b/src/command/command-staging.sample.ts @@ -17208,7 +17208,7 @@ export const commandStagingSample: CommandRaw[] = [ "Description": "Enumeration, returns a cross-margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported()", "ReturnDescription": "Returns the cross-margin mode enum.", "CommandType": 15, - "Category": 12, + "Category": 49, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -28766,6 +28766,125 @@ export const commandStagingSample: CommandRaw[] = [ 4201, 408 ] + }, + { + "Index": 0, + "Name": "averageMargin", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Average Margin used per position.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "averageProfit", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Average Profit per position.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "closedPositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Closed Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "profitablePositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Profitable Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "losingPositions", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Losing Positions count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "executedOrders", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Executed Orders count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] + }, + { + "Index": 0, + "Name": "completedOrders", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Completed Orders count.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209, + 4201, + 408 + ] } ], "IsConstant": false, @@ -29527,7 +29646,7 @@ export const commandStagingSample: CommandRaw[] = [ "Description": "Enumeration, returns a hedge position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported()", "ReturnDescription": "Returns the hedge-position mode enum.", "CommandType": 15, - "Category": 12, + "Category": 48, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -31745,6 +31864,51 @@ export const commandStagingSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "InitExportData", + "Command": 8400, + "CommandType": 1, + "Category": 22, + "Description": "Initialize a file that can be exported later.", + "ReturnDescription": null, + "Parameters": [ + { + "Index": 0, + "Name": "name", + "Type": 0, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Unique name of the file", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "headers", + "Type": 103, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Header definition", + "ScriptType": null, + "Suggestion": [] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "CommandName": "InNeckType", "Command": 7828, @@ -34444,7 +34608,7 @@ export const commandStagingSample: CommandRaw[] = [ "Description": "Enumeration, returns isolated margin mode enum. Used with Get-/SetMarginMode() and IsMarginModeSupported()", "ReturnDescription": "Returns the isolated-margin mode enum.", "CommandType": 15, - "Category": 12, + "Category": 49, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -38581,6 +38745,106 @@ export const commandStagingSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "MarginToTradeAmount", + "Parameters": [ + { + "Index": 0, + "Name": "price", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The price used in the conversion from margin to trade amount.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "margin", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The margin used to calculate the trade amount", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 4205 + ] + }, + { + "Index": 0, + "Name": "leverage", + "Type": 1, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Leverage ratio. Use 0 for cross-margin.", + "ScriptType": null, + "Suggestion": [ + 3400, + 4403, + 3603 + ] + }, + { + "Index": 0, + "Name": "market", + "Type": 0, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The market returned by PriceMarket(), InputAccountMarket() or InputMarket() for example.", + "ScriptType": null, + "Suggestion": [ + 3402, + 3406, + 3411, + 3604 + ] + } + ], + "Command": 7609, + "CommandType": 1, + "Category": 39, + "Description": "Convert margin to a trade amount. In spot markets, the margin is anticipated to be in the quote currency (e.g., USDT in BTC/USDT). For leverage markets, the margin is expected to be in the underlying currency.", + "ReturnDescription": "Returns the calculated trade amount based on the margin.", + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [ + 3202, + 3204, + 3209, + 3205, + 3201, + 4008, + 4033, + 4025, + 4018, + 4000, + 4041, + 408, + 7400, + 7404, + 7405 + ], + "ChangeTypes": [] + }, { "CommandName": "MarginTrading", "Command": 2801, @@ -40721,6 +40985,37 @@ export const commandStagingSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "NewsSentiment", + "Parameters": [], + "Command": 8302, + "CommandType": 1, + "Category": 47, + "Description": "Looks to the crypto trading news and returns the sentiment of it", + "ReturnDescription": null, + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 1, + "OutputSuggestions": [ + 3202, + 3204, + 3209, + 3205, + 3201, + 4008, + 4033, + 4025, + 4018, + 4000, + 4041, + 408 + ], + "ChangeTypes": [] + }, { "CommandName": "NilDataType", "Command": 7901, @@ -41433,7 +41728,7 @@ export const commandStagingSample: CommandRaw[] = [ "Description": "Enumeration, returns a one-way position mode enum. Used with Get-/SetPositionMode() and IsPositionModeSupported()", "ReturnDescription": "Returns the one-way-position mode enum.", "CommandType": 15, - "Category": 12, + "Category": 48, "Parameters": [], "IsConstant": true, "OutputIndex": [], @@ -47307,6 +47602,51 @@ export const commandStagingSample: CommandRaw[] = [ 3205, 3209 ] + }, + { + "Index": 0, + "Name": "openTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was opened.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] + }, + { + "Index": 0, + "Name": "updatedTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was last updated.", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] + }, + { + "Index": 0, + "Name": "closeTime", + "Type": 1, + "IsRequired": false, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Timestamp (in unix) when the position was closed. If position is still open, value will be 0", + "ScriptType": null, + "Suggestion": [ + 3205, + 3209 + ] } ], "IsConstant": false, @@ -47547,13 +47887,13 @@ export const commandStagingSample: CommandRaw[] = [ "Parameters": [ { "Index": 0, - "Name": "input1", + "Name": "value", "Type": 6, "IsRequired": true, "IsHidden": false, "IsField": false, "AllowNull": false, - "Description": "First source value(s).", + "Description": "The base value", "ScriptType": null, "Suggestion": [ 3400, @@ -47562,13 +47902,13 @@ export const commandStagingSample: CommandRaw[] = [ }, { "Index": 0, - "Name": "input2", + "Name": "power", "Type": 6, "IsRequired": true, "IsHidden": false, "IsField": false, "AllowNull": false, - "Description": "Second source value(s).", + "Description": "The power value", "ScriptType": null, "Suggestion": [ 3400, @@ -59653,6 +59993,51 @@ export const commandStagingSample: CommandRaw[] = [ ], "ChangeTypes": [] }, + { + "CommandName": "WriteExportData", + "Command": 8401, + "CommandType": 1, + "Category": 22, + "Description": "Write data to a file that can be exported later. File size is unlimited, use with caution.", + "ReturnDescription": null, + "Parameters": [ + { + "Index": 0, + "Name": "name", + "Type": 0, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "Name of the file to write the data to.", + "ScriptType": null, + "Suggestion": [ + 4406 + ] + }, + { + "Index": 0, + "Name": "values", + "Type": 103, + "IsRequired": true, + "IsHidden": false, + "IsField": false, + "AllowNull": false, + "Description": "The values to write to the file. Needs to match the number of headers defined in InitExportData.", + "ScriptType": null, + "Suggestion": [] + } + ], + "OutputIndex": [], + "IsConstant": false, + "IsPrimary": true, + "RequiresCall": false, + "Resizable": false, + "OutputHidden": false, + "OutputType": 10, + "OutputSuggestions": [], + "ChangeTypes": [] + }, { "CommandName": "WWS", "Parameters": [