Skip to content

Commit

Permalink
fix: Candle Properties not accessible (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertWeaver authored Feb 16, 2023
1 parent 2e99d57 commit 6bc622f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/_common/Candles/Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ namespace Skender.Stock.Indicators;
public class CandleProperties : Quote
{
// raw sizes
internal decimal? Size => High - Low;
internal decimal? Body => (Open > Close) ? (Open - Close) : (Close - Open);
internal decimal? UpperWick => High - (Open > Close ? Open : Close);
internal decimal? LowerWick => (Open > Close ? Close : Open) - Low;
public decimal? Size => High - Low;
public decimal? Body => (Open > Close) ? (Open - Close) : (Close - Open);
public decimal? UpperWick => High - (Open > Close ? Open : Close);
public decimal? LowerWick => (Open > Close ? Close : Open) - Low;

// percent sizes
internal double? BodyPct => (Size != 0) ? (double?)(Body / Size) : 1;
internal double? UpperWickPct => (Size != 0) ? (double?)(UpperWick / Size) : 1;
internal double? LowerWickPct => (Size != 0) ? (double?)(LowerWick / Size) : 1;
public double? BodyPct => (Size != 0) ? (double?)(Body / Size) : 1;
public double? UpperWickPct => (Size != 0) ? (double?)(UpperWick / Size) : 1;
public double? LowerWickPct => (Size != 0) ? (double?)(LowerWick / Size) : 1;

// directional info
internal bool IsBullish => Close > Open;
internal bool IsBearish => Close < Open;
public bool IsBullish => Close > Open;
public bool IsBearish => Close < Open;
}

[Serializable]
Expand All @@ -33,4 +33,4 @@ public CandleResult(DateTime date)
public decimal? Price { get; set; }
public Match Match { get; set; }
public CandleProperties Candle { get; set; }
}
}

0 comments on commit 6bc622f

Please sign in to comment.