CandleStickMark
public class CandleStickMark : ChartMark, IChartMark, IChartContentRepresents a candlestick mark for financial charts. Composed of:
- A body (BarMark) showing open-close range
- A wick (RuleMark) showing high-low range
Usage: var candle = new CandleStickMark( x: 0, open: 100, high: 110, low: 95, close: 105 ); chart.AddMarks(candle.GetMarks());
Constructors
Section titled “Constructors”
CandleStickMark()
Section titled “CandleStickMark()”public CandleStickMark()
CandleStickMark(float, float, float, float, float)
Section titled “CandleStickMark(float, float, float, float, float)”public CandleStickMark(float x, float open, float high, float low, float close)Creates one candlestick sample, deriving its body, wick, bullish state, and initial color from OHLC values.
Parameters
| Name | Type |
|---|---|
x |
System.Single |
open |
System.Single |
high |
System.Single |
low |
System.Single |
close |
System.Single |
Methods
Section titled “Methods”
FromOHLC(float, float, float, float, float)
Section titled “FromOHLC(float, float, float, float, float)”public static CandleStickMark FromOHLC(float x, float open, float high, float low, float close)Creates a candlestick from OHLC data.
Parameters
| Name | Type |
|---|---|
x |
System.Single |
open |
System.Single |
high |
System.Single |
low |
System.Single |
close |
System.Single |
Returns
ChartGuru.CandleStickMark
Colors(Color, Color)
Section titled “Colors(Color, Color)”public CandleStickMark Colors(Color bullish, Color bearish)Sets the bullish and bearish colors.
Parameters
| Name | Type |
|---|---|
bullish |
UnityEngine.Color |
bearish |
UnityEngine.Color |
Returns
ChartGuru.CandleStickMark
BodyWidth(float)
Section titled “BodyWidth(float)”public CandleStickMark BodyWidth(float ratio)Sets the body width ratio.
Parameters
| Name | Type |
|---|---|
ratio |
System.Single |
Returns
ChartGuru.CandleStickMark
WickWidth(float)
Section titled “WickWidth(float)”public CandleStickMark WickWidth(float width)Sets the wick line width.
Parameters
| Name | Type |
|---|---|
width |
System.Single |
Returns
ChartGuru.CandleStickMark
CornerRadius(float)
Section titled “CornerRadius(float)”public CandleStickMark CornerRadius(float radius)Sets the corner radius for the body.
Parameters
| Name | Type |
|---|---|
radius |
System.Single |
Returns
ChartGuru.CandleStickMark
GetMarks()
Section titled “GetMarks()”public IEnumerable<IChartMark> GetMarks()Expands the candlestick into its component marks:
- A vertical RuleMark for the wick (high-low range)
- A range BarMark for the body (open-close range)
Returns
System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}
GetBodyMark()
Section titled “GetBodyMark()”public BarMark GetBodyMark()Gets just the body mark for custom rendering.
Returns
ChartGuru.BarMark
GetWickMark()
Section titled “GetWickMark()”public RuleMark GetWickMark()Gets just the wick mark for custom rendering.
Returns
ChartGuru.RuleMark
GetMorphTargets(ChartType, Rect)
Section titled “GetMorphTargets(ChartType, Rect)”public override (Vector2 source, Vector2 target) GetMorphTargets(ChartType targetType, Rect plotArea)Projects this mark into plot-space geometry that the morph renderer can interpolate toward the requested chart type.
Parameters
| Name | Type |
|---|---|
targetType |
ChartGuru.ChartType |
plotArea |
UnityEngine.Rect |
Returns
System.ValueTuple{UnityEngine.Vector2,UnityEngine.Vector2}
Clone()
Section titled “Clone()”public override IChartMark Clone()Creates an independent copy of this Candle Stick Mark; later configuration changes do not affect the original instance.
Returns
ChartGuru.IChartMark
Properties
Section titled “Properties”
MarkType
Section titled “MarkType”public override ChartType MarkType { get; }Returns
ChartGuru.ChartType
public float X { get; set; }X Position (typically represents time/date index).
Returns
System.Single
public float Open { get; set; }Opening price.
Returns
System.Single
public float High { get; set; }Highest price.
Returns
System.Single
public float Low { get; set; }Lowest price.
Returns
System.Single
public float Close { get; set; }Closing price.
Returns
System.Single
WickLineWidth
Section titled “WickLineWidth”public float WickLineWidth { get; set; }Width of the wick line in pixels.
Returns
System.Single
BodyWidthRatio
Section titled “BodyWidthRatio”public float BodyWidthRatio { get; set; }Width ratio of the body relative to available slot width.
Returns
System.Single
BullishColor
Section titled “BullishColor”public Color BullishColor { get; set; }Color for bullish candles (close > open).
Returns
UnityEngine.Color
BearishColor
Section titled “BearishColor”public Color BearishColor { get; set; }Returns
UnityEngine.Color
CornerRadiusValue
Section titled “CornerRadiusValue”public float CornerRadiusValue { get; set; }Corner radius for the body.
Returns
System.Single
IsBullish
Section titled “IsBullish”public bool IsBullish { get; }Whether this is a bullish candle (close >= open).
Returns
System.Boolean
CurrentColor
Section titled “CurrentColor”public Color CurrentColor { get; }The current color based on bullish/bearish state.
Returns
UnityEngine.Color
BodyMin
Section titled “BodyMin”public float BodyMin { get; }Returns
System.Single
BodyMax
Section titled “BodyMax”public float BodyMax { get; }Returns
System.Single
WickMin
Section titled “WickMin”public float WickMin { get; }Returns
System.Single
WickMax
Section titled “WickMax”public float WickMax { get; }Returns
System.Single