Skip to content

Commit

Permalink
Update to the latest Haas definitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
FiretronP75 committed Feb 20, 2023
1 parent c8c5316 commit 0e01f97
Show file tree
Hide file tree
Showing 51 changed files with 9,337 additions and 2,403 deletions.
16 changes: 8 additions & 8 deletions haas-production/hs.array-helpers.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ArrayAdd(input, element) end
--- Returns true if the array contains any element or an element matches a specific value.
--- @param input any Source data.
--- @param value any Optional - Optional value to match.
--- @return boolean Returns true if. 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
--- @return boolean Returns true if the input has any elements or if 'value' is defined when any of the elements matches the value. 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
--- @overload fun(input: any): boolean
--- @overload fun(input: any, optionalParameters: OptionalParametersOf_ArrayAny): boolean
function ArrayAny(input, value) end
Expand All @@ -31,14 +31,14 @@ function ArrayConcat(array1, array2) end
--- Returns true if the array contains any element or an element matches a specific value.
--- @param input any Source data.
--- @param value any Optional - Optional value to match.
--- @return boolean Returns true if. 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
--- @return boolean Returns true if the input has any elements or if 'value' is defined when any of the elements matches the value. 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
--- @overload fun(input: any): boolean
--- @overload fun(input: any, optionalParameters: OptionalParametersOf_ArrayContains): boolean
function ArrayContains(input, value) end

--- Returns a new list with only unique elements. In other words; removes all duplicates.
--- @param input any Source data.
--- @return any Returns the list.
--- @return any Returns the unique values of the input.
function ArrayDistinct(input) end

--- The optional parameters of ArrayFilter.
Expand Down Expand Up @@ -106,12 +106,12 @@ function ArrayRemove(input, index) end
--- @param input any Source data.
--- @param oldValue any The old value.
--- @param newValue any The new value.
--- @return any Returns true if.
--- @return any The input with replaced values.
function ArrayReplace(input, oldValue, newValue) end

--- Remove an item from the beginning of an array.
--- @param input any Source data.
--- @return any Returns the input array.
--- @return any The input without the first value
function ArrayShift(input) end

--- The optional parameters of ArraySort.
Expand Down Expand Up @@ -141,7 +141,7 @@ function ArraySum(input, key) end
--- Adds an element to the beginning of an array.
--- @param input any Source data.
--- @param element any Element which to add to the array.
--- @return any Returns the input array.
--- @return any The input with the element added in front of the array
function ArrayUnshift(input, element) end

--- The optional parameters of Count.
Expand Down Expand Up @@ -192,13 +192,13 @@ function Range(input, offset, count) end
--- @shape OptionalParametersOf_SourceManager
--- @field interval number | nil The interval on which the data is based. Default is the selected main interval.
--- @field cap number | nil Maximum size of the collection.
--- @field initialValues number[] | nil
--- @field initialValues number[] | nil The initial values when source in initialized

--- Stores numeric values in a collection. Only adds the new value when the candle on the specified interval closed. This results in interval based data.
--- @param newValue number This value will be added in front of the collection when the candle closed.
--- @param interval number Optional - The interval on which the data is based. Default is the selected main interval. Suggestions: InputInterval, CurrentInterval
--- @param cap number Optional - Maximum size of the collection.
--- @param initialValues number[] Optional -
--- @param initialValues number[] Optional - The initial values when source in initialized
--- @return number[] Returns the numeric collection. Output Suggestions: Equals, IsBiggerOrSmallerThan, IsSmallerThan, IsBiggerThan, Compare, Add, Sum, Sub, Mul, Mult, Div, AddPerc, AddPercentage, SubPerc, SubPercentage, Plot
--- @overload fun(newValue: number): number[]
--- @overload fun(newValue: number, interval: number): number[]
Expand Down
36 changes: 29 additions & 7 deletions haas-production/hs.charting.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function ChartSetOptions(chartId, title, height, style) end
--- @field side Enum | nil Axis side to snap on.
--- @field id string | nil Unique identifier.
--- @field behind boolean | nil If true, the line will be plotted behind the price chart, if enabled.
--- @field ignoreOnAxis boolean | nil If true, the line we not be taking in to consideration when calculating the range on the y-axis.
--- @field ignoreOnAxis boolean | nil If true, the line will not be taken into consideration when calculating the range on the y-axis.
--- @field drawTrailingLine boolean | nil If true, a dotted line will be drawn from the last data point to the y-axis.

--- Creates a line options object to be used for Plot().
--- @param color string | ColorEnum Optional - The color of the line. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
Expand All @@ -85,7 +86,8 @@ function ChartSetOptions(chartId, title, height, style) end
--- @param side Enum Optional - Axis side to snap on. Suggestions: RightAxis, LeftAxis
--- @param id string Optional - Unique identifier. Suggestions: Load, NewGuid
--- @param behind boolean Optional - If true, the line will be plotted behind the price chart, if enabled.
--- @param ignoreOnAxis boolean Optional - If true, the line we not be taking in to consideration when calculating the range on the y-axis.
--- @param ignoreOnAxis boolean Optional - If true, the line will not be taken into consideration when calculating the range on the y-axis.
--- @param drawTrailingLine boolean Optional - If true, a dotted line will be drawn from the last data point to the y-axis.
--- @return any Creates a line options object. Output Suggestions: Plot
--- @overload fun(): any
--- @overload fun(color: string | ColorEnum): any
Expand All @@ -96,8 +98,9 @@ function ChartSetOptions(chartId, title, height, style) end
--- @overload fun(color: string | ColorEnum, style: Enum, deco: Enum, width: number, offset: number, side: Enum): any
--- @overload fun(color: string | ColorEnum, style: Enum, deco: Enum, width: number, offset: number, side: Enum, id: string): any
--- @overload fun(color: string | ColorEnum, style: Enum, deco: Enum, width: number, offset: number, side: Enum, id: string, behind: boolean): any
--- @overload fun(color: string | ColorEnum, style: Enum, deco: Enum, width: number, offset: number, side: Enum, id: string, behind: boolean, ignoreOnAxis: boolean): any
--- @overload fun(optionalParameters: OptionalParametersOf_LineOptions): any
function LineOptions(color, style, deco, width, offset, side, id, behind, ignoreOnAxis) end
function LineOptions(color, style, deco, width, offset, side, id, behind, ignoreOnAxis, drawTrailingLine) end

--- The optional parameters of MarkCandle.
--- @shape OptionalParametersOf_MarkCandle
Expand Down Expand Up @@ -331,7 +334,7 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor,

--- Draws a shape above the candle or first line on the chart.
--- @param chartId number Optional - Index on which to plot the line.
--- @param shape Enum Optional - The shape type. Suggestions: ShapeAdd, ShapeCircle, ShapeCross, ShapeDiamond, ShapeSquare, ShapeTriangleDown, ShapeTriangleUp, ShapeText
--- @param shape Enum Optional - The shape type. Suggestions: ShapeAdd, ShapeCircle, ShapeCross, ShapeDiamond, ShapeDash, ShapeSquare, ShapeTriangleDown, ShapeTriangleUp, ShapeText
--- @param color string | ColorEnum Optional - The color of the shape. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
--- @param size number Optional - Size of the shape.
--- @param aboveCandle boolean Optional - If true, the shape will be drawn above the candle else below.
Expand All @@ -350,6 +353,19 @@ function PlotPrice(chartId, market, interval, style, upColor, upFill, downColor,
--- @overload fun(optionalParameters: OptionalParametersOf_PlotShape): void
function PlotShape(chartId, shape, color, size, aboveCandle, text, textColor, offset) end

--- The optional parameters of PlotShapes.
--- @shape OptionalParametersOf_PlotShapes
--- @field fillColor string | nil The inner color of the circles. Default is none.

--- Changes the line into a specific shape.
--- @param lineGuid string Line guid returned by Plot(). Suggestions: Plot
--- @param shape Enum The shape type. Suggestions: ShapeAdd, ShapeCircle, ShapeCross, ShapeDiamond, ShapeDash, ShapeSquare, ShapeTriangleDown, ShapeTriangleUp, ShapeText
--- @param fillColor string | ColorEnum Optional - The inner color of the circles. Default is none. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
--- @return void
--- @overload fun(lineGuid: string, shape: Enum): void
--- @overload fun(lineGuid: string, shape: Enum, optionalParameters: OptionalParametersOf_PlotShapes): void
function PlotShapes(lineGuid, shape, fillColor) end

--- Creates a small signal bar chart. A positive chartId will place the line below the main price chart. A negative index above.
--- @param chartId number Index on which to plot the line.
--- @param color string | ColorEnum The color of the signal block. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
Expand All @@ -375,7 +391,7 @@ function PlotStackedArea(lineGuids) end
--- @param chartId number The chart index on which to plot the data.
--- @param name string Name of the line. This needs to be unique per index.
--- @param color string | ColorEnum The line color. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
--- @param unix number The a-axis timestamp on which to place the line. Suggestions: Input
--- @param unix number The x-axis timestamp on which to place the line. Suggestions: Input
--- @param lineDecoration Enum Optional - Line decoration style. Default is Solid. Suggestions: Solid, Dashed, Dotted
--- @return void
--- @overload fun(chartId: number, name: string, color: string | ColorEnum, unix: number): void
Expand All @@ -386,8 +402,8 @@ function PlotVerticalLine(chartId, name, color, unix, lineDecoration) end
--- @param chartId number The chart index on which to plot the data.
--- @param name string Name of the zone. This needs to be unique per index.
--- @param color string | ColorEnum The zone inner color. Suggestions: Aqua, Black, Blue, Cyan, DarkGray, DarkGreen, Fuchsia, Gold, Gray, Green, Maroon, Olive, Orange, Purple, Red, SkyBlue, Teal, White, Yellow, ChangeColorOpacity
--- @param start number The lowest value of the zone. Suggestions: Input
--- @param endValue number The highest value of the zone. Suggestions: Input
--- @param start number The lowest value of the zone on the y-axis. Suggestions: Input
--- @param endValue number The highest value of the zone on the y-axis. Suggestions: Input
--- @return void
function PlotVerticalZone(chartId, name, color, start, endValue) end

Expand Down Expand Up @@ -415,3 +431,9 @@ function PlotVerticalZone(chartId, name, color, start, endValue) end
--- @overload fun(chartId: number, optionalParameters: OptionalParametersOf_PlotVolume): void
function PlotVolume(chartId, upColor, downColor, upFill, downFill, side) end

--- Configures the opacity for stacked area chart. A values between
--- @param chartId number Index on which to plot the line.
--- @param opacity number Opacity level from 0 - 100.
--- @return void
function SetStackedAreaOpacity(chartId, opacity) end

4 changes: 2 additions & 2 deletions haas-production/hs.custom-commands-helpers.def.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ function DefineEasyIndicatorOutput(result) end
--- The object returned by DefineEasyIndicatorParameters.
--- @class ResultOf_DefineEasyIndicatorParameters
--- @field chartIndex number Index on which to plot. Suggestions: Plot
--- @field interval number The interval of the indicator. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, DefineIntervalOptimization
--- @field interval number The interval of the indicator. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, GetBodyHighPrices, GetBodyLowPrices, DefineIntervalOptimization
--- @field [1] number Index on which to plot. Suggestions: Plot
--- @field [2] number The interval of the indicator. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, DefineIntervalOptimization
--- @field [2] number The interval of the indicator. Suggestions: AskPrices, BuyPrices, BidPrices, SellPrices, OpenPrices, HighPrices, LowPrices, ClosePrices, Prices, HLPrices, HLCPrices, OCPrices, HeikenClosePrices, OHLCPrices, GetBodyHighPrices, GetBodyLowPrices, DefineIntervalOptimization

--- The optional parameters of DefineEasyIndicatorParameters.
--- @shape OptionalParametersOf_DefineEasyIndicatorParameters
Expand Down
Loading

0 comments on commit 0e01f97

Please sign in to comment.