With FinanceSharp you can easily design a model within minutes to manipulate, normalize, consolidate the most complex technical indicator combinations models by hand with over 100 fully-tested indicators available.
The library is an on-going development and is before alpha. Classes and architecture might be changed and differ from docs.
Our indicators follow a similar model to Pytorch, having a Forward method, input shape and output shape (2 dimensional).
Our data architecture is:
- always pinnable and ready to be passed to Python as a numpy without cloning.
- Is always made of two dimensions,
(Count, Properties)- Count represents number of items in the array with
NProperties. - Every property is a single
doubleso 4 Properties can be aBarValue. Most indicators return has 1 property.
- Count represents number of items in the array with
- Supports
unmanaged structs,double[],double[,],double[][], fast scalar double, fast scalar struct and more.
Our graphing techniques are pretty straight forward with C#'s built ineventsystem. Although IL builder is planned.
With all the abilities mentioned above, this makes FinanceSharp performance-ready for all the tasks required to execute a model and pass observation data to Python for machine-learning algorithm to work with or process.
Have a look at /examples directory for plotted examples.
FinanceSharp favors high productivity and complitability while still maintaining performant computation alogrithms. We use an 2D array to represent both scalar, indicator value, trade value and tick.
We use long to represent time as 1970-epoch-milliseconds as baseline.
Unlike in QuantConnect/Lean, our time value is always passed seperatly from the values of our data type.
All time processing are always interpreted as UTC. local time is ignored completely and always swallen and interpreted as UTC.
Converting methods are available in static Time class.
DoubleArray is an abstract representation of a 2 dimensional array shaped (Count, Properties) and is used in all of our implemented algorithms (e.g. indicators, crunchers).
Count - how many items are in the DoubleArray
Properties - how many double fields for every item (count) in the DoubleArray
The class aims to support in as many ways as possible data is stored in C#:
doublescalar viaDoubleArrayScalardouble[],double[,],double[][]viaDoubleArrayManagedandDoubleArray2DManageddouble*andlengthviaDoubleArrayUnmanaged- Structs -
where TStruct : unmanaged, DataStruct, ICloneableviaDoubleArrayStructandDoubleArrayStructScalar- Any structure can be used to represent data in
DoubleArrayas long as all of it's fields are double (verified staticly during runtime).
- Any structure can be used to represent data in
The classes derived from DoubleArray can be initialized via their constructor or via DoubleArray.From.
struct BarValue, struct TradeBarValue are ordered CHLO instead of OHLC to make Close (index 0) complitable with IndicatorValue which uses its Value at index 0 making it possible
to pass CHLO values to a indicators that accept IndicatorValue that has only one property.
Every indicator implements both IIndicator and IUpdatable. //TODO: elaborate
Indicators List
- AbsolutePriceOscillator- AccelerationBands
- AccumulationDistribution
- AccumulationDistributionOscillator
- ArnaudLegouxMovingAverage
- AroonOscillator
- AverageDirectionalIndex
- AverageDirectionalMovementIndexRating
- AverageTrueRange
- BalanceOfPower
- Belash
- BollingerBands
- ChandeMomentumOscillator
- CommodityChannelIndex
- CompositeIndicator
- ConstantIndicator
- CoppockCurve
- Delay
- DetrendedPriceOscillator
- DonchianChannel
- DoubleExponentialMovingAverage
- ExponentialMovingAverage
- FilteredIdentity
- FisherTransform
- FractalAdaptiveMovingAverage
- FunctionalComparingIndicator
- FunctionalIndicator
- HeikinAshi
- HullMovingAverage
- IchimokuKinkoHyo
- IndicatorExtensions
- IndicatorResult
- IndicatorStatus
- IntradayVwap
- KaufmanAdaptiveMovingAverage
- KeltnerChannels
- LeastSquaresMovingAverage
- LinearWeightedMovingAverage
- LogReturn
- MassIndex
- Maximum
- MaximumDeltaIndicator
- MeanAbsoluteDeviation
- MidPoint
- MidPrice
- Minimum
- MinimumDeltaIndicator
- Momentum
- MomentumPercent
- Momersion
- MoneyFlowIndex
- MovingAverageConvergenceDivergence
- MovingAverageType
- MovingAverageTypeExtensions
- NormalizedAverageTrueRange
- OnBalanceVolume
- ParabolicStopAndReverse
- PercentagePriceOscillator
- PeriodlessMaximum
- PeriodlessMinimum
- RateOfChange
- RateOfChangePercent
- RateOfChangeRatio
- RegressionChannel
- RelativeStrengthIndex
- SimpleMovingAverage
- StandardDeviation
- Stochastics
- Sum
- SwissArmyKnife
- T3MovingAverage
- TriangularMovingAverage
- TripleExponentialMovingAverage
- Trix
- TrueRange
- UltimateOscillator
- Variance
- VolumeWeightedAveragePriceIndicator
- WilderMovingAverage
- WilliamsPercentR
Consolidators List
- FilteredIdentityDataConsolidator- RenkoConsolidator
- SequentialConsolidator
- TickConsolidator
- TradeBarConsolidator
Candlestick Patterns List
- AbandonedBaby- AdvanceBlock
- BeltHold
- Breakaway
- CandleEnums
- CandleSettings
- ClosingMarubozu
- ConcealedBabySwallow
- Counterattack
- DarkCloudCover
- Doji
- DojiStar
- DragonflyDoji
- Engulfing
- EveningDojiStar
- EveningStar
- GapSideBySideWhite
- GravestoneDoji
- Hammer
- HangingMan
- Harami
- HaramiCross
- HighWaveCandle
- Hikkake
- HikkakeModified
- HomingPigeon
- IdenticalThreeCrows
- InNeck
- InvertedHammer
- Kicking
- KickingByLength
- LadderBottom
- LongLeggedDoji
- LongLineCandle
- Marubozu
- MatchingLow
- MatHold
- MorningDojiStar
- MorningStar
- OnNeck
- Piercing
- RickshawMan
- RiseFallThreeMethods
- SeparatingLines
- ShootingStar
- ShortLineCandle
- SpinningTop
- StalledPattern
- StickSandwich
- Takuri
- TasukiGap
- ThreeBlackCrows
- ThreeInside
- ThreeLineStrike
- ThreeOutside
- ThreeStarsInSouth
- ThreeWhiteSoldiers
- Thrusting
- Tristar
- TwoCrows
- UniqueThreeRiver
- UpDownGapThreeMethods
- UpsideGapTwoCrows
We support all indicators and consolidators from QuantConnect/Lean.
Key differences are:
- IndicatorBase and DataConsolidator are non generic.
- Time is passed separately from data.
- Instead of IndicatorDataPoint/TradeBar/RenkoBar/Tick, DoubleArray is used.
- decimal has been replaced with double to allow interopability with other languages without casting from decimal to other type.
- DataConsolidator inheriets IIndicator
- All original indicator tests from Lean are passing so any consolidation code from Lean can be used with FinanceSharp.
The library is based on modified code from QuantConnect, incredible library for full-stack trading algorithm development.
