From 167f7b3ffec3ef58a7310ff085d8f2c29116d40d Mon Sep 17 00:00:00 2001 From: kingchenc Date: Tue, 9 Jun 2026 20:30:29 +0200 Subject: [PATCH] Add the Java binding over the C ABI hub (Panama/FFM) (#233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a Java binding (`bindings/java`) over the C ABI hub — the fourth language stecker after C#, Go and R, reaching the hub through the Java Foreign Function & Memory API (Panama, `java.lang.foreign`, final in Java 22) rather than JNI or jextract. ## What's here - **`bindings/java`** — a Maven module (`org.wickra:wickra`) exposing all 514 indicators as idiomatic `AutoCloseable` classes. The downcall handles (`internal/NativeMethods.java`), the per-indicator wrappers and the output records are generated from `bindings/c/include/wickra.h` (same eight-archetype taxonomy as the C#/Go/R generators: scalar/batch, multi-output, bars, profile, values-profile, array-input). The opaque handle is a `MemorySegment` freed by a registered `java.lang.ref.Cleaner` action; multi-output returns a `record` (`null` at warmup), bars a `record[]`, profiles a record with a trailing `double[]`. The hand-written `WickraNative` resolves the native library (a bundled per-platform copy, or a `target/release` fallback for local development) and validates it against a sentinel symbol. repr(C) struct offsets are computed in the generator so the FFM reads land on the exact bytes. - **`examples/java`** — the full example suite mirroring C/C#/Go/R: streaming, backtest, multi_timeframe, parallel_assets (parallel streams), three strategies, and `FetchBtcusdt`/`LiveBinance`. - **CI** — a `java` job builds the C ABI library, sets up JDK 22 (Temurin, with a CDN-flake retry), runs the archetype test suite and the seven offline examples on Linux, macOS and Windows. - **Release** — a gated `java-publish` job (skipped until the `JAVA_PUBLISH_ENABLED` repository variable is set) stages the native libraries from the `wickra-c-.tar.gz` assets into the binding's resources and deploys to Maven Central with GPG signing. Independent of the GitHub-release job, like the NuGet job. - **Docs** — Java added to the README languages table, project layout, building/testing and comparison table, CONTRIBUTING, ARCHITECTURE, the examples index, the issue/PR templates, the About-description template, and the other binding READMEs. ## Requirements Java 22+ (the FFM API is final since Java 22). The binding requires `--enable-native-access=ALL-UNNAMED` at runtime; the test and example runners pass it automatically. No Rust crate or `Cargo.toml` change — the Java binding is standalone and additive. The generated `*.java` are committed (like the node `index.js`/`index.d.ts`); the generator stays private. --- .gitattributes | 4 + .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/bug_report_detailed.md | 5 + .github/ISSUE_TEMPLATE/feature_request.md | 1 + .../ISSUE_TEMPLATE/performance_regression.md | 2 +- .github/ISSUE_TEMPLATE/question.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/PULL_REQUEST_TEMPLATE/detailed.md | 1 + .github/workflows/ci.yml | 71 + .github/workflows/release.yml | 69 + .github/workflows/sync-about.yml | 2 +- ARCHITECTURE.md | 6 +- CHANGELOG.md | 11 + CONTRIBUTING.md | 5 +- README.md | 20 +- ROADMAP.md | 2 +- SUPPORT.md | 2 +- THREAT_MODEL.md | 2 +- bindings/c/README.md | 2 +- bindings/csharp/README.md | 2 +- bindings/go/README.md | 2 +- bindings/java/.gitignore | 6 + bindings/java/README.md | 102 + bindings/java/pom.xml | 171 + .../main/java/org/wickra/AbandonedBaby.java | 86 + .../java/src/main/java/org/wickra/Abcd.java | 86 + .../java/org/wickra/AbsoluteBreadthIndex.java | 72 + .../java/org/wickra/AccelerationBands.java | 62 + .../org/wickra/AccelerationBandsOutput.java | 5 + .../org/wickra/AcceleratorOscillator.java | 95 + .../main/java/org/wickra/AdOscillator.java | 86 + .../main/java/org/wickra/AdVolumeLine.java | 72 + .../src/main/java/org/wickra/AdaptiveCci.java | 89 + .../main/java/org/wickra/AdaptiveCycle.java | 66 + .../org/wickra/AdaptiveLaguerreFilter.java | 69 + .../src/main/java/org/wickra/AdaptiveRsi.java | 69 + .../java/src/main/java/org/wickra/Adl.java | 86 + .../main/java/org/wickra/AdvanceBlock.java | 86 + .../main/java/org/wickra/AdvanceDecline.java | 72 + .../java/org/wickra/AdvanceDeclineRatio.java | 72 + .../java/src/main/java/org/wickra/Adx.java | 62 + .../src/main/java/org/wickra/AdxOutput.java | 5 + .../java/src/main/java/org/wickra/Adxr.java | 89 + .../src/main/java/org/wickra/Alligator.java | 68 + .../main/java/org/wickra/AlligatorOutput.java | 5 + .../java/src/main/java/org/wickra/Alma.java | 69 + .../java/src/main/java/org/wickra/Alpha.java | 73 + .../java/org/wickra/AmihudIlliquidity.java | 54 + .../src/main/java/org/wickra/AnchoredRsi.java | 66 + .../main/java/org/wickra/AnchoredVwap.java | 86 + .../java/org/wickra/AndrewsPitchfork.java | 62 + .../org/wickra/AndrewsPitchforkOutput.java | 5 + .../java/src/main/java/org/wickra/Apo.java | 72 + .../java/src/main/java/org/wickra/Aroon.java | 61 + .../main/java/org/wickra/AroonOscillator.java | 89 + .../src/main/java/org/wickra/AroonOutput.java | 5 + .../java/src/main/java/org/wickra/Atr.java | 89 + .../src/main/java/org/wickra/AtrBands.java | 62 + .../main/java/org/wickra/AtrBandsOutput.java | 5 + .../src/main/java/org/wickra/AtrRatchet.java | 61 + .../java/org/wickra/AtrRatchetOutput.java | 5 + .../main/java/org/wickra/AtrTrailingStop.java | 89 + .../src/main/java/org/wickra/AutoFib.java | 63 + .../main/java/org/wickra/AutoFibOutput.java | 5 + .../main/java/org/wickra/Autocorrelation.java | 72 + .../wickra/AutocorrelationPeriodogram.java | 72 + .../java/org/wickra/AverageDailyRange.java | 89 + .../main/java/org/wickra/AverageDrawdown.java | 69 + .../src/main/java/org/wickra/AvgPrice.java | 86 + .../java/org/wickra/AwesomeOscillator.java | 92 + .../wickra/AwesomeOscillatorHistogram.java | 95 + .../main/java/org/wickra/BalanceOfPower.java | 86 + .../main/java/org/wickra/BandpassFilter.java | 69 + .../java/src/main/java/org/wickra/Bat.java | 86 + .../src/main/java/org/wickra/BeltHold.java | 86 + .../java/src/main/java/org/wickra/Beta.java | 73 + .../java/org/wickra/BetaNeutralSpread.java | 73 + .../main/java/org/wickra/BetterVolume.java | 89 + .../java/org/wickra/BipowerVariation.java | 69 + .../src/main/java/org/wickra/BodySizePct.java | 86 + .../main/java/org/wickra/BollingerBands.java | 63 + .../java/org/wickra/BollingerBandwidth.java | 69 + .../main/java/org/wickra/BollingerOutput.java | 5 + .../src/main/java/org/wickra/BomarBands.java | 62 + .../java/org/wickra/BomarBandsOutput.java | 5 + .../main/java/org/wickra/BreadthThrust.java | 75 + .../src/main/java/org/wickra/Breakaway.java | 86 + .../java/org/wickra/BullishPercentIndex.java | 72 + .../src/main/java/org/wickra/BurkeRatio.java | 69 + .../src/main/java/org/wickra/Butterfly.java | 86 + .../main/java/org/wickra/CalendarSpread.java | 51 + .../src/main/java/org/wickra/CalmarRatio.java | 69 + .../src/main/java/org/wickra/Camarilla.java | 65 + .../org/wickra/CamarillaPivotsOutput.java | 5 + .../main/java/org/wickra/CandleVolume.java | 61 + .../java/org/wickra/CandleVolumeOutput.java | 5 + .../java/src/main/java/org/wickra/Cci.java | 89 + .../main/java/org/wickra/CenterOfGravity.java | 69 + .../java/org/wickra/CentralPivotRange.java | 59 + .../org/wickra/CentralPivotRangeOutput.java | 5 + .../java/src/main/java/org/wickra/Cfo.java | 69 + .../java/org/wickra/ChaikinMoneyFlow.java | 89 + .../java/org/wickra/ChaikinOscillator.java | 92 + .../java/org/wickra/ChaikinVolatility.java | 92 + .../main/java/org/wickra/ChandeKrollStop.java | 64 + .../org/wickra/ChandeKrollStopOutput.java | 5 + .../main/java/org/wickra/ChandelierExit.java | 61 + .../java/org/wickra/ChandelierExitOutput.java | 5 + .../main/java/org/wickra/ChoppinessIndex.java | 89 + .../main/java/org/wickra/ClassicPivots.java | 63 + .../java/org/wickra/ClassicPivotsOutput.java | 5 + .../src/main/java/org/wickra/CloseVsOpen.java | 86 + .../main/java/org/wickra/ClosingMarubozu.java | 86 + .../java/src/main/java/org/wickra/Cmo.java | 69 + .../org/wickra/CoefficientOfVariation.java | 69 + .../main/java/org/wickra/Cointegration.java | 65 + .../java/org/wickra/CointegrationOutput.java | 5 + .../java/org/wickra/CommonSenseRatio.java | 69 + .../java/org/wickra/CompositeProfile.java | 65 + .../org/wickra/CompositeProfileOutput.java | 5 + .../org/wickra/ConcealingBabySwallow.java | 86 + .../org/wickra/ConditionalValueAtRisk.java | 69 + .../src/main/java/org/wickra/ConnorsRsi.java | 75 + .../src/main/java/org/wickra/Coppock.java | 75 + .../org/wickra/CorrelationTrendIndicator.java | 69 + .../main/java/org/wickra/Counterattack.java | 86 + .../java/src/main/java/org/wickra/Crab.java | 86 + .../org/wickra/CumulativeVolumeDelta.java | 51 + .../org/wickra/CumulativeVolumeIndex.java | 72 + .../main/java/org/wickra/CupAndHandle.java | 86 + .../main/java/org/wickra/CyberneticCycle.java | 69 + .../java/src/main/java/org/wickra/Cypher.java | 86 + .../java/org/wickra/DayOfWeekProfile.java | 62 + .../src/main/java/org/wickra/Decycler.java | 69 + .../java/org/wickra/DecyclerOscillator.java | 72 + .../java/src/main/java/org/wickra/Dema.java | 69 + .../src/main/java/org/wickra/DemandIndex.java | 89 + .../main/java/org/wickra/DemarkPivots.java | 59 + .../java/org/wickra/DemarkPivotsOutput.java | 5 + .../src/main/java/org/wickra/DepthSlope.java | 61 + .../java/org/wickra/DerivativeOscillator.java | 78 + .../main/java/org/wickra/DetrendedStdDev.java | 69 + .../main/java/org/wickra/DisparityIndex.java | 69 + .../src/main/java/org/wickra/DistanceSsd.java | 73 + .../java/src/main/java/org/wickra/Doji.java | 86 + .../src/main/java/org/wickra/DojiStar.java | 86 + .../src/main/java/org/wickra/DollarBar.java | 5 + .../src/main/java/org/wickra/DollarBars.java | 68 + .../src/main/java/org/wickra/Donchian.java | 62 + .../main/java/org/wickra/DonchianOutput.java | 5 + .../main/java/org/wickra/DonchianStop.java | 61 + .../java/org/wickra/DonchianStopOutput.java | 5 + .../main/java/org/wickra/DoubleBollinger.java | 64 + .../org/wickra/DoubleBollingerOutput.java | 5 + .../main/java/org/wickra/DoubleTopBottom.java | 86 + .../org/wickra/DownsideGapThreeMethods.java | 86 + .../java/src/main/java/org/wickra/Dpo.java | 69 + .../main/java/org/wickra/DragonflyDoji.java | 86 + .../java/org/wickra/DrawdownDuration.java | 66 + .../src/main/java/org/wickra/DumplingTop.java | 89 + .../java/src/main/java/org/wickra/Dx.java | 89 + .../java/org/wickra/DynamicMomentumIndex.java | 69 + .../main/java/org/wickra/EaseOfMovement.java | 89 + .../main/java/org/wickra/EffectiveSpread.java | 51 + .../java/org/wickra/EhlersStochastic.java | 69 + .../java/src/main/java/org/wickra/Ehma.java | 69 + .../main/java/org/wickra/ElderImpulse.java | 78 + .../src/main/java/org/wickra/ElderRay.java | 61 + .../main/java/org/wickra/ElderRayOutput.java | 5 + .../main/java/org/wickra/ElderSafeZone.java | 61 + .../java/org/wickra/ElderSafeZoneOutput.java | 5 + .../java/src/main/java/org/wickra/Ema.java | 69 + .../wickra/EmpiricalModeDecomposition.java | 69 + .../src/main/java/org/wickra/Engulfing.java | 86 + .../src/main/java/org/wickra/Equivolume.java | 61 + .../java/org/wickra/EquivolumeOutput.java | 5 + .../org/wickra/EstimatedLeverageRatio.java | 51 + .../java/org/wickra/EvenBetterSinewave.java | 72 + .../main/java/org/wickra/EveningDojiStar.java | 86 + .../java/src/main/java/org/wickra/Evwma.java | 89 + .../main/java/org/wickra/EwmaVolatility.java | 66 + .../src/main/java/org/wickra/Expectancy.java | 69 + .../java/org/wickra/FallingThreeMethods.java | 86 + .../java/src/main/java/org/wickra/Fama.java | 66 + .../src/main/java/org/wickra/FibArcs.java | 59 + .../main/java/org/wickra/FibArcsOutput.java | 5 + .../src/main/java/org/wickra/FibChannel.java | 60 + .../java/org/wickra/FibChannelOutput.java | 5 + .../main/java/org/wickra/FibConfluence.java | 58 + .../java/org/wickra/FibConfluenceOutput.java | 5 + .../main/java/org/wickra/FibExtension.java | 61 + .../java/org/wickra/FibExtensionOutput.java | 5 + .../java/src/main/java/org/wickra/FibFan.java | 59 + .../main/java/org/wickra/FibFanOutput.java | 5 + .../main/java/org/wickra/FibProjection.java | 60 + .../java/org/wickra/FibProjectionOutput.java | 5 + .../main/java/org/wickra/FibRetracement.java | 63 + .../java/org/wickra/FibRetracementOutput.java | 5 + .../main/java/org/wickra/FibTimeZones.java | 58 + .../java/org/wickra/FibTimeZonesOutput.java | 5 + .../main/java/org/wickra/FibonacciPivots.java | 63 + .../org/wickra/FibonacciPivotsOutput.java | 5 + .../src/main/java/org/wickra/FisherRsi.java | 69 + .../main/java/org/wickra/FisherTransform.java | 69 + .../src/main/java/org/wickra/FlagPennant.java | 86 + .../src/main/java/org/wickra/Footprint.java | 65 + .../main/java/org/wickra/FootprintLevel.java | 5 + .../src/main/java/org/wickra/ForceIndex.java | 89 + .../java/org/wickra/FractalChaosBands.java | 61 + .../org/wickra/FractalChaosBandsOutput.java | 5 + .../java/src/main/java/org/wickra/Frama.java | 69 + .../main/java/org/wickra/FryPanBottom.java | 89 + .../main/java/org/wickra/FundingBasis.java | 51 + .../java/org/wickra/FundingImpliedApr.java | 51 + .../src/main/java/org/wickra/FundingRate.java | 51 + .../main/java/org/wickra/FundingRateMean.java | 54 + .../java/org/wickra/FundingRateZScore.java | 54 + .../main/java/org/wickra/GainLossRatio.java | 69 + .../main/java/org/wickra/GainToPainRatio.java | 69 + .../java/org/wickra/GapSideBySideWhite.java | 86 + .../src/main/java/org/wickra/Garch11.java | 66 + .../org/wickra/GarmanKlassVolatility.java | 92 + .../src/main/java/org/wickra/Gartley.java | 86 + .../main/java/org/wickra/GatorOscillator.java | 67 + .../org/wickra/GatorOscillatorOutput.java | 5 + .../main/java/org/wickra/GeneralizedDema.java | 69 + .../src/main/java/org/wickra/GeometricMa.java | 69 + .../main/java/org/wickra/GoldenPocket.java | 59 + .../java/org/wickra/GoldenPocketOutput.java | 5 + .../java/org/wickra/GrangerCausality.java | 76 + .../main/java/org/wickra/GravestoneDoji.java | 86 + .../java/src/main/java/org/wickra/Hammer.java | 86 + .../src/main/java/org/wickra/HangingMan.java | 86 + .../java/src/main/java/org/wickra/Harami.java | 86 + .../src/main/java/org/wickra/HaramiCross.java | 86 + .../org/wickra/HasbrouckInformationShare.java | 73 + .../java/org/wickra/HeadAndShoulders.java | 86 + .../src/main/java/org/wickra/HeikinAshi.java | 60 + .../java/org/wickra/HeikinAshiOscillator.java | 89 + .../java/org/wickra/HeikinAshiOutput.java | 5 + .../main/java/org/wickra/HiLoActivator.java | 89 + .../main/java/org/wickra/HighLowIndex.java | 75 + .../main/java/org/wickra/HighLowRange.java | 86 + .../java/org/wickra/HighLowVolumeNodes.java | 64 + .../org/wickra/HighLowVolumeNodesOutput.java | 5 + .../src/main/java/org/wickra/HighWave.java | 86 + .../main/java/org/wickra/HighpassFilter.java | 69 + .../src/main/java/org/wickra/Hikkake.java | 86 + .../main/java/org/wickra/HikkakeModified.java | 86 + .../java/org/wickra/HilbertDominantCycle.java | 66 + .../java/org/wickra/HistoricalVolatility.java | 72 + .../java/src/main/java/org/wickra/Hma.java | 69 + .../src/main/java/org/wickra/HoltWinters.java | 66 + .../main/java/org/wickra/HomingPigeon.java | 86 + .../src/main/java/org/wickra/HtDcPhase.java | 66 + .../src/main/java/org/wickra/HtPhasor.java | 58 + .../main/java/org/wickra/HtPhasorOutput.java | 5 + .../src/main/java/org/wickra/HtTrendMode.java | 66 + .../main/java/org/wickra/HurstChannel.java | 62 + .../java/org/wickra/HurstChannelOutput.java | 5 + .../main/java/org/wickra/HurstExponent.java | 72 + .../src/main/java/org/wickra/Ichimoku.java | 73 + .../main/java/org/wickra/IchimokuOutput.java | 5 + .../java/org/wickra/IdenticalThreeCrows.java | 86 + .../main/java/org/wickra/ImbalanceBar.java | 5 + .../main/java/org/wickra/ImbalanceBars.java | 68 + .../java/src/main/java/org/wickra/InNeck.java | 86 + .../src/main/java/org/wickra/Inertia.java | 92 + .../java/org/wickra/InformationRatio.java | 73 + .../main/java/org/wickra/InitialBalance.java | 61 + .../java/org/wickra/InitialBalanceOutput.java | 5 + .../org/wickra/InstantaneousTrendline.java | 69 + .../java/org/wickra/IntradayIntensity.java | 86 + .../org/wickra/IntradayMomentumIndex.java | 89 + .../org/wickra/IntradayVolatilityProfile.java | 65 + .../org/wickra/InverseFisherTransform.java | 66 + .../main/java/org/wickra/InvertedHammer.java | 86 + .../src/main/java/org/wickra/JarqueBera.java | 69 + .../java/src/main/java/org/wickra/Jma.java | 69 + .../main/java/org/wickra/JumpIndicator.java | 69 + .../java/src/main/java/org/wickra/KRatio.java | 69 + .../src/main/java/org/wickra/KagiBar.java | 5 + .../src/main/java/org/wickra/KagiBars.java | 65 + .../java/org/wickra/KalmanHedgeRatio.java | 59 + .../org/wickra/KalmanHedgeRatioOutput.java | 5 + .../java/src/main/java/org/wickra/Kama.java | 75 + .../src/main/java/org/wickra/KaseDevStop.java | 61 + .../java/org/wickra/KaseDevStopOutput.java | 5 + .../org/wickra/KasePermissionStochastic.java | 64 + .../KasePermissionStochasticOutput.java | 5 + .../main/java/org/wickra/KellyCriterion.java | 69 + .../src/main/java/org/wickra/Keltner.java | 65 + .../main/java/org/wickra/KeltnerOutput.java | 5 + .../src/main/java/org/wickra/KendallTau.java | 73 + .../src/main/java/org/wickra/Kicking.java | 86 + .../main/java/org/wickra/KickingByLength.java | 86 + .../java/src/main/java/org/wickra/Kst.java | 85 + .../src/main/java/org/wickra/KstOutput.java | 5 + .../src/main/java/org/wickra/Kurtosis.java | 69 + .../java/src/main/java/org/wickra/Kvo.java | 92 + .../src/main/java/org/wickra/KylesLambda.java | 54 + .../main/java/org/wickra/LadderBottom.java | 86 + .../src/main/java/org/wickra/LaguerreRsi.java | 66 + .../org/wickra/LeadLagCrossCorrelation.java | 64 + .../wickra/LeadLagCrossCorrelationOutput.java | 5 + .../src/main/java/org/wickra/LinRegAngle.java | 69 + .../main/java/org/wickra/LinRegChannel.java | 62 + .../java/org/wickra/LinRegChannelOutput.java | 5 + .../main/java/org/wickra/LinRegIntercept.java | 69 + .../src/main/java/org/wickra/LinRegSlope.java | 69 + .../main/java/org/wickra/LineBreakBar.java | 5 + .../java/org/wickra/LinearRegression.java | 69 + .../java/org/wickra/LiquidationFeatures.java | 61 + .../org/wickra/LiquidationFeaturesOutput.java | 5 + .../src/main/java/org/wickra/LogReturn.java | 69 + .../main/java/org/wickra/LongLeggedDoji.java | 86 + .../src/main/java/org/wickra/LongLine.java | 86 + .../main/java/org/wickra/LongShortRatio.java | 51 + .../src/main/java/org/wickra/M2Measure.java | 69 + .../src/main/java/org/wickra/MaEnvelope.java | 62 + .../java/org/wickra/MaEnvelopeOutput.java | 5 + .../src/main/java/org/wickra/MacdExt.java | 68 + .../src/main/java/org/wickra/MacdFix.java | 62 + .../main/java/org/wickra/MacdHistogram.java | 75 + .../main/java/org/wickra/MacdIndicator.java | 68 + .../src/main/java/org/wickra/MacdOutput.java | 5 + .../java/src/main/java/org/wickra/Mama.java | 58 + .../src/main/java/org/wickra/MamaOutput.java | 5 + .../org/wickra/MarketFacilitationIndex.java | 86 + .../src/main/java/org/wickra/MartinRatio.java | 69 + .../src/main/java/org/wickra/Marubozu.java | 86 + .../src/main/java/org/wickra/MassIndex.java | 92 + .../src/main/java/org/wickra/MatHold.java | 86 + .../src/main/java/org/wickra/MatchingLow.java | 86 + .../src/main/java/org/wickra/MaxDrawdown.java | 69 + .../java/org/wickra/McClellanOscillator.java | 72 + .../org/wickra/McClellanSummationIndex.java | 72 + .../main/java/org/wickra/McGinleyDynamic.java | 69 + .../org/wickra/MedianAbsoluteDeviation.java | 69 + .../main/java/org/wickra/MedianChannel.java | 62 + .../java/org/wickra/MedianChannelOutput.java | 5 + .../src/main/java/org/wickra/MedianMa.java | 69 + .../src/main/java/org/wickra/MedianPrice.java | 86 + .../java/src/main/java/org/wickra/Mfi.java | 89 + .../src/main/java/org/wickra/Microprice.java | 61 + .../src/main/java/org/wickra/MidPoint.java | 69 + .../src/main/java/org/wickra/MidPrice.java | 89 + .../src/main/java/org/wickra/MinusDi.java | 89 + .../src/main/java/org/wickra/MinusDm.java | 89 + .../main/java/org/wickra/ModifiedMaStop.java | 61 + .../java/org/wickra/ModifiedMaStopOutput.java | 5 + .../java/src/main/java/org/wickra/Mom.java | 69 + .../main/java/org/wickra/MorningDojiStar.java | 86 + .../java/org/wickra/MorningEveningStar.java | 86 + .../main/java/org/wickra/MurreyMathLines.java | 68 + .../org/wickra/MurreyMathLinesOutput.java | 5 + .../src/main/java/org/wickra/NakedPoc.java | 92 + .../java/src/main/java/org/wickra/Natr.java | 89 + .../main/java/org/wickra/NewHighsNewLows.java | 72 + .../main/java/org/wickra/NewPriceLines.java | 89 + .../java/src/main/java/org/wickra/Nrtr.java | 58 + .../src/main/java/org/wickra/NrtrOutput.java | 5 + .../java/src/main/java/org/wickra/Nvi.java | 86 + .../java/org/wickra/OIPriceDivergence.java | 54 + .../src/main/java/org/wickra/OIWeighted.java | 51 + .../java/src/main/java/org/wickra/Obv.java | 86 + .../main/java/org/wickra/OiToVolumeRatio.java | 51 + .../src/main/java/org/wickra/OmegaRatio.java | 69 + .../java/src/main/java/org/wickra/OnNeck.java | 86 + .../java/org/wickra/OpenInterestDelta.java | 51 + .../java/org/wickra/OpenInterestMomentum.java | 54 + .../main/java/org/wickra/OpeningMarubozu.java | 86 + .../main/java/org/wickra/OpeningRange.java | 62 + .../java/org/wickra/OpeningRangeOutput.java | 5 + .../org/wickra/OrderBookImbalanceFull.java | 61 + .../org/wickra/OrderBookImbalanceTop1.java | 61 + .../org/wickra/OrderBookImbalanceTopN.java | 64 + .../java/org/wickra/OrderFlowImbalance.java | 64 + .../src/main/java/org/wickra/OuHalfLife.java | 73 + .../main/java/org/wickra/OvernightGap.java | 86 + .../org/wickra/OvernightIntradayReturn.java | 58 + .../wickra/OvernightIntradayReturnOutput.java | 5 + .../src/main/java/org/wickra/PainIndex.java | 69 + .../java/org/wickra/PairSpreadZScore.java | 76 + .../main/java/org/wickra/PairwiseBeta.java | 73 + .../java/org/wickra/ParkinsonVolatility.java | 92 + .../java/org/wickra/PearsonCorrelation.java | 73 + .../main/java/org/wickra/PercentAboveMa.java | 72 + .../src/main/java/org/wickra/PercentB.java | 69 + .../org/wickra/PercentageTrailingStop.java | 66 + .../org/wickra/PerpetualPremiumIndex.java | 51 + .../java/src/main/java/org/wickra/Pgo.java | 89 + .../java/org/wickra/PiercingDarkCloud.java | 86 + .../java/src/main/java/org/wickra/Pin.java | 54 + .../main/java/org/wickra/PivotReversal.java | 92 + .../java/src/main/java/org/wickra/PlusDi.java | 89 + .../java/src/main/java/org/wickra/PlusDm.java | 89 + .../java/src/main/java/org/wickra/Pmo.java | 72 + .../src/main/java/org/wickra/PnfColumn.java | 5 + .../java/org/wickra/PointAndFigureBars.java | 68 + .../wickra/PolarizedFractalEfficiency.java | 72 + .../java/src/main/java/org/wickra/Ppo.java | 72 + .../main/java/org/wickra/PpoHistogram.java | 75 + .../main/java/org/wickra/ProfileShape.java | 92 + .../main/java/org/wickra/ProfitFactor.java | 69 + .../main/java/org/wickra/ProjectionBands.java | 62 + .../org/wickra/ProjectionBandsOutput.java | 5 + .../java/org/wickra/ProjectionOscillator.java | 89 + .../java/src/main/java/org/wickra/Psar.java | 86 + .../java/src/main/java/org/wickra/Pvi.java | 86 + .../java/src/main/java/org/wickra/Qqe.java | 64 + .../src/main/java/org/wickra/QqeOutput.java | 5 + .../java/src/main/java/org/wickra/Qstick.java | 89 + .../main/java/org/wickra/QuartileBands.java | 62 + .../java/org/wickra/QuartileBandsOutput.java | 5 + .../main/java/org/wickra/QuotedSpread.java | 61 + .../src/main/java/org/wickra/RSquared.java | 69 + .../src/main/java/org/wickra/RangeBar.java | 5 + .../src/main/java/org/wickra/RangeBars.java | 65 + .../main/java/org/wickra/RealizedSpread.java | 54 + .../java/org/wickra/RealizedVolatility.java | 69 + .../main/java/org/wickra/RecoveryFactor.java | 66 + .../main/java/org/wickra/RectangleRange.java | 86 + .../java/src/main/java/org/wickra/Reflex.java | 69 + .../src/main/java/org/wickra/RegimeLabel.java | 72 + .../java/org/wickra/RelativeStrengthAB.java | 65 + .../org/wickra/RelativeStrengthOutput.java | 5 + .../src/main/java/org/wickra/RenkoBars.java | 65 + .../src/main/java/org/wickra/RenkoBrick.java | 5 + .../java/org/wickra/RenkoTrailingStop.java | 66 + .../src/main/java/org/wickra/RickshawMan.java | 86 + .../java/org/wickra/RisingThreeMethods.java | 86 + .../java/src/main/java/org/wickra/Rmi.java | 72 + .../java/src/main/java/org/wickra/Roc.java | 69 + .../java/src/main/java/org/wickra/Rocp.java | 69 + .../java/src/main/java/org/wickra/Rocr.java | 69 + .../src/main/java/org/wickra/Rocr100.java | 69 + .../org/wickra/RogersSatchellVolatility.java | 92 + .../src/main/java/org/wickra/RollMeasure.java | 54 + .../java/org/wickra/RollingCorrelation.java | 73 + .../java/org/wickra/RollingCovariance.java | 73 + .../src/main/java/org/wickra/RollingIqr.java | 69 + .../java/org/wickra/RollingMinMaxScaler.java | 69 + .../org/wickra/RollingPercentileRank.java | 69 + .../main/java/org/wickra/RollingQuantile.java | 69 + .../src/main/java/org/wickra/RollingVwap.java | 89 + .../main/java/org/wickra/RoofingFilter.java | 72 + .../java/src/main/java/org/wickra/Rsi.java | 69 + .../java/src/main/java/org/wickra/Rsx.java | 69 + .../java/src/main/java/org/wickra/RunBar.java | 5 + .../src/main/java/org/wickra/RunBars.java | 71 + .../java/src/main/java/org/wickra/Rvi.java | 89 + .../main/java/org/wickra/RviVolatility.java | 69 + .../java/src/main/java/org/wickra/Rwi.java | 61 + .../src/main/java/org/wickra/RwiOutput.java | 5 + .../main/java/org/wickra/SampleEntropy.java | 72 + .../java/src/main/java/org/wickra/SarExt.java | 86 + .../main/java/org/wickra/SeasonalZScore.java | 86 + .../main/java/org/wickra/SeparatingLines.java | 86 + .../main/java/org/wickra/SessionHighLow.java | 58 + .../java/org/wickra/SessionHighLowOutput.java | 5 + .../main/java/org/wickra/SessionRange.java | 59 + .../java/org/wickra/SessionRangeOutput.java | 5 + .../src/main/java/org/wickra/SessionVwap.java | 86 + .../main/java/org/wickra/ShannonEntropy.java | 72 + .../java/src/main/java/org/wickra/Shark.java | 86 + .../src/main/java/org/wickra/SharpeRatio.java | 69 + .../main/java/org/wickra/ShootingStar.java | 86 + .../src/main/java/org/wickra/ShortLine.java | 86 + .../main/java/org/wickra/SignedVolume.java | 51 + .../src/main/java/org/wickra/SineWave.java | 66 + .../main/java/org/wickra/SineWeightedMa.java | 69 + .../main/java/org/wickra/SinglePrints.java | 92 + .../src/main/java/org/wickra/Skewness.java | 69 + .../java/src/main/java/org/wickra/Sma.java | 69 + .../java/src/main/java/org/wickra/Smi.java | 95 + .../java/src/main/java/org/wickra/Smma.java | 69 + .../java/org/wickra/SmoothedHeikinAshi.java | 63 + .../org/wickra/SmoothedHeikinAshiOutput.java | 5 + .../main/java/org/wickra/SortinoRatio.java | 69 + .../java/org/wickra/SpearmanCorrelation.java | 73 + .../src/main/java/org/wickra/SpinningTop.java | 86 + .../java/org/wickra/SpreadAr1Coefficient.java | 73 + .../java/org/wickra/SpreadBollingerBands.java | 63 + .../wickra/SpreadBollingerBandsOutput.java | 5 + .../src/main/java/org/wickra/SpreadHurst.java | 73 + .../main/java/org/wickra/StalledPattern.java | 86 + .../main/java/org/wickra/StandardError.java | 69 + .../java/org/wickra/StandardErrorBands.java | 62 + .../org/wickra/StandardErrorBandsOutput.java | 5 + .../src/main/java/org/wickra/StarcBands.java | 65 + .../java/org/wickra/StarcBandsOutput.java | 5 + .../java/src/main/java/org/wickra/Stc.java | 75 + .../java/src/main/java/org/wickra/StdDev.java | 69 + .../java/org/wickra/StepTrailingStop.java | 66 + .../main/java/org/wickra/SterlingRatio.java | 69 + .../main/java/org/wickra/StickSandwich.java | 86 + .../src/main/java/org/wickra/StochRsi.java | 72 + .../src/main/java/org/wickra/Stochastic.java | 64 + .../main/java/org/wickra/StochasticCci.java | 89 + .../java/org/wickra/StochasticOutput.java | 5 + .../main/java/org/wickra/SuperSmoother.java | 69 + .../src/main/java/org/wickra/SuperTrend.java | 61 + .../java/org/wickra/SuperTrendOutput.java | 5 + .../java/src/main/java/org/wickra/T3.java | 69 + .../src/main/java/org/wickra/TailRatio.java | 69 + .../java/org/wickra/TakerBuySellRatio.java | 51 + .../java/src/main/java/org/wickra/Takuri.java | 86 + .../src/main/java/org/wickra/TasukiGap.java | 86 + .../main/java/org/wickra/TdCamouflage.java | 86 + .../java/src/main/java/org/wickra/TdClop.java | 86 + .../src/main/java/org/wickra/TdClopwin.java | 86 + .../src/main/java/org/wickra/TdCombo.java | 98 + .../src/main/java/org/wickra/TdCountdown.java | 98 + .../src/main/java/org/wickra/TdDWave.java | 89 + .../src/main/java/org/wickra/TdDeMarker.java | 89 + .../main/java/org/wickra/TdDifferential.java | 86 + .../src/main/java/org/wickra/TdLines.java | 64 + .../main/java/org/wickra/TdLinesOutput.java | 5 + .../main/java/org/wickra/TdMovingAverage.java | 64 + .../org/wickra/TdMovingAverageOutput.java | 5 + .../java/src/main/java/org/wickra/TdOpen.java | 86 + .../src/main/java/org/wickra/TdPressure.java | 89 + .../main/java/org/wickra/TdPropulsion.java | 86 + .../java/org/wickra/TdRangeProjection.java | 58 + .../org/wickra/TdRangeProjectionOutput.java | 5 + .../java/src/main/java/org/wickra/TdRei.java | 89 + .../src/main/java/org/wickra/TdRiskLevel.java | 64 + .../java/org/wickra/TdRiskLevelOutput.java | 5 + .../main/java/org/wickra/TdSequential.java | 71 + .../java/org/wickra/TdSequentialOutput.java | 5 + .../src/main/java/org/wickra/TdSetup.java | 92 + .../java/src/main/java/org/wickra/TdTrap.java | 86 + .../java/src/main/java/org/wickra/Tema.java | 69 + .../java/org/wickra/TermStructureBasis.java | 51 + .../src/main/java/org/wickra/ThreeDrives.java | 86 + .../src/main/java/org/wickra/ThreeInside.java | 86 + .../main/java/org/wickra/ThreeLineBreak.java | 89 + .../java/org/wickra/ThreeLineBreakBars.java | 68 + .../main/java/org/wickra/ThreeLineStrike.java | 86 + .../main/java/org/wickra/ThreeOutside.java | 86 + .../java/org/wickra/ThreeSoldiersOrCrows.java | 86 + .../java/org/wickra/ThreeStarsInSouth.java | 86 + .../src/main/java/org/wickra/Thrusting.java | 86 + .../src/main/java/org/wickra/TickBar.java | 5 + .../src/main/java/org/wickra/TickBars.java | 70 + .../src/main/java/org/wickra/TickIndex.java | 72 + .../java/src/main/java/org/wickra/Tii.java | 72 + .../main/java/org/wickra/TimeBasedStop.java | 89 + .../org/wickra/TimeOfDayReturnProfile.java | 65 + .../main/java/org/wickra/TowerTopBottom.java | 86 + .../src/main/java/org/wickra/TpoProfile.java | 72 + .../org/wickra/TpoProfileOutputScalars.java | 5 + .../main/java/org/wickra/TradeImbalance.java | 54 + .../org/wickra/TradeSignAutocorrelation.java | 54 + .../java/org/wickra/TradeVolumeIndex.java | 86 + .../src/main/java/org/wickra/TrendLabel.java | 69 + .../java/org/wickra/TrendStrengthIndex.java | 69 + .../src/main/java/org/wickra/Trendflex.java | 69 + .../main/java/org/wickra/TreynorRatio.java | 73 + .../src/main/java/org/wickra/Triangle.java | 86 + .../java/src/main/java/org/wickra/Trima.java | 69 + .../java/src/main/java/org/wickra/Trin.java | 72 + .../main/java/org/wickra/TripleTopBottom.java | 86 + .../src/main/java/org/wickra/Tristar.java | 86 + .../java/src/main/java/org/wickra/Trix.java | 69 + .../src/main/java/org/wickra/TrueRange.java | 86 + .../java/src/main/java/org/wickra/Tsf.java | 69 + .../main/java/org/wickra/TsfOscillator.java | 69 + .../java/src/main/java/org/wickra/Tsi.java | 72 + .../java/src/main/java/org/wickra/Tsv.java | 89 + .../src/main/java/org/wickra/TtmSqueeze.java | 61 + .../java/org/wickra/TtmSqueezeOutput.java | 5 + .../src/main/java/org/wickra/TtmTrend.java | 89 + .../src/main/java/org/wickra/TurnOfMonth.java | 86 + .../src/main/java/org/wickra/Tweezer.java | 86 + .../main/java/org/wickra/TwiggsMoneyFlow.java | 89 + .../src/main/java/org/wickra/TwoCrows.java | 86 + .../main/java/org/wickra/TypicalPrice.java | 86 + .../src/main/java/org/wickra/UlcerIndex.java | 69 + .../java/org/wickra/UltimateOscillator.java | 95 + .../java/org/wickra/UniqueThreeRiver.java | 86 + .../java/org/wickra/UniversalOscillator.java | 69 + .../java/org/wickra/UpDownVolumeRatio.java | 72 + .../org/wickra/UpsideGapThreeMethods.java | 86 + .../java/org/wickra/UpsideGapTwoCrows.java | 86 + .../java/org/wickra/UpsidePotentialRatio.java | 69 + .../src/main/java/org/wickra/ValueArea.java | 65 + .../main/java/org/wickra/ValueAreaOutput.java | 5 + .../src/main/java/org/wickra/ValueAtRisk.java | 69 + .../src/main/java/org/wickra/Variance.java | 69 + .../main/java/org/wickra/VarianceRatio.java | 76 + .../org/wickra/VerticalHorizontalFilter.java | 69 + .../java/src/main/java/org/wickra/Vidya.java | 72 + .../main/java/org/wickra/VolatilityCone.java | 67 + .../java/org/wickra/VolatilityConeOutput.java | 5 + .../org/wickra/VolatilityOfVolatility.java | 72 + .../main/java/org/wickra/VolatilityRatio.java | 89 + .../src/main/java/org/wickra/VoltyStop.java | 89 + .../src/main/java/org/wickra/VolumeBar.java | 5 + .../src/main/java/org/wickra/VolumeBars.java | 67 + .../java/org/wickra/VolumeByTimeProfile.java | 65 + .../java/org/wickra/VolumeOscillator.java | 92 + .../java/org/wickra/VolumePriceTrend.java | 86 + .../main/java/org/wickra/VolumeProfile.java | 72 + .../wickra/VolumeProfileOutputScalars.java | 5 + .../src/main/java/org/wickra/VolumeRsi.java | 89 + .../java/org/wickra/VolumeWeightedMacd.java | 68 + .../org/wickra/VolumeWeightedMacdOutput.java | 5 + .../java/org/wickra/VolumeWeightedSr.java | 61 + .../org/wickra/VolumeWeightedSrOutput.java | 5 + .../java/src/main/java/org/wickra/Vortex.java | 61 + .../main/java/org/wickra/VortexOutput.java | 5 + .../java/src/main/java/org/wickra/Vpin.java | 54 + .../java/src/main/java/org/wickra/Vwap.java | 86 + .../main/java/org/wickra/VwapStdDevBands.java | 60 + .../org/wickra/VwapStdDevBandsOutput.java | 5 + .../java/src/main/java/org/wickra/Vwma.java | 89 + .../java/src/main/java/org/wickra/Vzo.java | 89 + .../java/src/main/java/org/wickra/Wad.java | 86 + .../java/src/main/java/org/wickra/WavePm.java | 72 + .../src/main/java/org/wickra/WaveTrend.java | 67 + .../main/java/org/wickra/WaveTrendOutput.java | 5 + .../java/src/main/java/org/wickra/Wedge.java | 86 + .../main/java/org/wickra/WeightedClose.java | 86 + .../src/main/java/org/wickra/WickRatio.java | 86 + .../java/org/wickra/WilliamsFractals.java | 58 + .../org/wickra/WilliamsFractalsOutput.java | 5 + .../src/main/java/org/wickra/WilliamsR.java | 89 + .../src/main/java/org/wickra/WinRate.java | 69 + .../java/src/main/java/org/wickra/Wma.java | 69 + .../main/java/org/wickra/WoodiePivots.java | 61 + .../java/org/wickra/WoodiePivotsOutput.java | 5 + .../java/org/wickra/YangZhangVolatility.java | 92 + .../src/main/java/org/wickra/YoyoExit.java | 89 + .../java/src/main/java/org/wickra/ZScore.java | 69 + .../src/main/java/org/wickra/ZeroLagMacd.java | 68 + .../java/org/wickra/ZeroLagMacdOutput.java | 5 + .../java/src/main/java/org/wickra/ZigZag.java | 58 + .../main/java/org/wickra/ZigZagOutput.java | 5 + .../java/src/main/java/org/wickra/Zlema.java | 69 + .../org/wickra/internal/NativeMethods.java | 4928 +++++++++++++++++ .../org/wickra/internal/WickraNative.java | 179 + .../test/java/org/wickra/ArchetypeTests.java | 153 + bindings/node/README.md | 2 +- bindings/python/README.md | 2 +- bindings/r/README.md | 2 +- bindings/wasm/README.md | 2 +- docs/README.md | 3 +- examples/README.md | 23 + examples/java/.gitignore | 5 + examples/java/README.md | 35 + examples/java/pom.xml | 62 + .../java/org/wickra/examples/Backtest.java | 43 + .../main/java/org/wickra/examples/Equity.java | 63 + .../org/wickra/examples/FetchBtcusdt.java | 48 + .../java/org/wickra/examples/LiveBinance.java | 73 + .../java/org/wickra/examples/MarketData.java | 91 + .../org/wickra/examples/MultiTimeframe.java | 46 + .../org/wickra/examples/ParallelAssets.java | 50 + .../examples/StrategyBollingerSqueeze.java | 56 + .../org/wickra/examples/StrategyMacdAdx.java | 53 + .../examples/StrategyRsiMeanReversion.java | 38 + .../java/org/wickra/examples/Streaming.java | 38 + 664 files changed, 44991 insertions(+), 26 deletions(-) create mode 100644 bindings/java/.gitignore create mode 100644 bindings/java/README.md create mode 100644 bindings/java/pom.xml create mode 100644 bindings/java/src/main/java/org/wickra/AbandonedBaby.java create mode 100644 bindings/java/src/main/java/org/wickra/Abcd.java create mode 100644 bindings/java/src/main/java/org/wickra/AbsoluteBreadthIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/AccelerationBands.java create mode 100644 bindings/java/src/main/java/org/wickra/AccelerationBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/AcceleratorOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/AdOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/AdVolumeLine.java create mode 100644 bindings/java/src/main/java/org/wickra/AdaptiveCci.java create mode 100644 bindings/java/src/main/java/org/wickra/AdaptiveCycle.java create mode 100644 bindings/java/src/main/java/org/wickra/AdaptiveLaguerreFilter.java create mode 100644 bindings/java/src/main/java/org/wickra/AdaptiveRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/Adl.java create mode 100644 bindings/java/src/main/java/org/wickra/AdvanceBlock.java create mode 100644 bindings/java/src/main/java/org/wickra/AdvanceDecline.java create mode 100644 bindings/java/src/main/java/org/wickra/AdvanceDeclineRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Adx.java create mode 100644 bindings/java/src/main/java/org/wickra/AdxOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Adxr.java create mode 100644 bindings/java/src/main/java/org/wickra/Alligator.java create mode 100644 bindings/java/src/main/java/org/wickra/AlligatorOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Alma.java create mode 100644 bindings/java/src/main/java/org/wickra/Alpha.java create mode 100644 bindings/java/src/main/java/org/wickra/AmihudIlliquidity.java create mode 100644 bindings/java/src/main/java/org/wickra/AnchoredRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/AnchoredVwap.java create mode 100644 bindings/java/src/main/java/org/wickra/AndrewsPitchfork.java create mode 100644 bindings/java/src/main/java/org/wickra/AndrewsPitchforkOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Apo.java create mode 100644 bindings/java/src/main/java/org/wickra/Aroon.java create mode 100644 bindings/java/src/main/java/org/wickra/AroonOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/AroonOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Atr.java create mode 100644 bindings/java/src/main/java/org/wickra/AtrBands.java create mode 100644 bindings/java/src/main/java/org/wickra/AtrBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/AtrRatchet.java create mode 100644 bindings/java/src/main/java/org/wickra/AtrRatchetOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/AtrTrailingStop.java create mode 100644 bindings/java/src/main/java/org/wickra/AutoFib.java create mode 100644 bindings/java/src/main/java/org/wickra/AutoFibOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Autocorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/AutocorrelationPeriodogram.java create mode 100644 bindings/java/src/main/java/org/wickra/AverageDailyRange.java create mode 100644 bindings/java/src/main/java/org/wickra/AverageDrawdown.java create mode 100644 bindings/java/src/main/java/org/wickra/AvgPrice.java create mode 100644 bindings/java/src/main/java/org/wickra/AwesomeOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/AwesomeOscillatorHistogram.java create mode 100644 bindings/java/src/main/java/org/wickra/BalanceOfPower.java create mode 100644 bindings/java/src/main/java/org/wickra/BandpassFilter.java create mode 100644 bindings/java/src/main/java/org/wickra/Bat.java create mode 100644 bindings/java/src/main/java/org/wickra/BeltHold.java create mode 100644 bindings/java/src/main/java/org/wickra/Beta.java create mode 100644 bindings/java/src/main/java/org/wickra/BetaNeutralSpread.java create mode 100644 bindings/java/src/main/java/org/wickra/BetterVolume.java create mode 100644 bindings/java/src/main/java/org/wickra/BipowerVariation.java create mode 100644 bindings/java/src/main/java/org/wickra/BodySizePct.java create mode 100644 bindings/java/src/main/java/org/wickra/BollingerBands.java create mode 100644 bindings/java/src/main/java/org/wickra/BollingerBandwidth.java create mode 100644 bindings/java/src/main/java/org/wickra/BollingerOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/BomarBands.java create mode 100644 bindings/java/src/main/java/org/wickra/BomarBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/BreadthThrust.java create mode 100644 bindings/java/src/main/java/org/wickra/Breakaway.java create mode 100644 bindings/java/src/main/java/org/wickra/BullishPercentIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/BurkeRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Butterfly.java create mode 100644 bindings/java/src/main/java/org/wickra/CalendarSpread.java create mode 100644 bindings/java/src/main/java/org/wickra/CalmarRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Camarilla.java create mode 100644 bindings/java/src/main/java/org/wickra/CamarillaPivotsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/CandleVolume.java create mode 100644 bindings/java/src/main/java/org/wickra/CandleVolumeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Cci.java create mode 100644 bindings/java/src/main/java/org/wickra/CenterOfGravity.java create mode 100644 bindings/java/src/main/java/org/wickra/CentralPivotRange.java create mode 100644 bindings/java/src/main/java/org/wickra/CentralPivotRangeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Cfo.java create mode 100644 bindings/java/src/main/java/org/wickra/ChaikinMoneyFlow.java create mode 100644 bindings/java/src/main/java/org/wickra/ChaikinOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/ChaikinVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/ChandeKrollStop.java create mode 100644 bindings/java/src/main/java/org/wickra/ChandeKrollStopOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ChandelierExit.java create mode 100644 bindings/java/src/main/java/org/wickra/ChandelierExitOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ChoppinessIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/ClassicPivots.java create mode 100644 bindings/java/src/main/java/org/wickra/ClassicPivotsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/CloseVsOpen.java create mode 100644 bindings/java/src/main/java/org/wickra/ClosingMarubozu.java create mode 100644 bindings/java/src/main/java/org/wickra/Cmo.java create mode 100644 bindings/java/src/main/java/org/wickra/CoefficientOfVariation.java create mode 100644 bindings/java/src/main/java/org/wickra/Cointegration.java create mode 100644 bindings/java/src/main/java/org/wickra/CointegrationOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/CommonSenseRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/CompositeProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/CompositeProfileOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ConcealingBabySwallow.java create mode 100644 bindings/java/src/main/java/org/wickra/ConditionalValueAtRisk.java create mode 100644 bindings/java/src/main/java/org/wickra/ConnorsRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/Coppock.java create mode 100644 bindings/java/src/main/java/org/wickra/CorrelationTrendIndicator.java create mode 100644 bindings/java/src/main/java/org/wickra/Counterattack.java create mode 100644 bindings/java/src/main/java/org/wickra/Crab.java create mode 100644 bindings/java/src/main/java/org/wickra/CumulativeVolumeDelta.java create mode 100644 bindings/java/src/main/java/org/wickra/CumulativeVolumeIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/CupAndHandle.java create mode 100644 bindings/java/src/main/java/org/wickra/CyberneticCycle.java create mode 100644 bindings/java/src/main/java/org/wickra/Cypher.java create mode 100644 bindings/java/src/main/java/org/wickra/DayOfWeekProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/Decycler.java create mode 100644 bindings/java/src/main/java/org/wickra/DecyclerOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/Dema.java create mode 100644 bindings/java/src/main/java/org/wickra/DemandIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/DemarkPivots.java create mode 100644 bindings/java/src/main/java/org/wickra/DemarkPivotsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/DepthSlope.java create mode 100644 bindings/java/src/main/java/org/wickra/DerivativeOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/DetrendedStdDev.java create mode 100644 bindings/java/src/main/java/org/wickra/DisparityIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/DistanceSsd.java create mode 100644 bindings/java/src/main/java/org/wickra/Doji.java create mode 100644 bindings/java/src/main/java/org/wickra/DojiStar.java create mode 100644 bindings/java/src/main/java/org/wickra/DollarBar.java create mode 100644 bindings/java/src/main/java/org/wickra/DollarBars.java create mode 100644 bindings/java/src/main/java/org/wickra/Donchian.java create mode 100644 bindings/java/src/main/java/org/wickra/DonchianOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/DonchianStop.java create mode 100644 bindings/java/src/main/java/org/wickra/DonchianStopOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/DoubleBollinger.java create mode 100644 bindings/java/src/main/java/org/wickra/DoubleBollingerOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/DoubleTopBottom.java create mode 100644 bindings/java/src/main/java/org/wickra/DownsideGapThreeMethods.java create mode 100644 bindings/java/src/main/java/org/wickra/Dpo.java create mode 100644 bindings/java/src/main/java/org/wickra/DragonflyDoji.java create mode 100644 bindings/java/src/main/java/org/wickra/DrawdownDuration.java create mode 100644 bindings/java/src/main/java/org/wickra/DumplingTop.java create mode 100644 bindings/java/src/main/java/org/wickra/Dx.java create mode 100644 bindings/java/src/main/java/org/wickra/DynamicMomentumIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/EaseOfMovement.java create mode 100644 bindings/java/src/main/java/org/wickra/EffectiveSpread.java create mode 100644 bindings/java/src/main/java/org/wickra/EhlersStochastic.java create mode 100644 bindings/java/src/main/java/org/wickra/Ehma.java create mode 100644 bindings/java/src/main/java/org/wickra/ElderImpulse.java create mode 100644 bindings/java/src/main/java/org/wickra/ElderRay.java create mode 100644 bindings/java/src/main/java/org/wickra/ElderRayOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ElderSafeZone.java create mode 100644 bindings/java/src/main/java/org/wickra/ElderSafeZoneOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Ema.java create mode 100644 bindings/java/src/main/java/org/wickra/EmpiricalModeDecomposition.java create mode 100644 bindings/java/src/main/java/org/wickra/Engulfing.java create mode 100644 bindings/java/src/main/java/org/wickra/Equivolume.java create mode 100644 bindings/java/src/main/java/org/wickra/EquivolumeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/EstimatedLeverageRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/EvenBetterSinewave.java create mode 100644 bindings/java/src/main/java/org/wickra/EveningDojiStar.java create mode 100644 bindings/java/src/main/java/org/wickra/Evwma.java create mode 100644 bindings/java/src/main/java/org/wickra/EwmaVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/Expectancy.java create mode 100644 bindings/java/src/main/java/org/wickra/FallingThreeMethods.java create mode 100644 bindings/java/src/main/java/org/wickra/Fama.java create mode 100644 bindings/java/src/main/java/org/wickra/FibArcs.java create mode 100644 bindings/java/src/main/java/org/wickra/FibArcsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibChannel.java create mode 100644 bindings/java/src/main/java/org/wickra/FibChannelOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibConfluence.java create mode 100644 bindings/java/src/main/java/org/wickra/FibConfluenceOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibExtension.java create mode 100644 bindings/java/src/main/java/org/wickra/FibExtensionOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibFan.java create mode 100644 bindings/java/src/main/java/org/wickra/FibFanOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibProjection.java create mode 100644 bindings/java/src/main/java/org/wickra/FibProjectionOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibRetracement.java create mode 100644 bindings/java/src/main/java/org/wickra/FibRetracementOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibTimeZones.java create mode 100644 bindings/java/src/main/java/org/wickra/FibTimeZonesOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FibonacciPivots.java create mode 100644 bindings/java/src/main/java/org/wickra/FibonacciPivotsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/FisherRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/FisherTransform.java create mode 100644 bindings/java/src/main/java/org/wickra/FlagPennant.java create mode 100644 bindings/java/src/main/java/org/wickra/Footprint.java create mode 100644 bindings/java/src/main/java/org/wickra/FootprintLevel.java create mode 100644 bindings/java/src/main/java/org/wickra/ForceIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/FractalChaosBands.java create mode 100644 bindings/java/src/main/java/org/wickra/FractalChaosBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Frama.java create mode 100644 bindings/java/src/main/java/org/wickra/FryPanBottom.java create mode 100644 bindings/java/src/main/java/org/wickra/FundingBasis.java create mode 100644 bindings/java/src/main/java/org/wickra/FundingImpliedApr.java create mode 100644 bindings/java/src/main/java/org/wickra/FundingRate.java create mode 100644 bindings/java/src/main/java/org/wickra/FundingRateMean.java create mode 100644 bindings/java/src/main/java/org/wickra/FundingRateZScore.java create mode 100644 bindings/java/src/main/java/org/wickra/GainLossRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/GainToPainRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/GapSideBySideWhite.java create mode 100644 bindings/java/src/main/java/org/wickra/Garch11.java create mode 100644 bindings/java/src/main/java/org/wickra/GarmanKlassVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/Gartley.java create mode 100644 bindings/java/src/main/java/org/wickra/GatorOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/GatorOscillatorOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/GeneralizedDema.java create mode 100644 bindings/java/src/main/java/org/wickra/GeometricMa.java create mode 100644 bindings/java/src/main/java/org/wickra/GoldenPocket.java create mode 100644 bindings/java/src/main/java/org/wickra/GoldenPocketOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/GrangerCausality.java create mode 100644 bindings/java/src/main/java/org/wickra/GravestoneDoji.java create mode 100644 bindings/java/src/main/java/org/wickra/Hammer.java create mode 100644 bindings/java/src/main/java/org/wickra/HangingMan.java create mode 100644 bindings/java/src/main/java/org/wickra/Harami.java create mode 100644 bindings/java/src/main/java/org/wickra/HaramiCross.java create mode 100644 bindings/java/src/main/java/org/wickra/HasbrouckInformationShare.java create mode 100644 bindings/java/src/main/java/org/wickra/HeadAndShoulders.java create mode 100644 bindings/java/src/main/java/org/wickra/HeikinAshi.java create mode 100644 bindings/java/src/main/java/org/wickra/HeikinAshiOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/HeikinAshiOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/HiLoActivator.java create mode 100644 bindings/java/src/main/java/org/wickra/HighLowIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/HighLowRange.java create mode 100644 bindings/java/src/main/java/org/wickra/HighLowVolumeNodes.java create mode 100644 bindings/java/src/main/java/org/wickra/HighLowVolumeNodesOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/HighWave.java create mode 100644 bindings/java/src/main/java/org/wickra/HighpassFilter.java create mode 100644 bindings/java/src/main/java/org/wickra/Hikkake.java create mode 100644 bindings/java/src/main/java/org/wickra/HikkakeModified.java create mode 100644 bindings/java/src/main/java/org/wickra/HilbertDominantCycle.java create mode 100644 bindings/java/src/main/java/org/wickra/HistoricalVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/Hma.java create mode 100644 bindings/java/src/main/java/org/wickra/HoltWinters.java create mode 100644 bindings/java/src/main/java/org/wickra/HomingPigeon.java create mode 100644 bindings/java/src/main/java/org/wickra/HtDcPhase.java create mode 100644 bindings/java/src/main/java/org/wickra/HtPhasor.java create mode 100644 bindings/java/src/main/java/org/wickra/HtPhasorOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/HtTrendMode.java create mode 100644 bindings/java/src/main/java/org/wickra/HurstChannel.java create mode 100644 bindings/java/src/main/java/org/wickra/HurstChannelOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/HurstExponent.java create mode 100644 bindings/java/src/main/java/org/wickra/Ichimoku.java create mode 100644 bindings/java/src/main/java/org/wickra/IchimokuOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/IdenticalThreeCrows.java create mode 100644 bindings/java/src/main/java/org/wickra/ImbalanceBar.java create mode 100644 bindings/java/src/main/java/org/wickra/ImbalanceBars.java create mode 100644 bindings/java/src/main/java/org/wickra/InNeck.java create mode 100644 bindings/java/src/main/java/org/wickra/Inertia.java create mode 100644 bindings/java/src/main/java/org/wickra/InformationRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/InitialBalance.java create mode 100644 bindings/java/src/main/java/org/wickra/InitialBalanceOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/InstantaneousTrendline.java create mode 100644 bindings/java/src/main/java/org/wickra/IntradayIntensity.java create mode 100644 bindings/java/src/main/java/org/wickra/IntradayMomentumIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/IntradayVolatilityProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/InverseFisherTransform.java create mode 100644 bindings/java/src/main/java/org/wickra/InvertedHammer.java create mode 100644 bindings/java/src/main/java/org/wickra/JarqueBera.java create mode 100644 bindings/java/src/main/java/org/wickra/Jma.java create mode 100644 bindings/java/src/main/java/org/wickra/JumpIndicator.java create mode 100644 bindings/java/src/main/java/org/wickra/KRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/KagiBar.java create mode 100644 bindings/java/src/main/java/org/wickra/KagiBars.java create mode 100644 bindings/java/src/main/java/org/wickra/KalmanHedgeRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/KalmanHedgeRatioOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Kama.java create mode 100644 bindings/java/src/main/java/org/wickra/KaseDevStop.java create mode 100644 bindings/java/src/main/java/org/wickra/KaseDevStopOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/KasePermissionStochastic.java create mode 100644 bindings/java/src/main/java/org/wickra/KasePermissionStochasticOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/KellyCriterion.java create mode 100644 bindings/java/src/main/java/org/wickra/Keltner.java create mode 100644 bindings/java/src/main/java/org/wickra/KeltnerOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/KendallTau.java create mode 100644 bindings/java/src/main/java/org/wickra/Kicking.java create mode 100644 bindings/java/src/main/java/org/wickra/KickingByLength.java create mode 100644 bindings/java/src/main/java/org/wickra/Kst.java create mode 100644 bindings/java/src/main/java/org/wickra/KstOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Kurtosis.java create mode 100644 bindings/java/src/main/java/org/wickra/Kvo.java create mode 100644 bindings/java/src/main/java/org/wickra/KylesLambda.java create mode 100644 bindings/java/src/main/java/org/wickra/LadderBottom.java create mode 100644 bindings/java/src/main/java/org/wickra/LaguerreRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelationOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/LinRegAngle.java create mode 100644 bindings/java/src/main/java/org/wickra/LinRegChannel.java create mode 100644 bindings/java/src/main/java/org/wickra/LinRegChannelOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/LinRegIntercept.java create mode 100644 bindings/java/src/main/java/org/wickra/LinRegSlope.java create mode 100644 bindings/java/src/main/java/org/wickra/LineBreakBar.java create mode 100644 bindings/java/src/main/java/org/wickra/LinearRegression.java create mode 100644 bindings/java/src/main/java/org/wickra/LiquidationFeatures.java create mode 100644 bindings/java/src/main/java/org/wickra/LiquidationFeaturesOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/LogReturn.java create mode 100644 bindings/java/src/main/java/org/wickra/LongLeggedDoji.java create mode 100644 bindings/java/src/main/java/org/wickra/LongLine.java create mode 100644 bindings/java/src/main/java/org/wickra/LongShortRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/M2Measure.java create mode 100644 bindings/java/src/main/java/org/wickra/MaEnvelope.java create mode 100644 bindings/java/src/main/java/org/wickra/MaEnvelopeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/MacdExt.java create mode 100644 bindings/java/src/main/java/org/wickra/MacdFix.java create mode 100644 bindings/java/src/main/java/org/wickra/MacdHistogram.java create mode 100644 bindings/java/src/main/java/org/wickra/MacdIndicator.java create mode 100644 bindings/java/src/main/java/org/wickra/MacdOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Mama.java create mode 100644 bindings/java/src/main/java/org/wickra/MamaOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/MarketFacilitationIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/MartinRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Marubozu.java create mode 100644 bindings/java/src/main/java/org/wickra/MassIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/MatHold.java create mode 100644 bindings/java/src/main/java/org/wickra/MatchingLow.java create mode 100644 bindings/java/src/main/java/org/wickra/MaxDrawdown.java create mode 100644 bindings/java/src/main/java/org/wickra/McClellanOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/McClellanSummationIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/McGinleyDynamic.java create mode 100644 bindings/java/src/main/java/org/wickra/MedianAbsoluteDeviation.java create mode 100644 bindings/java/src/main/java/org/wickra/MedianChannel.java create mode 100644 bindings/java/src/main/java/org/wickra/MedianChannelOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/MedianMa.java create mode 100644 bindings/java/src/main/java/org/wickra/MedianPrice.java create mode 100644 bindings/java/src/main/java/org/wickra/Mfi.java create mode 100644 bindings/java/src/main/java/org/wickra/Microprice.java create mode 100644 bindings/java/src/main/java/org/wickra/MidPoint.java create mode 100644 bindings/java/src/main/java/org/wickra/MidPrice.java create mode 100644 bindings/java/src/main/java/org/wickra/MinusDi.java create mode 100644 bindings/java/src/main/java/org/wickra/MinusDm.java create mode 100644 bindings/java/src/main/java/org/wickra/ModifiedMaStop.java create mode 100644 bindings/java/src/main/java/org/wickra/ModifiedMaStopOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Mom.java create mode 100644 bindings/java/src/main/java/org/wickra/MorningDojiStar.java create mode 100644 bindings/java/src/main/java/org/wickra/MorningEveningStar.java create mode 100644 bindings/java/src/main/java/org/wickra/MurreyMathLines.java create mode 100644 bindings/java/src/main/java/org/wickra/MurreyMathLinesOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/NakedPoc.java create mode 100644 bindings/java/src/main/java/org/wickra/Natr.java create mode 100644 bindings/java/src/main/java/org/wickra/NewHighsNewLows.java create mode 100644 bindings/java/src/main/java/org/wickra/NewPriceLines.java create mode 100644 bindings/java/src/main/java/org/wickra/Nrtr.java create mode 100644 bindings/java/src/main/java/org/wickra/NrtrOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Nvi.java create mode 100644 bindings/java/src/main/java/org/wickra/OIPriceDivergence.java create mode 100644 bindings/java/src/main/java/org/wickra/OIWeighted.java create mode 100644 bindings/java/src/main/java/org/wickra/Obv.java create mode 100644 bindings/java/src/main/java/org/wickra/OiToVolumeRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/OmegaRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/OnNeck.java create mode 100644 bindings/java/src/main/java/org/wickra/OpenInterestDelta.java create mode 100644 bindings/java/src/main/java/org/wickra/OpenInterestMomentum.java create mode 100644 bindings/java/src/main/java/org/wickra/OpeningMarubozu.java create mode 100644 bindings/java/src/main/java/org/wickra/OpeningRange.java create mode 100644 bindings/java/src/main/java/org/wickra/OpeningRangeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/OrderBookImbalanceFull.java create mode 100644 bindings/java/src/main/java/org/wickra/OrderBookImbalanceTop1.java create mode 100644 bindings/java/src/main/java/org/wickra/OrderBookImbalanceTopN.java create mode 100644 bindings/java/src/main/java/org/wickra/OrderFlowImbalance.java create mode 100644 bindings/java/src/main/java/org/wickra/OuHalfLife.java create mode 100644 bindings/java/src/main/java/org/wickra/OvernightGap.java create mode 100644 bindings/java/src/main/java/org/wickra/OvernightIntradayReturn.java create mode 100644 bindings/java/src/main/java/org/wickra/OvernightIntradayReturnOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/PainIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/PairSpreadZScore.java create mode 100644 bindings/java/src/main/java/org/wickra/PairwiseBeta.java create mode 100644 bindings/java/src/main/java/org/wickra/ParkinsonVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/PearsonCorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/PercentAboveMa.java create mode 100644 bindings/java/src/main/java/org/wickra/PercentB.java create mode 100644 bindings/java/src/main/java/org/wickra/PercentageTrailingStop.java create mode 100644 bindings/java/src/main/java/org/wickra/PerpetualPremiumIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/Pgo.java create mode 100644 bindings/java/src/main/java/org/wickra/PiercingDarkCloud.java create mode 100644 bindings/java/src/main/java/org/wickra/Pin.java create mode 100644 bindings/java/src/main/java/org/wickra/PivotReversal.java create mode 100644 bindings/java/src/main/java/org/wickra/PlusDi.java create mode 100644 bindings/java/src/main/java/org/wickra/PlusDm.java create mode 100644 bindings/java/src/main/java/org/wickra/Pmo.java create mode 100644 bindings/java/src/main/java/org/wickra/PnfColumn.java create mode 100644 bindings/java/src/main/java/org/wickra/PointAndFigureBars.java create mode 100644 bindings/java/src/main/java/org/wickra/PolarizedFractalEfficiency.java create mode 100644 bindings/java/src/main/java/org/wickra/Ppo.java create mode 100644 bindings/java/src/main/java/org/wickra/PpoHistogram.java create mode 100644 bindings/java/src/main/java/org/wickra/ProfileShape.java create mode 100644 bindings/java/src/main/java/org/wickra/ProfitFactor.java create mode 100644 bindings/java/src/main/java/org/wickra/ProjectionBands.java create mode 100644 bindings/java/src/main/java/org/wickra/ProjectionBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ProjectionOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/Psar.java create mode 100644 bindings/java/src/main/java/org/wickra/Pvi.java create mode 100644 bindings/java/src/main/java/org/wickra/Qqe.java create mode 100644 bindings/java/src/main/java/org/wickra/QqeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Qstick.java create mode 100644 bindings/java/src/main/java/org/wickra/QuartileBands.java create mode 100644 bindings/java/src/main/java/org/wickra/QuartileBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/QuotedSpread.java create mode 100644 bindings/java/src/main/java/org/wickra/RSquared.java create mode 100644 bindings/java/src/main/java/org/wickra/RangeBar.java create mode 100644 bindings/java/src/main/java/org/wickra/RangeBars.java create mode 100644 bindings/java/src/main/java/org/wickra/RealizedSpread.java create mode 100644 bindings/java/src/main/java/org/wickra/RealizedVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/RecoveryFactor.java create mode 100644 bindings/java/src/main/java/org/wickra/RectangleRange.java create mode 100644 bindings/java/src/main/java/org/wickra/Reflex.java create mode 100644 bindings/java/src/main/java/org/wickra/RegimeLabel.java create mode 100644 bindings/java/src/main/java/org/wickra/RelativeStrengthAB.java create mode 100644 bindings/java/src/main/java/org/wickra/RelativeStrengthOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/RenkoBars.java create mode 100644 bindings/java/src/main/java/org/wickra/RenkoBrick.java create mode 100644 bindings/java/src/main/java/org/wickra/RenkoTrailingStop.java create mode 100644 bindings/java/src/main/java/org/wickra/RickshawMan.java create mode 100644 bindings/java/src/main/java/org/wickra/RisingThreeMethods.java create mode 100644 bindings/java/src/main/java/org/wickra/Rmi.java create mode 100644 bindings/java/src/main/java/org/wickra/Roc.java create mode 100644 bindings/java/src/main/java/org/wickra/Rocp.java create mode 100644 bindings/java/src/main/java/org/wickra/Rocr.java create mode 100644 bindings/java/src/main/java/org/wickra/Rocr100.java create mode 100644 bindings/java/src/main/java/org/wickra/RogersSatchellVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/RollMeasure.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingCorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingCovariance.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingIqr.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingMinMaxScaler.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingPercentileRank.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingQuantile.java create mode 100644 bindings/java/src/main/java/org/wickra/RollingVwap.java create mode 100644 bindings/java/src/main/java/org/wickra/RoofingFilter.java create mode 100644 bindings/java/src/main/java/org/wickra/Rsi.java create mode 100644 bindings/java/src/main/java/org/wickra/Rsx.java create mode 100644 bindings/java/src/main/java/org/wickra/RunBar.java create mode 100644 bindings/java/src/main/java/org/wickra/RunBars.java create mode 100644 bindings/java/src/main/java/org/wickra/Rvi.java create mode 100644 bindings/java/src/main/java/org/wickra/RviVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/Rwi.java create mode 100644 bindings/java/src/main/java/org/wickra/RwiOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SampleEntropy.java create mode 100644 bindings/java/src/main/java/org/wickra/SarExt.java create mode 100644 bindings/java/src/main/java/org/wickra/SeasonalZScore.java create mode 100644 bindings/java/src/main/java/org/wickra/SeparatingLines.java create mode 100644 bindings/java/src/main/java/org/wickra/SessionHighLow.java create mode 100644 bindings/java/src/main/java/org/wickra/SessionHighLowOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SessionRange.java create mode 100644 bindings/java/src/main/java/org/wickra/SessionRangeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SessionVwap.java create mode 100644 bindings/java/src/main/java/org/wickra/ShannonEntropy.java create mode 100644 bindings/java/src/main/java/org/wickra/Shark.java create mode 100644 bindings/java/src/main/java/org/wickra/SharpeRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/ShootingStar.java create mode 100644 bindings/java/src/main/java/org/wickra/ShortLine.java create mode 100644 bindings/java/src/main/java/org/wickra/SignedVolume.java create mode 100644 bindings/java/src/main/java/org/wickra/SineWave.java create mode 100644 bindings/java/src/main/java/org/wickra/SineWeightedMa.java create mode 100644 bindings/java/src/main/java/org/wickra/SinglePrints.java create mode 100644 bindings/java/src/main/java/org/wickra/Skewness.java create mode 100644 bindings/java/src/main/java/org/wickra/Sma.java create mode 100644 bindings/java/src/main/java/org/wickra/Smi.java create mode 100644 bindings/java/src/main/java/org/wickra/Smma.java create mode 100644 bindings/java/src/main/java/org/wickra/SmoothedHeikinAshi.java create mode 100644 bindings/java/src/main/java/org/wickra/SmoothedHeikinAshiOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SortinoRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/SpearmanCorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/SpinningTop.java create mode 100644 bindings/java/src/main/java/org/wickra/SpreadAr1Coefficient.java create mode 100644 bindings/java/src/main/java/org/wickra/SpreadBollingerBands.java create mode 100644 bindings/java/src/main/java/org/wickra/SpreadBollingerBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SpreadHurst.java create mode 100644 bindings/java/src/main/java/org/wickra/StalledPattern.java create mode 100644 bindings/java/src/main/java/org/wickra/StandardError.java create mode 100644 bindings/java/src/main/java/org/wickra/StandardErrorBands.java create mode 100644 bindings/java/src/main/java/org/wickra/StandardErrorBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/StarcBands.java create mode 100644 bindings/java/src/main/java/org/wickra/StarcBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Stc.java create mode 100644 bindings/java/src/main/java/org/wickra/StdDev.java create mode 100644 bindings/java/src/main/java/org/wickra/StepTrailingStop.java create mode 100644 bindings/java/src/main/java/org/wickra/SterlingRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/StickSandwich.java create mode 100644 bindings/java/src/main/java/org/wickra/StochRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/Stochastic.java create mode 100644 bindings/java/src/main/java/org/wickra/StochasticCci.java create mode 100644 bindings/java/src/main/java/org/wickra/StochasticOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/SuperSmoother.java create mode 100644 bindings/java/src/main/java/org/wickra/SuperTrend.java create mode 100644 bindings/java/src/main/java/org/wickra/SuperTrendOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/T3.java create mode 100644 bindings/java/src/main/java/org/wickra/TailRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/TakerBuySellRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Takuri.java create mode 100644 bindings/java/src/main/java/org/wickra/TasukiGap.java create mode 100644 bindings/java/src/main/java/org/wickra/TdCamouflage.java create mode 100644 bindings/java/src/main/java/org/wickra/TdClop.java create mode 100644 bindings/java/src/main/java/org/wickra/TdClopwin.java create mode 100644 bindings/java/src/main/java/org/wickra/TdCombo.java create mode 100644 bindings/java/src/main/java/org/wickra/TdCountdown.java create mode 100644 bindings/java/src/main/java/org/wickra/TdDWave.java create mode 100644 bindings/java/src/main/java/org/wickra/TdDeMarker.java create mode 100644 bindings/java/src/main/java/org/wickra/TdDifferential.java create mode 100644 bindings/java/src/main/java/org/wickra/TdLines.java create mode 100644 bindings/java/src/main/java/org/wickra/TdLinesOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TdMovingAverage.java create mode 100644 bindings/java/src/main/java/org/wickra/TdMovingAverageOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TdOpen.java create mode 100644 bindings/java/src/main/java/org/wickra/TdPressure.java create mode 100644 bindings/java/src/main/java/org/wickra/TdPropulsion.java create mode 100644 bindings/java/src/main/java/org/wickra/TdRangeProjection.java create mode 100644 bindings/java/src/main/java/org/wickra/TdRangeProjectionOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TdRei.java create mode 100644 bindings/java/src/main/java/org/wickra/TdRiskLevel.java create mode 100644 bindings/java/src/main/java/org/wickra/TdRiskLevelOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TdSequential.java create mode 100644 bindings/java/src/main/java/org/wickra/TdSequentialOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TdSetup.java create mode 100644 bindings/java/src/main/java/org/wickra/TdTrap.java create mode 100644 bindings/java/src/main/java/org/wickra/Tema.java create mode 100644 bindings/java/src/main/java/org/wickra/TermStructureBasis.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeDrives.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeInside.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeLineBreak.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeLineBreakBars.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeLineStrike.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeOutside.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeSoldiersOrCrows.java create mode 100644 bindings/java/src/main/java/org/wickra/ThreeStarsInSouth.java create mode 100644 bindings/java/src/main/java/org/wickra/Thrusting.java create mode 100644 bindings/java/src/main/java/org/wickra/TickBar.java create mode 100644 bindings/java/src/main/java/org/wickra/TickBars.java create mode 100644 bindings/java/src/main/java/org/wickra/TickIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/Tii.java create mode 100644 bindings/java/src/main/java/org/wickra/TimeBasedStop.java create mode 100644 bindings/java/src/main/java/org/wickra/TimeOfDayReturnProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/TowerTopBottom.java create mode 100644 bindings/java/src/main/java/org/wickra/TpoProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/TpoProfileOutputScalars.java create mode 100644 bindings/java/src/main/java/org/wickra/TradeImbalance.java create mode 100644 bindings/java/src/main/java/org/wickra/TradeSignAutocorrelation.java create mode 100644 bindings/java/src/main/java/org/wickra/TradeVolumeIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/TrendLabel.java create mode 100644 bindings/java/src/main/java/org/wickra/TrendStrengthIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/Trendflex.java create mode 100644 bindings/java/src/main/java/org/wickra/TreynorRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/Triangle.java create mode 100644 bindings/java/src/main/java/org/wickra/Trima.java create mode 100644 bindings/java/src/main/java/org/wickra/Trin.java create mode 100644 bindings/java/src/main/java/org/wickra/TripleTopBottom.java create mode 100644 bindings/java/src/main/java/org/wickra/Tristar.java create mode 100644 bindings/java/src/main/java/org/wickra/Trix.java create mode 100644 bindings/java/src/main/java/org/wickra/TrueRange.java create mode 100644 bindings/java/src/main/java/org/wickra/Tsf.java create mode 100644 bindings/java/src/main/java/org/wickra/TsfOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/Tsi.java create mode 100644 bindings/java/src/main/java/org/wickra/Tsv.java create mode 100644 bindings/java/src/main/java/org/wickra/TtmSqueeze.java create mode 100644 bindings/java/src/main/java/org/wickra/TtmSqueezeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/TtmTrend.java create mode 100644 bindings/java/src/main/java/org/wickra/TurnOfMonth.java create mode 100644 bindings/java/src/main/java/org/wickra/Tweezer.java create mode 100644 bindings/java/src/main/java/org/wickra/TwiggsMoneyFlow.java create mode 100644 bindings/java/src/main/java/org/wickra/TwoCrows.java create mode 100644 bindings/java/src/main/java/org/wickra/TypicalPrice.java create mode 100644 bindings/java/src/main/java/org/wickra/UlcerIndex.java create mode 100644 bindings/java/src/main/java/org/wickra/UltimateOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/UniqueThreeRiver.java create mode 100644 bindings/java/src/main/java/org/wickra/UniversalOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/UpDownVolumeRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/UpsideGapThreeMethods.java create mode 100644 bindings/java/src/main/java/org/wickra/UpsideGapTwoCrows.java create mode 100644 bindings/java/src/main/java/org/wickra/UpsidePotentialRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/ValueArea.java create mode 100644 bindings/java/src/main/java/org/wickra/ValueAreaOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ValueAtRisk.java create mode 100644 bindings/java/src/main/java/org/wickra/Variance.java create mode 100644 bindings/java/src/main/java/org/wickra/VarianceRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/VerticalHorizontalFilter.java create mode 100644 bindings/java/src/main/java/org/wickra/Vidya.java create mode 100644 bindings/java/src/main/java/org/wickra/VolatilityCone.java create mode 100644 bindings/java/src/main/java/org/wickra/VolatilityConeOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/VolatilityOfVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/VolatilityRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/VoltyStop.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeBar.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeBars.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeByTimeProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeOscillator.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumePriceTrend.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeProfile.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeProfileOutputScalars.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeRsi.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeWeightedMacd.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeWeightedMacdOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeWeightedSr.java create mode 100644 bindings/java/src/main/java/org/wickra/VolumeWeightedSrOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Vortex.java create mode 100644 bindings/java/src/main/java/org/wickra/VortexOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Vpin.java create mode 100644 bindings/java/src/main/java/org/wickra/Vwap.java create mode 100644 bindings/java/src/main/java/org/wickra/VwapStdDevBands.java create mode 100644 bindings/java/src/main/java/org/wickra/VwapStdDevBandsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Vwma.java create mode 100644 bindings/java/src/main/java/org/wickra/Vzo.java create mode 100644 bindings/java/src/main/java/org/wickra/Wad.java create mode 100644 bindings/java/src/main/java/org/wickra/WavePm.java create mode 100644 bindings/java/src/main/java/org/wickra/WaveTrend.java create mode 100644 bindings/java/src/main/java/org/wickra/WaveTrendOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Wedge.java create mode 100644 bindings/java/src/main/java/org/wickra/WeightedClose.java create mode 100644 bindings/java/src/main/java/org/wickra/WickRatio.java create mode 100644 bindings/java/src/main/java/org/wickra/WilliamsFractals.java create mode 100644 bindings/java/src/main/java/org/wickra/WilliamsFractalsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/WilliamsR.java create mode 100644 bindings/java/src/main/java/org/wickra/WinRate.java create mode 100644 bindings/java/src/main/java/org/wickra/Wma.java create mode 100644 bindings/java/src/main/java/org/wickra/WoodiePivots.java create mode 100644 bindings/java/src/main/java/org/wickra/WoodiePivotsOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/YangZhangVolatility.java create mode 100644 bindings/java/src/main/java/org/wickra/YoyoExit.java create mode 100644 bindings/java/src/main/java/org/wickra/ZScore.java create mode 100644 bindings/java/src/main/java/org/wickra/ZeroLagMacd.java create mode 100644 bindings/java/src/main/java/org/wickra/ZeroLagMacdOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/ZigZag.java create mode 100644 bindings/java/src/main/java/org/wickra/ZigZagOutput.java create mode 100644 bindings/java/src/main/java/org/wickra/Zlema.java create mode 100644 bindings/java/src/main/java/org/wickra/internal/NativeMethods.java create mode 100644 bindings/java/src/main/java/org/wickra/internal/WickraNative.java create mode 100644 bindings/java/src/test/java/org/wickra/ArchetypeTests.java create mode 100644 examples/java/.gitignore create mode 100644 examples/java/README.md create mode 100644 examples/java/pom.xml create mode 100644 examples/java/src/main/java/org/wickra/examples/Backtest.java create mode 100644 examples/java/src/main/java/org/wickra/examples/Equity.java create mode 100644 examples/java/src/main/java/org/wickra/examples/FetchBtcusdt.java create mode 100644 examples/java/src/main/java/org/wickra/examples/LiveBinance.java create mode 100644 examples/java/src/main/java/org/wickra/examples/MarketData.java create mode 100644 examples/java/src/main/java/org/wickra/examples/MultiTimeframe.java create mode 100644 examples/java/src/main/java/org/wickra/examples/ParallelAssets.java create mode 100644 examples/java/src/main/java/org/wickra/examples/StrategyBollingerSqueeze.java create mode 100644 examples/java/src/main/java/org/wickra/examples/StrategyMacdAdx.java create mode 100644 examples/java/src/main/java/org/wickra/examples/StrategyRsiMeanReversion.java create mode 100644 examples/java/src/main/java/org/wickra/examples/Streaming.java diff --git a/.gitattributes b/.gitattributes index 20a1efc3..5565f803 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,6 +16,10 @@ bindings/c/include/wickra.h text eol=lf go.mod text eol=lf go.sum text eol=lf +# Java sources (including the generated binding) are pinned to LF so the +# committed files stay stable regardless of the committer's autocrlf setting. +*.java text eol=lf + # R binding: `R CMD check` requires LF in sources, Makevars and shell scripts. *.R text eol=lf *.Rd text eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f2e61250..5d5d5cca 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -30,7 +30,7 @@ assignees: "" ## Environment - Wickra version: -- Language / binding: +- Language / binding: - OS and architecture: - Rust / Python / Node / .NET version (If relevant): diff --git a/.github/ISSUE_TEMPLATE/bug_report_detailed.md b/.github/ISSUE_TEMPLATE/bug_report_detailed.md index c0b60a0c..959abad7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_detailed.md +++ b/.github/ISSUE_TEMPLATE/bug_report_detailed.md @@ -16,6 +16,11 @@ assignees: [] - [ ] Python (`pip install wickra`) - [ ] Node.js (`npm install wickra`) - [ ] WebAssembly +- [ ] C ABI (`bindings/c`) +- [ ] C# / .NET (`Wickra` on NuGet) +- [ ] Go (`bindings/go`) +- [ ] Java (`org.wickra:wickra` on Maven Central) +- [ ] R (`bindings/r`) - [ ] Docs / examples only ## Environment diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index f458317d..86c0fbc8 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -28,6 +28,7 @@ assignees: "" - [ ] Should be exposed in the C ABI - [ ] Should be exposed in the C# / .NET binding - [ ] Should be exposed in the Go binding +- [ ] Should be exposed in the Java binding - [ ] Should be exposed in the R binding ## Additional context diff --git a/.github/ISSUE_TEMPLATE/performance_regression.md b/.github/ISSUE_TEMPLATE/performance_regression.md index f7d8129b..037778c8 100644 --- a/.github/ISSUE_TEMPLATE/performance_regression.md +++ b/.github/ISSUE_TEMPLATE/performance_regression.md @@ -13,7 +13,7 @@ assignees: [] ## Affected code path - Indicator / API: `e.g. EMA.update` -- Binding: `Rust / Python / Node / Wasm / C ABI / C# (.NET) / Go / R` +- Binding: `Rust / Python / Node / Wasm / C ABI / C# (.NET) / Go / Java / R` - Hot loop or one-shot call? ## Versions compared diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index c9067eae..7f8173df 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -33,4 +33,4 @@ import wickra as ta ## Environment (Only if relevant) - Wickra version: `e.g. 0.4.2` -- Binding: `Rust / Python / Node / Wasm / C ABI / C# (.NET) / Go / R` +- Binding: `Rust / Python / Node / Wasm / C ABI / C# (.NET) / Go / Java / R` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 92f45d1d..2a0fff61 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -22,7 +22,7 @@ - [ ] `cargo clippy --workspace --all-targets -- -D warnings` is clean. - [ ] `cargo test --workspace` passes. - [ ] New behaviour has tests; bug fixes have a regression test. -- [ ] Public API changes are mirrored in the Python / Node / WASM bindings, and the C ABI + C# + Go + R bindings are regenerated +- [ ] Public API changes are mirrored in the Python / Node / WASM bindings, and the C ABI + C# + Go + Java + R bindings are regenerated and their type stubs (If applicable). - [ ] The relevant page on the [documentation site](https://docs.wickra.org) and the `README.md` are updated (If applicable). Docs edits go to a diff --git a/.github/PULL_REQUEST_TEMPLATE/detailed.md b/.github/PULL_REQUEST_TEMPLATE/detailed.md index 35282f8e..f709a312 100644 --- a/.github/PULL_REQUEST_TEMPLATE/detailed.md +++ b/.github/PULL_REQUEST_TEMPLATE/detailed.md @@ -26,6 +26,7 @@ Please fill in the sections below. Delete any that don't apply. - [ ] C ABI (`bindings/c`) - [ ] C# / .NET binding (`bindings/csharp`) - [ ] Go binding (`bindings/go`) +- [ ] Java binding (`bindings/java`) - [ ] R binding (`bindings/r`) - [ ] Examples / docs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dfa0f55..7959a4b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -896,6 +896,77 @@ jobs: - name: Parse the network R examples run: Rscript -e 'invisible(lapply(c("examples/r/fetch_btcusdt.R", "examples/r/live_binance.R"), parse)); cat("network R examples parse OK\n")' + java: + name: Java on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable branch, 2026-03-27 + + - name: Cache cargo + uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2 + continue-on-error: true # cache is an optimisation; never block on a stuck/slow restore + timeout-minutes: 6 + + # The binding links the C ABI hub at runtime through the Java FFM API; build + # it first so WickraNative's development fallback finds + # target/release/wickra.{so,dylib,dll}. JDK 22+ is required for the final FFM + # API, so it is installed explicitly (runners ship 17/21). + - name: Build the C ABI library + run: cargo build -p wickra-c --release + + - name: Set up JDK 22 + id: setup-java + continue-on-error: true + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: temurin + java-version: "22" + cache: maven + + - name: Retry JDK setup (CDN flake) + if: steps.setup-java.outcome == 'failure' + shell: bash + run: | + echo "::warning::setup-java failed (likely CDN flake), waiting 30s before retry..." + sleep 30 + + - name: Set up JDK 22 (retry) + if: steps.setup-java.outcome == 'failure' + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: temurin + java-version: "22" + cache: maven + + - name: Java info + run: java -version + + # `install` runs the archetype test suite (the real FFI boundary check) and + # installs the binding to the local repo so the examples can resolve it. + - name: Test and install the Java binding + run: mvn -B -f bindings/java install + + - name: Build the Java examples + run: mvn -B -f examples/java compile + + # Run only the offline examples (fetch_btcusdt / live_binance need network). + - name: Run the offline Java examples + shell: bash + run: | + for cls in Streaming Backtest MultiTimeframe ParallelAssets \ + StrategyRsiMeanReversion StrategyMacdAdx StrategyBollingerSqueeze; do + mvn -B -q -f examples/java exec:exec -Dexec.mainClass="org.wickra.examples.$cls" + done + # The cross-library benchmark has moved to a dedicated scheduled workflow # (.github/workflows/bench.yml) — see audit finding R10. It runs nightly # at 03:00 UTC and on-demand via `workflow_dispatch`, and is no longer on diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab111a89..40605064 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -706,6 +706,75 @@ jobs: path: nupkg/*.nupkg if-no-files-found: error + # Publish the Java binding to Maven Central. Independent of the GitHub-release + # job so a Java hiccup never blocks the C/C++ asset release. The Maven Central + # namespace (org.wickra) is verified; authentication uses the Sonatype Central + # Portal token (CENTRAL_USERNAME / CENTRAL_PASSWORD) and artifacts are signed + # with the GPG key (GPG_PRIVATE_KEY / GPG_PASSPHRASE). The pom version must + # match the release tag (kept in sync by the version-bump checklist). + java-publish: + name: Publish to Maven Central + needs: c-abi-build + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Download the C ABI native libraries + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: c-abi-* + path: c-abi-artifacts + + - name: Stage native libraries into resources/native/- + shell: bash + run: | + set -e + declare -A PLAT=( + [x86_64-unknown-linux-gnu]=linux-x64 + [aarch64-unknown-linux-gnu]=linux-arm64 + [x86_64-apple-darwin]=osx-x64 + [aarch64-apple-darwin]=osx-arm64 + [x86_64-pc-windows-msvc]=win-x64 + [aarch64-pc-windows-msvc]=win-arm64 + ) + base=bindings/java/src/main/resources/native + for target in "${!PLAT[@]}"; do + archive=$(find c-abi-artifacts -name "wickra-c-$target.tar.gz" | head -1) + if [ -z "$archive" ]; then + echo "::error::missing native artifact for $target"; exit 1 + fi + tmp=$(mktemp -d); tar -xzf "$archive" -C "$tmp" + dest="$base/${PLAT[$target]}"; mkdir -p "$dest" + for f in libwickra.so libwickra.dylib wickra.dll; do + src=$(find "$tmp" -name "$f" | head -1) + [ -n "$src" ] && cp "$src" "$dest/" + done + echo "staged ${PLAT[$target]}:"; ls -l "$dest" + done + + # setup-java writes a settings.xml with the 'central' server credentials + # (mapped from the env vars below) and imports the GPG signing key. + - name: Set up JDK 22 + Maven Central credentials + GPG + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 + with: + distribution: temurin + java-version: "22" + server-id: central + server-username: CENTRAL_USERNAME + server-password: CENTRAL_PASSWORD + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Deploy to Maven Central + env: + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: mvn -B -f bindings/java -Prelease deploy -DskipTests + github-release: name: Attach assets to the draft GitHub Release needs: [cargo-publish, python-publish, node-publish, wasm-publish, c-abi-build] diff --git a/.github/workflows/sync-about.yml b/.github/workflows/sync-about.yml index 773601ca..d16aa542 100644 --- a/.github/workflows/sync-about.yml +++ b/.github/workflows/sync-about.yml @@ -156,7 +156,7 @@ jobs: # actually live (Cloudflare Pages, P8.1); merging this PR is therefore # gated on the domain resolving, otherwise the About link would 404. homepage="https://docs.wickra.org" - desc="Streaming-first technical indicators with a Rust core and Python, Node.js, WebAssembly, C ABI, .NET, Go, and R bindings. ${n} indicators, O(1) per-tick updates, no system dependencies. Drop-in TA-Lib replacement." + desc="Streaming-first technical indicators with a Rust core and Python, Node.js, WebAssembly, C ABI, .NET, Go, Java, and R bindings. ${n} indicators, O(1) per-tick updates, no system dependencies. Drop-in TA-Lib replacement." # Enforce the homepage unconditionally — it is a constant, so this both # corrects the stale kingchenc URL and self-heals any future drift. # Same Administration-write permission as --description (no extra scope). diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index bcb89a0b..eb0bcb8f 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -46,9 +46,9 @@ wasm-bindgen). The C ABI is the *hub* every other C-capable language links against: it builds to a `cdylib`/`staticlib` plus a generated `wickra.h`, and downstream languages link that one artifact rather than each re-wrapping the core. C and C++ link it directly; the **C# / .NET** binding (`bindings/csharp`, -on NuGet), the **Go** binding (`bindings/go`, cgo) and the **R** binding -(`bindings/r`, `.Call`) are generated from `wickra.h`, with Java planned the -same way. +on NuGet), the **Go** binding (`bindings/go`, cgo), the **R** binding +(`bindings/r`, `.Call`) and the **Java** binding (`bindings/java`, the Java FFM +API / Panama, on Maven Central) are all generated from `wickra.h`. | Crate | Path | What it owns | Public deps | |---|---|---|---| diff --git a/CHANGELOG.md b/CHANGELOG.md index 320468e9..4350eaee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to Wickra are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- **Java binding (`bindings/java`)** — a Java binding reaching the C ABI hub + through the Java Foreign Function & Memory API (Panama, `java.lang.foreign`, + final in Java 22) rather than JNI or jextract, exposing all 514 indicators as + idiomatic `AutoCloseable` classes. The downcall handles, per-indicator + wrappers and output records are generated from `wickra.h`; the opaque handle is + a `MemorySegment` freed by a `java.lang.ref.Cleaner` action. Ships a full + example suite mirroring the C, C#, Go and R examples; published to Maven + Central as `org.wickra:wickra`. + ## [0.7.8] - 2026-06-09 ### Added - **R binding (`bindings/r`)** — an R package reaching the C ABI hub through R's diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4dca468b..a643faec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,7 @@ licensed as above, without any additional terms or conditions. | `bindings/csharp` | .NET binding over the C ABI (`Wickra` on NuGet) — `[LibraryImport]` P/Invoke generated from `wickra.h`. | | `bindings/go` | Go binding over the C ABI via cgo (module tag `bindings/go/vX.Y.Z`) — wrappers generated from `wickra.h`. | | `bindings/r` | R binding over the C ABI via `.Call` (R package) — C glue + R wrappers generated from `wickra.h`. | +| `bindings/java` | Java binding over the C ABI via the FFM API (Panama, Maven Central) — wrappers generated from `wickra.h`. | | `examples/` | Runnable examples. | | `docs/` | Pointer to the documentation site (docs.wickra.org); the docs live in the `wickra-lib/wickra-docs` repo. | @@ -113,7 +114,9 @@ installed. Dependabot also keeps the `.github/requirements` pins current. The Go binding (`bindings/go`) is likewise generated from `wickra.h`, so regenerate and commit `indicators_gen.go` (`gofmt`-clean). The R binding (`bindings/r`) is generated from `wickra.h` too, so regenerate and commit - `src/wickra.c` + `R/indicators.R`. + `src/wickra.c` + `R/indicators.R`. The Java binding (`bindings/java`) is + generated from `wickra.h` as well, so regenerate and commit its + `src/main/java/org/wickra/*.java`. - **Docs.** Update the relevant page on the [documentation site](https://docs.wickra.org) and the `README.md` when behaviour or the public API changes. The docs live in diff --git a/README.md b/README.md index e148de7e..0e15df83 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Wickra is a multi-language technical-analysis library with a Rust core and native bindings for Python, Node.js and WebAssembly, plus a C ABI that C, C++, -C# / .NET, Go, R and any other C-capable language links against. Every indicator is a +C# / .NET, Go, Java, R and any other C-capable language links against. Every indicator is a state machine that updates in O(1) per new data point, so live trading bots and historical backtests share the exact same implementation. @@ -78,7 +78,7 @@ times to get there. metrics — every single one updating in **O(1) per tick**. TA-Lib ships ~150 and none of them stream. - **One Rust core, five first-class targets.** Native **Python · Node.js · - WebAssembly · Rust** plus a **C ABI** for C / C++, C# / .NET, Go, R and any other C-capable language — + WebAssembly · Rust** plus a **C ABI** for C / C++, C# / .NET, Go, Java, R and any other C-capable language — identical math, identical results, zero per-language reimplementation and zero GIL bottleneck. - **Correct by construction, not by hope.** Every `update` validates its input, @@ -103,7 +103,7 @@ Every other library forces one of those compromises. Wickra doesn't: | Library | Install | Streaming | Languages | Indicators | Active | |------------------|-------------|-------------|-----------------------------|-----------:|--------| | **★ Wickra**| **clean** | **yes, O(1)** | **Rust · Python · Node · WASM** | **514** | **yes** | -| | | | **C · C# · Go · R** | | | +| | | | **C · C# · Go · Java · R** | | | | kand | clean | yes | Python · WASM · Rust | ~60 | yes | | ta-rs | clean | yes | Rust only | ~30 | stale | | yata | clean | partial | Rust only | ~35 | yes | @@ -175,7 +175,7 @@ construct it in signed mode (`Doji::new().signed()`, `Doji(signed=True)`, `new Doji(true)`) for a dragonfly / gravestone `±1` reading. Adding a new indicator means implementing one trait in Rust; every binding -inherits it automatically (the C ABI — and the C#, Go and R bindings generated from +inherits it automatically (the C ABI — and the C#, Go, Java and R bindings generated from it — regenerate from the core). ## Languages @@ -189,6 +189,7 @@ it — regenerate from the core). | C / C++ (C ABI) | header + library, see [`bindings/c`](bindings/c) | `examples/c/streaming.c` | | C# / .NET (C ABI) | `dotnet add package Wickra`, see [`bindings/csharp`](bindings/csharp) | `examples/csharp/streaming` | | Go (cgo, C ABI) | `go get github.com/wickra-lib/wickra/bindings/go`, see [`bindings/go`](bindings/go) | `examples/go/streaming` | +| Java (FFM, C ABI) | Maven Central `org.wickra:wickra`, see [`bindings/java`](bindings/java) | `examples/java` (`Streaming`) | | R (`.Call`, C ABI) | `R CMD INSTALL bindings/r`, see [`bindings/r`](bindings/r) | `examples/r/streaming.R` | Each binding ships several runnable examples (streaming, backtest, live feed); @@ -262,7 +263,8 @@ wickra/ │ ├── c/ C ABI (cdylib + staticlib) + generated include/wickra.h │ ├── csharp/ .NET binding over the C ABI (publishes on NuGet) │ ├── go/ Go binding over the C ABI via cgo (module tag) -│ └── r/ R binding over the C ABI via .Call (R package) +│ ├── r/ R binding over the C ABI via .Call (R package) +│ └── java/ Java binding over the C ABI via the FFM API (Maven Central) ├── examples/ examples/README.md indexes every language │ ├── data/ real BTCUSDT OHLCV datasets, one per timeframe │ ├── rust/ Rust workspace member (`wickra-examples`) @@ -272,7 +274,8 @@ wickra/ │ ├── c/ C smoke + streaming, C++ RAII wrapper │ ├── csharp/ streaming, backtest, strategies (load `Wickra`) │ ├── go/ streaming, backtest, strategies (cgo binding) -│ └── r/ streaming, backtest, strategies (.Call binding) +│ ├── r/ streaming, backtest, strategies (.Call binding) +│ └── java/ streaming, backtest, strategies (FFM binding) └── .github/workflows/ CI and release pipelines ``` @@ -316,6 +319,9 @@ cd bindings/go && go test ./... # R binding (requires a C toolchain / Rtools; links the C ABI above) WICKRA_INCLUDE_DIR="$PWD/bindings/c/include" WICKRA_LIB_DIR="$PWD/target/release" \ R CMD INSTALL bindings/r + +# Java binding (requires JDK 22+ and Maven; links the C ABI above) +mvn -f bindings/java test ``` ## Testing @@ -339,6 +345,8 @@ Every layer is covered; run the suites with the commands in (scalar/batch, multi-output, bars, profile, array input), reset, and lifecycle. - `bindings/r`: `testthat` cases covering one indicator per FFI archetype (scalar/batch, multi-output, bars, profile, array input), reset, and validation. +- `bindings/java`: JUnit cases covering one indicator per FFI archetype + (scalar/batch, multi-output, bars, profile, array input) plus batch equivalence. ## Contributing diff --git a/ROADMAP.md b/ROADMAP.md index d90ae7b5..ba0a7524 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -22,7 +22,7 @@ minor releases; breaking changes are called out in the changelog. - **Performance.** Keep per-tick updates O(1) and maintain the benchmark suite; investigate further allocation and cache improvements. - **Bindings parity.** Keep the Python, Node.js and WebAssembly bindings — plus - the C ABI and the C# / .NET, Go and R bindings generated from it — in lockstep with the + the C ABI and the C# / .NET, Go, Java and R bindings generated from it — in lockstep with the Rust core, including type stubs and platform coverage. - **Documentation.** Maintain a deep-dive page per indicator on , plus quickstarts and cookbook material. diff --git a/SUPPORT.md b/SUPPORT.md index 8209c3a4..43da8d4d 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -7,7 +7,7 @@ Thanks for using Wickra! Here is where to get help, depending on what you need. Most questions are answered in the documentation: - **Docs site:** — quickstarts for Rust, Python, - Node.js, WebAssembly, C, C#, Go and R, a per-indicator reference, warmup periods, the + Node.js, WebAssembly, C, C#, Go, Java and R, a per-indicator reference, warmup periods, the data layer, and an FAQ. - **README:** — installation and a quick overview. diff --git a/THREAT_MODEL.md b/THREAT_MODEL.md index 0cb2aeb5..29c93787 100644 --- a/THREAT_MODEL.md +++ b/THREAT_MODEL.md @@ -4,7 +4,7 @@ This document describes Wickra's attack surface and the threats considered, together with their mitigations. It complements the security assurance case in [`SECURITY.md`](SECURITY.md). Wickra is a computational technical-analysis library (a Rust core with Python, Node.js and WebAssembly bindings plus a C ABI -and the .NET, Go and R bindings built on it), +and the .NET, Go, Java and R bindings built on it), not a network service or trading system; the attack surface is correspondingly small. diff --git a/bindings/c/README.md b/bindings/c/README.md index c4e3ad1a..4c9904ff 100644 --- a/bindings/c/README.md +++ b/bindings/c/README.md @@ -9,7 +9,7 @@ library plus a generated `wickra.h` — no system dependencies.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R and any +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading bots and historical backtests share the exact same implementation. This package is the **C ABI hub**: it compiles the diff --git a/bindings/csharp/README.md b/bindings/csharp/README.md index 284780e3..c22b61f0 100644 --- a/bindings/csharp/README.md +++ b/bindings/csharp/README.md @@ -9,7 +9,7 @@ prebuilt native library, no system dependencies.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R and any +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading bots and historical backtests share the exact same implementation. This package is the .NET binding; it consumes the diff --git a/bindings/go/README.md b/bindings/go/README.md index d5f4e343..3ce730ea 100644 --- a/bindings/go/README.md +++ b/bindings/go/README.md @@ -8,7 +8,7 @@ **Streaming-first technical indicators for Go, over the Wickra C ABI hub via cgo.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go and +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading bots and historical backtests share the exact same implementation. This package is the Go binding; it consumes the C ABI hub through diff --git a/bindings/java/.gitignore b/bindings/java/.gitignore new file mode 100644 index 00000000..c1874eb5 --- /dev/null +++ b/bindings/java/.gitignore @@ -0,0 +1,6 @@ +# Maven build output +target/ + +# Native libraries staged for packaging (produced by the release pipeline from +# the wickra-c-.tar.gz assets; never committed to source). +src/main/resources/native/ diff --git a/bindings/java/README.md b/bindings/java/README.md new file mode 100644 index 00000000..33196609 --- /dev/null +++ b/bindings/java/README.md @@ -0,0 +1,102 @@ +# Wickra — Java + +[![CI](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml/badge.svg)](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/wickra-lib/wickra/branch/main/graph/badge.svg)](https://codecov.io/gh/wickra-lib/wickra) +[![Maven Central](https://img.shields.io/maven-central/v/org.wickra/wickra.svg?logo=apache-maven&color=blue)](https://central.sonatype.com/artifact/org.wickra/wickra) +[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue)](https://github.com/wickra-lib/wickra#license) + +**Streaming-first technical indicators for the JVM, on the Java Foreign Function +& Memory API — prebuilt native library, no JNI, no system dependencies.** + +Wickra is a multi-language technical-analysis library with a Rust core and +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R +and any other C-capable language. Every indicator is an O(1) streaming state +machine, so live trading bots and historical backtests share the exact same +implementation. This package is the Java binding; it consumes the C ABI hub +through the Panama FFM API (`java.lang.foreign`) and exposes all 514 +streaming-first indicators as idiomatic `AutoCloseable` classes. + +## Requirements + +- **Java 22 or later** (the FFM API is final since Java 22; no preview flag). +- The FFM API is *restricted*: pass `--enable-native-access=ALL-UNNAMED` when you + run your application to silence the native-access warning. + +## Install + +Maven: + +```xml + + org.wickra + wickra + 0.7.8 + +``` + +Gradle: + +```kotlin +implementation("org.wickra:wickra:0.7.8") +``` + +The native library ships prebuilt per platform (Linux, macOS, Windows — x64 and +arm64) inside the jar and is extracted automatically on first use. There is +nothing to compile. + +## Quick start + +```java +import org.wickra.Ema; +import org.wickra.Rsi; + +// Batch: run an indicator over a whole series (NaN at warmup positions). +double[] prices = new double[1000]; +for (int i = 0; i < prices.length; i++) { + prices[i] = 100.0 + i * 0.1; +} +try (Ema ema = new Ema(20)) { + double[] values = ema.batch(prices); +} + +// Streaming: the same indicator, fed tick by tick in O(1). +try (Rsi rsi = new Rsi(14)) { + for (double price : liveFeed) { + double value = rsi.update(price); // NaN during warmup, no recomputation + if (Double.isFinite(value) && value > 70) { + System.out.println("overbought"); + } + } +} +``` + +`batch(prices)` and feeding the same prices through `update()` produce identical +values — the equivalence is enforced by the test suite. Multi-output indicators +(MACD, Bollinger, ADX, …) return a `record`, `null` while warming up. Each +indicator owns a native handle freed by a `Cleaner`; `close()` releases it +eagerly (use try-with-resources). + +## Documentation + +The full indicator catalogue, guides, quickstarts, and API reference live in +the main repository and documentation site: + +- **Repository & full indicator list:** +- **Docs** (quickstarts, cookbook, TA-Lib migration): +- **Runnable examples:** [`examples/java/`](https://github.com/wickra-lib/wickra/tree/main/examples/java) + +Wickra ships native bindings for Python, Node.js, WebAssembly and Rust, plus a +C ABI hub that any C-capable language (C, C++, Go, C#, Java, R) links against — +all exposing the same indicators from the shared, `unsafe`-forbidden Rust core. + +## Disclaimer + +Wickra is an indicator toolkit, not a trading system. The values it computes +are deterministic transforms of the input data — they are not financial advice +and do not predict the market. Any use in a live trading context is at your own +risk. The library is provided **as is**, without warranty of any kind. + +## License + +Licensed under either of [Apache-2.0](https://github.com/wickra-lib/wickra/blob/main/LICENSE-APACHE) +or [MIT](https://github.com/wickra-lib/wickra/blob/main/LICENSE-MIT) at your option. diff --git a/bindings/java/pom.xml b/bindings/java/pom.xml new file mode 100644 index 00000000..3345fb87 --- /dev/null +++ b/bindings/java/pom.xml @@ -0,0 +1,171 @@ + + + 4.0.0 + + org.wickra + wickra + 0.7.8 + jar + + Wickra + High-performance streaming technical-analysis indicators (514 indicators) for the + JVM, backed by the native Rust core through the Wickra C ABI via the Java FFM API (Panama). + https://github.com/wickra-lib/wickra + + + + MIT + https://opensource.org/licenses/MIT + repo + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + + + + kingchenc + kingchenc + https://github.com/kingchenc + + + + + scm:git:https://github.com/wickra-lib/wickra.git + scm:git:https://github.com/wickra-lib/wickra.git + https://github.com/wickra-lib/wickra + + + + UTF-8 + 22 + 5.10.2 + + --enable-native-access=ALL-UNNAMED + + + + + org.junit.jupiter + junit-jupiter + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + ${native.access.arg} + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + + + + + ALL-UNNAMED + + + + + + + + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + 3.3.1 + + + attach-sources + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.7.0 + + + none + true + + + + attach-javadocs + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.2.4 + + + sign-artifacts + verify + sign + + + + --pinentry-mode + loopback + + + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.5.0 + true + + central + true + + + + + + + diff --git a/bindings/java/src/main/java/org/wickra/AbandonedBaby.java b/bindings/java/src/main/java/org/wickra/AbandonedBaby.java new file mode 100644 index 00000000..59e82fad --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AbandonedBaby.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AbandonedBaby indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AbandonedBaby implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AbandonedBaby() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ABANDONED_BABY_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AbandonedBaby parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ABANDONED_BABY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ABANDONED_BABY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ABANDONED_BABY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ABANDONED_BABY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Abcd.java b/bindings/java/src/main/java/org/wickra/Abcd.java new file mode 100644 index 00000000..0a2bcf75 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Abcd.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Abcd indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Abcd implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Abcd() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ABCD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Abcd parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ABCD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ABCD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ABCD_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ABCD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AbsoluteBreadthIndex.java b/bindings/java/src/main/java/org/wickra/AbsoluteBreadthIndex.java new file mode 100644 index 00000000..a278db6e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AbsoluteBreadthIndex.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AbsoluteBreadthIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AbsoluteBreadthIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AbsoluteBreadthIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ABSOLUTE_BREADTH_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AbsoluteBreadthIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ABSOLUTE_BREADTH_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_ABSOLUTE_BREADTH_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ABSOLUTE_BREADTH_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AccelerationBands.java b/bindings/java/src/main/java/org/wickra/AccelerationBands.java new file mode 100644 index 00000000..27a744d4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AccelerationBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AccelerationBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AccelerationBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AccelerationBands(int period, double factor) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ACCELERATION_BANDS_NEW.invokeExact((long) period, factor); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AccelerationBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ACCELERATION_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AccelerationBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ACCELERATION_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AccelerationBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ACCELERATION_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AccelerationBandsOutput.java b/bindings/java/src/main/java/org/wickra/AccelerationBandsOutput.java new file mode 100644 index 00000000..6b97bb3e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AccelerationBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AccelerationBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/AcceleratorOscillator.java b/bindings/java/src/main/java/org/wickra/AcceleratorOscillator.java new file mode 100644 index 00000000..e81dbed4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AcceleratorOscillator.java @@ -0,0 +1,95 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AcceleratorOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AcceleratorOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AcceleratorOscillator(int aoFast, int aoSlow, int signalPeriod) { + if (aoFast < 0) { + throw new IllegalArgumentException("aoFast must be non-negative"); + } + if (aoSlow < 0) { + throw new IllegalArgumentException("aoSlow must be non-negative"); + } + if (signalPeriod < 0) { + throw new IllegalArgumentException("signalPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ACCELERATOR_OSCILLATOR_NEW.invokeExact((long) aoFast, (long) aoSlow, (long) signalPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AcceleratorOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ACCELERATOR_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ACCELERATOR_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ACCELERATOR_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ACCELERATOR_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdOscillator.java b/bindings/java/src/main/java/org/wickra/AdOscillator.java new file mode 100644 index 00000000..3696903b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdOscillator.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdOscillator() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AD_OSCILLATOR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AD_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AD_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AD_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AD_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdVolumeLine.java b/bindings/java/src/main/java/org/wickra/AdVolumeLine.java new file mode 100644 index 00000000..b1e38cbb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdVolumeLine.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdVolumeLine indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdVolumeLine implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdVolumeLine() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AD_VOLUME_LINE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdVolumeLine parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AD_VOLUME_LINE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_AD_VOLUME_LINE_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AD_VOLUME_LINE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdaptiveCci.java b/bindings/java/src/main/java/org/wickra/AdaptiveCci.java new file mode 100644 index 00000000..869677b8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdaptiveCci.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdaptiveCci indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdaptiveCci implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdaptiveCci(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADAPTIVE_CCI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdaptiveCci parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADAPTIVE_CCI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ADAPTIVE_CCI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADAPTIVE_CCI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADAPTIVE_CCI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdaptiveCycle.java b/bindings/java/src/main/java/org/wickra/AdaptiveCycle.java new file mode 100644 index 00000000..ca027324 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdaptiveCycle.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdaptiveCycle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdaptiveCycle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdaptiveCycle() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADAPTIVE_CYCLE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdaptiveCycle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADAPTIVE_CYCLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ADAPTIVE_CYCLE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADAPTIVE_CYCLE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADAPTIVE_CYCLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdaptiveLaguerreFilter.java b/bindings/java/src/main/java/org/wickra/AdaptiveLaguerreFilter.java new file mode 100644 index 00000000..56d30a50 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdaptiveLaguerreFilter.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdaptiveLaguerreFilter indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdaptiveLaguerreFilter implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdaptiveLaguerreFilter(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADAPTIVE_LAGUERRE_FILTER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdaptiveLaguerreFilter parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADAPTIVE_LAGUERRE_FILTER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ADAPTIVE_LAGUERRE_FILTER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADAPTIVE_LAGUERRE_FILTER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADAPTIVE_LAGUERRE_FILTER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdaptiveRsi.java b/bindings/java/src/main/java/org/wickra/AdaptiveRsi.java new file mode 100644 index 00000000..56642fb3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdaptiveRsi.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdaptiveRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdaptiveRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdaptiveRsi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADAPTIVE_RSI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdaptiveRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADAPTIVE_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ADAPTIVE_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADAPTIVE_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADAPTIVE_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Adl.java b/bindings/java/src/main/java/org/wickra/Adl.java new file mode 100644 index 00000000..11dcc550 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Adl.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Adl indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Adl implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Adl() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADL_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Adl parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ADL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADL_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdvanceBlock.java b/bindings/java/src/main/java/org/wickra/AdvanceBlock.java new file mode 100644 index 00000000..b4d10d87 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdvanceBlock.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdvanceBlock indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdvanceBlock implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdvanceBlock() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADVANCE_BLOCK_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdvanceBlock parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADVANCE_BLOCK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ADVANCE_BLOCK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADVANCE_BLOCK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADVANCE_BLOCK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdvanceDecline.java b/bindings/java/src/main/java/org/wickra/AdvanceDecline.java new file mode 100644 index 00000000..55d06086 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdvanceDecline.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdvanceDecline indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdvanceDecline implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdvanceDecline() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADVANCE_DECLINE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdvanceDecline parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADVANCE_DECLINE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_ADVANCE_DECLINE_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADVANCE_DECLINE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdvanceDeclineRatio.java b/bindings/java/src/main/java/org/wickra/AdvanceDeclineRatio.java new file mode 100644 index 00000000..66f9a427 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdvanceDeclineRatio.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AdvanceDeclineRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AdvanceDeclineRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AdvanceDeclineRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADVANCE_DECLINE_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AdvanceDeclineRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADVANCE_DECLINE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_ADVANCE_DECLINE_RATIO_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADVANCE_DECLINE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Adx.java b/bindings/java/src/main/java/org/wickra/Adx.java new file mode 100644 index 00000000..f1230e86 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Adx.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Adx indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Adx implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Adx(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Adx parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADX_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AdxOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ADX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AdxOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AdxOutput.java b/bindings/java/src/main/java/org/wickra/AdxOutput.java new file mode 100644 index 00000000..054fe5c7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AdxOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AdxOutput(double plusDi, double minusDi, double adx) {} diff --git a/bindings/java/src/main/java/org/wickra/Adxr.java b/bindings/java/src/main/java/org/wickra/Adxr.java new file mode 100644 index 00000000..5f5fc188 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Adxr.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Adxr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Adxr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Adxr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ADXR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Adxr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ADXR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ADXR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ADXR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ADXR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Alligator.java b/bindings/java/src/main/java/org/wickra/Alligator.java new file mode 100644 index 00000000..9d6c774e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Alligator.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Alligator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Alligator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Alligator(int jawPeriod, int teethPeriod, int lipsPeriod) { + if (jawPeriod < 0) { + throw new IllegalArgumentException("jawPeriod must be non-negative"); + } + if (teethPeriod < 0) { + throw new IllegalArgumentException("teethPeriod must be non-negative"); + } + if (lipsPeriod < 0) { + throw new IllegalArgumentException("lipsPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ALLIGATOR_NEW.invokeExact((long) jawPeriod, (long) teethPeriod, (long) lipsPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Alligator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ALLIGATOR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AlligatorOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ALLIGATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AlligatorOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ALLIGATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AlligatorOutput.java b/bindings/java/src/main/java/org/wickra/AlligatorOutput.java new file mode 100644 index 00000000..4b6b79f4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AlligatorOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AlligatorOutput(double jaw, double teeth, double lips) {} diff --git a/bindings/java/src/main/java/org/wickra/Alma.java b/bindings/java/src/main/java/org/wickra/Alma.java new file mode 100644 index 00000000..81335416 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Alma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Alma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Alma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Alma(int period, double offset, double sigma) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ALMA_NEW.invokeExact((long) period, offset, sigma); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Alma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ALMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ALMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ALMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ALMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Alpha.java b/bindings/java/src/main/java/org/wickra/Alpha.java new file mode 100644 index 00000000..d825df29 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Alpha.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Alpha indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Alpha implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Alpha(int period, double riskFree) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ALPHA_NEW.invokeExact((long) period, riskFree); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Alpha parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ALPHA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_ALPHA_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ALPHA_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ALPHA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AmihudIlliquidity.java b/bindings/java/src/main/java/org/wickra/AmihudIlliquidity.java new file mode 100644 index 00000000..9e2c12f0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AmihudIlliquidity.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AmihudIlliquidity indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AmihudIlliquidity implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AmihudIlliquidity(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AMIHUD_ILLIQUIDITY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AmihudIlliquidity parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AMIHUD_ILLIQUIDITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AMIHUD_ILLIQUIDITY_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AMIHUD_ILLIQUIDITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AnchoredRsi.java b/bindings/java/src/main/java/org/wickra/AnchoredRsi.java new file mode 100644 index 00000000..ba9b2cec --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AnchoredRsi.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AnchoredRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AnchoredRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AnchoredRsi() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ANCHORED_RSI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AnchoredRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ANCHORED_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ANCHORED_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ANCHORED_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ANCHORED_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AnchoredVwap.java b/bindings/java/src/main/java/org/wickra/AnchoredVwap.java new file mode 100644 index 00000000..dd6dd3f3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AnchoredVwap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AnchoredVwap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AnchoredVwap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AnchoredVwap() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ANCHORED_VWAP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AnchoredVwap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ANCHORED_VWAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ANCHORED_VWAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ANCHORED_VWAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ANCHORED_VWAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AndrewsPitchfork.java b/bindings/java/src/main/java/org/wickra/AndrewsPitchfork.java new file mode 100644 index 00000000..c03d77ec --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AndrewsPitchfork.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AndrewsPitchfork indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AndrewsPitchfork implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AndrewsPitchfork(int strength) { + if (strength < 0) { + throw new IllegalArgumentException("strength must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ANDREWS_PITCHFORK_NEW.invokeExact((long) strength); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AndrewsPitchfork parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ANDREWS_PITCHFORK_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AndrewsPitchforkOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ANDREWS_PITCHFORK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AndrewsPitchforkOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ANDREWS_PITCHFORK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AndrewsPitchforkOutput.java b/bindings/java/src/main/java/org/wickra/AndrewsPitchforkOutput.java new file mode 100644 index 00000000..ef57f06c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AndrewsPitchforkOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AndrewsPitchforkOutput(double median, double upper, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/Apo.java b/bindings/java/src/main/java/org/wickra/Apo.java new file mode 100644 index 00000000..fc15dd0f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Apo.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Apo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Apo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Apo(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_APO_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Apo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_APO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_APO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_APO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_APO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Aroon.java b/bindings/java/src/main/java/org/wickra/Aroon.java new file mode 100644 index 00000000..aaa7be1f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Aroon.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Aroon indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Aroon implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Aroon(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AROON_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Aroon parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AROON_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AroonOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_AROON_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AroonOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AROON_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AroonOscillator.java b/bindings/java/src/main/java/org/wickra/AroonOscillator.java new file mode 100644 index 00000000..202a3055 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AroonOscillator.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AroonOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AroonOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AroonOscillator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AROON_OSCILLATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AroonOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AROON_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AROON_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AROON_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AROON_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AroonOutput.java b/bindings/java/src/main/java/org/wickra/AroonOutput.java new file mode 100644 index 00000000..e317f8aa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AroonOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AroonOutput(double up, double down) {} diff --git a/bindings/java/src/main/java/org/wickra/Atr.java b/bindings/java/src/main/java/org/wickra/Atr.java new file mode 100644 index 00000000..770b4e3d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Atr.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Atr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Atr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Atr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ATR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Atr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ATR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ATR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ATR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ATR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AtrBands.java b/bindings/java/src/main/java/org/wickra/AtrBands.java new file mode 100644 index 00000000..b9a9b28a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AtrBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AtrBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AtrBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AtrBands(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ATR_BANDS_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AtrBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ATR_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AtrBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ATR_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AtrBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ATR_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AtrBandsOutput.java b/bindings/java/src/main/java/org/wickra/AtrBandsOutput.java new file mode 100644 index 00000000..9a3849e9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AtrBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AtrBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/AtrRatchet.java b/bindings/java/src/main/java/org/wickra/AtrRatchet.java new file mode 100644 index 00000000..c86beb08 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AtrRatchet.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AtrRatchet indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AtrRatchet implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AtrRatchet(int atrPeriod, double startMult, double increment) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ATR_RATCHET_NEW.invokeExact((long) atrPeriod, startMult, increment); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AtrRatchet parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ATR_RATCHET_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AtrRatchetOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_ATR_RATCHET_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AtrRatchetOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ATR_RATCHET_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AtrRatchetOutput.java b/bindings/java/src/main/java/org/wickra/AtrRatchetOutput.java new file mode 100644 index 00000000..1c86f157 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AtrRatchetOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AtrRatchetOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/AtrTrailingStop.java b/bindings/java/src/main/java/org/wickra/AtrTrailingStop.java new file mode 100644 index 00000000..9edf6628 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AtrTrailingStop.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AtrTrailingStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AtrTrailingStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AtrTrailingStop(int atrPeriod, double multiplier) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ATR_TRAILING_STOP_NEW.invokeExact((long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AtrTrailingStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ATR_TRAILING_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ATR_TRAILING_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ATR_TRAILING_STOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ATR_TRAILING_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AutoFib.java b/bindings/java/src/main/java/org/wickra/AutoFib.java new file mode 100644 index 00000000..b1292d14 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AutoFib.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AutoFib indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AutoFib implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AutoFib() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AUTO_FIB_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AutoFib parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AUTO_FIB_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public AutoFibOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(56L); + byte ok = (byte) NativeMethods.WICKRA_AUTO_FIB_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new AutoFibOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AUTO_FIB_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AutoFibOutput.java b/bindings/java/src/main/java/org/wickra/AutoFibOutput.java new file mode 100644 index 00000000..697e44a0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AutoFibOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record AutoFibOutput(double level0, double level236, double level382, double level500, double level618, double level786, double level1000) {} diff --git a/bindings/java/src/main/java/org/wickra/Autocorrelation.java b/bindings/java/src/main/java/org/wickra/Autocorrelation.java new file mode 100644 index 00000000..2677acfa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Autocorrelation.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Autocorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Autocorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Autocorrelation(int period, int lag) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (lag < 0) { + throw new IllegalArgumentException("lag must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AUTOCORRELATION_NEW.invokeExact((long) period, (long) lag); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Autocorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AUTOCORRELATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_AUTOCORRELATION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AUTOCORRELATION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AUTOCORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AutocorrelationPeriodogram.java b/bindings/java/src/main/java/org/wickra/AutocorrelationPeriodogram.java new file mode 100644 index 00000000..4a6cbe6b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AutocorrelationPeriodogram.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AutocorrelationPeriodogram indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AutocorrelationPeriodogram implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AutocorrelationPeriodogram(int minPeriod, int maxPeriod) { + if (minPeriod < 0) { + throw new IllegalArgumentException("minPeriod must be non-negative"); + } + if (maxPeriod < 0) { + throw new IllegalArgumentException("maxPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AUTOCORRELATION_PERIODOGRAM_NEW.invokeExact((long) minPeriod, (long) maxPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AutocorrelationPeriodogram parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AUTOCORRELATION_PERIODOGRAM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_AUTOCORRELATION_PERIODOGRAM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AUTOCORRELATION_PERIODOGRAM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AUTOCORRELATION_PERIODOGRAM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AverageDailyRange.java b/bindings/java/src/main/java/org/wickra/AverageDailyRange.java new file mode 100644 index 00000000..19a87174 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AverageDailyRange.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AverageDailyRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AverageDailyRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AverageDailyRange(int period, int utcOffsetMinutes) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AVERAGE_DAILY_RANGE_NEW.invokeExact((long) period, utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AverageDailyRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AVERAGE_DAILY_RANGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AVERAGE_DAILY_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AVERAGE_DAILY_RANGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AVERAGE_DAILY_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AverageDrawdown.java b/bindings/java/src/main/java/org/wickra/AverageDrawdown.java new file mode 100644 index 00000000..a42111a7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AverageDrawdown.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AverageDrawdown indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AverageDrawdown implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AverageDrawdown(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AVERAGE_DRAWDOWN_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AverageDrawdown parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AVERAGE_DRAWDOWN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_AVERAGE_DRAWDOWN_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AVERAGE_DRAWDOWN_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AVERAGE_DRAWDOWN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AvgPrice.java b/bindings/java/src/main/java/org/wickra/AvgPrice.java new file mode 100644 index 00000000..323737df --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AvgPrice.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AvgPrice indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AvgPrice implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AvgPrice() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AVG_PRICE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AvgPrice parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AVG_PRICE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AVG_PRICE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AVG_PRICE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AVG_PRICE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AwesomeOscillator.java b/bindings/java/src/main/java/org/wickra/AwesomeOscillator.java new file mode 100644 index 00000000..a072d34d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AwesomeOscillator.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AwesomeOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AwesomeOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AwesomeOscillator(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AWESOME_OSCILLATOR_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AwesomeOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AWESOME_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AWESOME_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AWESOME_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AWESOME_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/AwesomeOscillatorHistogram.java b/bindings/java/src/main/java/org/wickra/AwesomeOscillatorHistogram.java new file mode 100644 index 00000000..cf811c27 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/AwesomeOscillatorHistogram.java @@ -0,0 +1,95 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming AwesomeOscillatorHistogram indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class AwesomeOscillatorHistogram implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public AwesomeOscillatorHistogram(int fast, int slow, int smaPeriod) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (smaPeriod < 0) { + throw new IllegalArgumentException("smaPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_NEW.invokeExact((long) fast, (long) slow, (long) smaPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid AwesomeOscillatorHistogram parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BalanceOfPower.java b/bindings/java/src/main/java/org/wickra/BalanceOfPower.java new file mode 100644 index 00000000..580bf41f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BalanceOfPower.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BalanceOfPower indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BalanceOfPower implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BalanceOfPower() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BALANCE_OF_POWER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BalanceOfPower parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BALANCE_OF_POWER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BALANCE_OF_POWER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BALANCE_OF_POWER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BALANCE_OF_POWER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BandpassFilter.java b/bindings/java/src/main/java/org/wickra/BandpassFilter.java new file mode 100644 index 00000000..8cc9ed79 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BandpassFilter.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BandpassFilter indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BandpassFilter implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BandpassFilter(int period, double bandwidth) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BANDPASS_FILTER_NEW.invokeExact((long) period, bandwidth); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BandpassFilter parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BANDPASS_FILTER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_BANDPASS_FILTER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BANDPASS_FILTER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BANDPASS_FILTER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Bat.java b/bindings/java/src/main/java/org/wickra/Bat.java new file mode 100644 index 00000000..a07687c0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Bat.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Bat indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Bat implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Bat() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BAT_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Bat parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BAT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BAT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BAT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BAT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BeltHold.java b/bindings/java/src/main/java/org/wickra/BeltHold.java new file mode 100644 index 00000000..861f660b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BeltHold.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BeltHold indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BeltHold implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BeltHold() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BELT_HOLD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BeltHold parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BELT_HOLD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BELT_HOLD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BELT_HOLD_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BELT_HOLD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Beta.java b/bindings/java/src/main/java/org/wickra/Beta.java new file mode 100644 index 00000000..4c8e94d5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Beta.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Beta indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Beta implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Beta(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BETA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Beta parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BETA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_BETA_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BETA_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BETA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BetaNeutralSpread.java b/bindings/java/src/main/java/org/wickra/BetaNeutralSpread.java new file mode 100644 index 00000000..bb55f7e3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BetaNeutralSpread.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BetaNeutralSpread indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BetaNeutralSpread implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BetaNeutralSpread(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BETA_NEUTRAL_SPREAD_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BetaNeutralSpread parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BETA_NEUTRAL_SPREAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_BETA_NEUTRAL_SPREAD_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BETA_NEUTRAL_SPREAD_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BETA_NEUTRAL_SPREAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BetterVolume.java b/bindings/java/src/main/java/org/wickra/BetterVolume.java new file mode 100644 index 00000000..f4207209 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BetterVolume.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BetterVolume indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BetterVolume implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BetterVolume(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BETTER_VOLUME_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BetterVolume parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BETTER_VOLUME_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BETTER_VOLUME_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BETTER_VOLUME_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BETTER_VOLUME_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BipowerVariation.java b/bindings/java/src/main/java/org/wickra/BipowerVariation.java new file mode 100644 index 00000000..d20d9b7d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BipowerVariation.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BipowerVariation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BipowerVariation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BipowerVariation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BIPOWER_VARIATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BipowerVariation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BIPOWER_VARIATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_BIPOWER_VARIATION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BIPOWER_VARIATION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BIPOWER_VARIATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BodySizePct.java b/bindings/java/src/main/java/org/wickra/BodySizePct.java new file mode 100644 index 00000000..7e523686 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BodySizePct.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BodySizePct indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BodySizePct implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BodySizePct() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BODY_SIZE_PCT_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BodySizePct parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BODY_SIZE_PCT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BODY_SIZE_PCT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BODY_SIZE_PCT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BODY_SIZE_PCT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BollingerBands.java b/bindings/java/src/main/java/org/wickra/BollingerBands.java new file mode 100644 index 00000000..4513d129 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BollingerBands.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BollingerBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BollingerBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BollingerBands(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BOLLINGER_BANDS_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BollingerBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BOLLINGER_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public BollingerOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_BOLLINGER_BANDS_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new BollingerOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BOLLINGER_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BollingerBandwidth.java b/bindings/java/src/main/java/org/wickra/BollingerBandwidth.java new file mode 100644 index 00000000..8f1ab6c2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BollingerBandwidth.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BollingerBandwidth indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BollingerBandwidth implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BollingerBandwidth(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BOLLINGER_BANDWIDTH_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BollingerBandwidth parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BOLLINGER_BANDWIDTH_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_BOLLINGER_BANDWIDTH_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BOLLINGER_BANDWIDTH_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BOLLINGER_BANDWIDTH_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BollingerOutput.java b/bindings/java/src/main/java/org/wickra/BollingerOutput.java new file mode 100644 index 00000000..3ac86cf6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BollingerOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record BollingerOutput(double upper, double middle, double lower, double stddev) {} diff --git a/bindings/java/src/main/java/org/wickra/BomarBands.java b/bindings/java/src/main/java/org/wickra/BomarBands.java new file mode 100644 index 00000000..8aa6bb6a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BomarBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BomarBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BomarBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BomarBands(int period, double coverage) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BOMAR_BANDS_NEW.invokeExact((long) period, coverage); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BomarBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BOMAR_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public BomarBandsOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_BOMAR_BANDS_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new BomarBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BOMAR_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BomarBandsOutput.java b/bindings/java/src/main/java/org/wickra/BomarBandsOutput.java new file mode 100644 index 00000000..3c217bcb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BomarBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record BomarBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/BreadthThrust.java b/bindings/java/src/main/java/org/wickra/BreadthThrust.java new file mode 100644 index 00000000..b11c6738 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BreadthThrust.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BreadthThrust indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BreadthThrust implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BreadthThrust(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BREADTH_THRUST_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BreadthThrust parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BREADTH_THRUST_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_BREADTH_THRUST_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BREADTH_THRUST_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Breakaway.java b/bindings/java/src/main/java/org/wickra/Breakaway.java new file mode 100644 index 00000000..938c1a8b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Breakaway.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Breakaway indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Breakaway implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Breakaway() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BREAKAWAY_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Breakaway parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BREAKAWAY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BREAKAWAY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BREAKAWAY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BREAKAWAY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BullishPercentIndex.java b/bindings/java/src/main/java/org/wickra/BullishPercentIndex.java new file mode 100644 index 00000000..24de5dc5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BullishPercentIndex.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BullishPercentIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BullishPercentIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BullishPercentIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BULLISH_PERCENT_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BullishPercentIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BULLISH_PERCENT_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_BULLISH_PERCENT_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BULLISH_PERCENT_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/BurkeRatio.java b/bindings/java/src/main/java/org/wickra/BurkeRatio.java new file mode 100644 index 00000000..c1a74ad0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/BurkeRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming BurkeRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class BurkeRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public BurkeRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BURKE_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid BurkeRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BURKE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_BURKE_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BURKE_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BURKE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Butterfly.java b/bindings/java/src/main/java/org/wickra/Butterfly.java new file mode 100644 index 00000000..b04063ed --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Butterfly.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Butterfly indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Butterfly implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Butterfly() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_BUTTERFLY_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Butterfly parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_BUTTERFLY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_BUTTERFLY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_BUTTERFLY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_BUTTERFLY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CalendarSpread.java b/bindings/java/src/main/java/org/wickra/CalendarSpread.java new file mode 100644 index 00000000..57f21023 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CalendarSpread.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CalendarSpread indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CalendarSpread implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CalendarSpread() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CALENDAR_SPREAD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CalendarSpread parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CALENDAR_SPREAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CALENDAR_SPREAD_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CALENDAR_SPREAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CalmarRatio.java b/bindings/java/src/main/java/org/wickra/CalmarRatio.java new file mode 100644 index 00000000..76f7d548 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CalmarRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CalmarRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CalmarRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CalmarRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CALMAR_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CalmarRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CALMAR_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CALMAR_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CALMAR_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CALMAR_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Camarilla.java b/bindings/java/src/main/java/org/wickra/Camarilla.java new file mode 100644 index 00000000..106adb3f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Camarilla.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Camarilla indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Camarilla implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Camarilla() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CAMARILLA_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Camarilla parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CAMARILLA_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public CamarillaPivotsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(72L); + byte ok = (byte) NativeMethods.WICKRA_CAMARILLA_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new CamarillaPivotsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L), + out.get(JAVA_DOUBLE, 56L), + out.get(JAVA_DOUBLE, 64L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CAMARILLA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CamarillaPivotsOutput.java b/bindings/java/src/main/java/org/wickra/CamarillaPivotsOutput.java new file mode 100644 index 00000000..ab8d038e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CamarillaPivotsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record CamarillaPivotsOutput(double pp, double r1, double r2, double r3, double r4, double s1, double s2, double s3, double s4) {} diff --git a/bindings/java/src/main/java/org/wickra/CandleVolume.java b/bindings/java/src/main/java/org/wickra/CandleVolume.java new file mode 100644 index 00000000..c344a5bc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CandleVolume.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CandleVolume indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CandleVolume implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CandleVolume(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CANDLE_VOLUME_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CandleVolume parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CANDLE_VOLUME_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public CandleVolumeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_CANDLE_VOLUME_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new CandleVolumeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CANDLE_VOLUME_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CandleVolumeOutput.java b/bindings/java/src/main/java/org/wickra/CandleVolumeOutput.java new file mode 100644 index 00000000..b0684fe0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CandleVolumeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record CandleVolumeOutput(double body, double width) {} diff --git a/bindings/java/src/main/java/org/wickra/Cci.java b/bindings/java/src/main/java/org/wickra/Cci.java new file mode 100644 index 00000000..bf46cffa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Cci.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Cci indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Cci implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Cci(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CCI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Cci parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CCI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CCI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CCI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CCI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CenterOfGravity.java b/bindings/java/src/main/java/org/wickra/CenterOfGravity.java new file mode 100644 index 00000000..efe1e7b2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CenterOfGravity.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CenterOfGravity indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CenterOfGravity implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CenterOfGravity(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CENTER_OF_GRAVITY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CenterOfGravity parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CENTER_OF_GRAVITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CENTER_OF_GRAVITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CENTER_OF_GRAVITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CENTER_OF_GRAVITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CentralPivotRange.java b/bindings/java/src/main/java/org/wickra/CentralPivotRange.java new file mode 100644 index 00000000..39c1469e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CentralPivotRange.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CentralPivotRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CentralPivotRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CentralPivotRange() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CENTRAL_PIVOT_RANGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CentralPivotRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CENTRAL_PIVOT_RANGE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public CentralPivotRangeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_CENTRAL_PIVOT_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new CentralPivotRangeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CENTRAL_PIVOT_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CentralPivotRangeOutput.java b/bindings/java/src/main/java/org/wickra/CentralPivotRangeOutput.java new file mode 100644 index 00000000..da7cd338 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CentralPivotRangeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record CentralPivotRangeOutput(double pivot, double tc, double bc) {} diff --git a/bindings/java/src/main/java/org/wickra/Cfo.java b/bindings/java/src/main/java/org/wickra/Cfo.java new file mode 100644 index 00000000..3b923903 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Cfo.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Cfo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Cfo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Cfo(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CFO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Cfo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CFO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CFO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CFO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CFO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChaikinMoneyFlow.java b/bindings/java/src/main/java/org/wickra/ChaikinMoneyFlow.java new file mode 100644 index 00000000..fb70670c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChaikinMoneyFlow.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChaikinMoneyFlow indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChaikinMoneyFlow implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChaikinMoneyFlow(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHAIKIN_MONEY_FLOW_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChaikinMoneyFlow parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHAIKIN_MONEY_FLOW_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CHAIKIN_MONEY_FLOW_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CHAIKIN_MONEY_FLOW_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHAIKIN_MONEY_FLOW_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChaikinOscillator.java b/bindings/java/src/main/java/org/wickra/ChaikinOscillator.java new file mode 100644 index 00000000..596a5efb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChaikinOscillator.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChaikinOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChaikinOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChaikinOscillator(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHAIKIN_OSCILLATOR_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChaikinOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHAIKIN_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CHAIKIN_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CHAIKIN_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHAIKIN_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChaikinVolatility.java b/bindings/java/src/main/java/org/wickra/ChaikinVolatility.java new file mode 100644 index 00000000..70969d78 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChaikinVolatility.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChaikinVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChaikinVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChaikinVolatility(int emaPeriod, int rocPeriod) { + if (emaPeriod < 0) { + throw new IllegalArgumentException("emaPeriod must be non-negative"); + } + if (rocPeriod < 0) { + throw new IllegalArgumentException("rocPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHAIKIN_VOLATILITY_NEW.invokeExact((long) emaPeriod, (long) rocPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChaikinVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHAIKIN_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CHAIKIN_VOLATILITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CHAIKIN_VOLATILITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHAIKIN_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChandeKrollStop.java b/bindings/java/src/main/java/org/wickra/ChandeKrollStop.java new file mode 100644 index 00000000..0237bc05 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChandeKrollStop.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChandeKrollStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChandeKrollStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChandeKrollStop(int atrPeriod, double atrMultiplier, int stopPeriod) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + if (stopPeriod < 0) { + throw new IllegalArgumentException("stopPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHANDE_KROLL_STOP_NEW.invokeExact((long) atrPeriod, atrMultiplier, (long) stopPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChandeKrollStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHANDE_KROLL_STOP_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ChandeKrollStopOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_CHANDE_KROLL_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ChandeKrollStopOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHANDE_KROLL_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChandeKrollStopOutput.java b/bindings/java/src/main/java/org/wickra/ChandeKrollStopOutput.java new file mode 100644 index 00000000..d2e81e65 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChandeKrollStopOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ChandeKrollStopOutput(double stopLong, double stopShort) {} diff --git a/bindings/java/src/main/java/org/wickra/ChandelierExit.java b/bindings/java/src/main/java/org/wickra/ChandelierExit.java new file mode 100644 index 00000000..c928986f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChandelierExit.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChandelierExit indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChandelierExit implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChandelierExit(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHANDELIER_EXIT_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChandelierExit parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHANDELIER_EXIT_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ChandelierExitOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_CHANDELIER_EXIT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ChandelierExitOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHANDELIER_EXIT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ChandelierExitOutput.java b/bindings/java/src/main/java/org/wickra/ChandelierExitOutput.java new file mode 100644 index 00000000..661319c6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChandelierExitOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ChandelierExitOutput(double longStop, double shortStop) {} diff --git a/bindings/java/src/main/java/org/wickra/ChoppinessIndex.java b/bindings/java/src/main/java/org/wickra/ChoppinessIndex.java new file mode 100644 index 00000000..48febebb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ChoppinessIndex.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ChoppinessIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ChoppinessIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ChoppinessIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CHOPPINESS_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ChoppinessIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CHOPPINESS_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CHOPPINESS_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CHOPPINESS_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CHOPPINESS_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ClassicPivots.java b/bindings/java/src/main/java/org/wickra/ClassicPivots.java new file mode 100644 index 00000000..2343dad1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ClassicPivots.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ClassicPivots indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ClassicPivots implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ClassicPivots() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CLASSIC_PIVOTS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ClassicPivots parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CLASSIC_PIVOTS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ClassicPivotsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(56L); + byte ok = (byte) NativeMethods.WICKRA_CLASSIC_PIVOTS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ClassicPivotsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CLASSIC_PIVOTS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ClassicPivotsOutput.java b/bindings/java/src/main/java/org/wickra/ClassicPivotsOutput.java new file mode 100644 index 00000000..d937450e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ClassicPivotsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ClassicPivotsOutput(double pp, double r1, double r2, double r3, double s1, double s2, double s3) {} diff --git a/bindings/java/src/main/java/org/wickra/CloseVsOpen.java b/bindings/java/src/main/java/org/wickra/CloseVsOpen.java new file mode 100644 index 00000000..1fd833bb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CloseVsOpen.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CloseVsOpen indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CloseVsOpen implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CloseVsOpen() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CLOSE_VS_OPEN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CloseVsOpen parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CLOSE_VS_OPEN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CLOSE_VS_OPEN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CLOSE_VS_OPEN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CLOSE_VS_OPEN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ClosingMarubozu.java b/bindings/java/src/main/java/org/wickra/ClosingMarubozu.java new file mode 100644 index 00000000..c34fdde4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ClosingMarubozu.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ClosingMarubozu indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ClosingMarubozu implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ClosingMarubozu() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CLOSING_MARUBOZU_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ClosingMarubozu parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CLOSING_MARUBOZU_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CLOSING_MARUBOZU_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CLOSING_MARUBOZU_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CLOSING_MARUBOZU_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Cmo.java b/bindings/java/src/main/java/org/wickra/Cmo.java new file mode 100644 index 00000000..030f3bbc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Cmo.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Cmo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Cmo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Cmo(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CMO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Cmo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CMO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CMO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CMO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CMO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CoefficientOfVariation.java b/bindings/java/src/main/java/org/wickra/CoefficientOfVariation.java new file mode 100644 index 00000000..9980d8a0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CoefficientOfVariation.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CoefficientOfVariation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CoefficientOfVariation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CoefficientOfVariation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COEFFICIENT_OF_VARIATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CoefficientOfVariation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COEFFICIENT_OF_VARIATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_COEFFICIENT_OF_VARIATION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_COEFFICIENT_OF_VARIATION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COEFFICIENT_OF_VARIATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Cointegration.java b/bindings/java/src/main/java/org/wickra/Cointegration.java new file mode 100644 index 00000000..49045cd2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Cointegration.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Cointegration indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Cointegration implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Cointegration(int period, int adfLags) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (adfLags < 0) { + throw new IllegalArgumentException("adfLags must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COINTEGRATION_NEW.invokeExact((long) period, (long) adfLags); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Cointegration parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COINTEGRATION_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public CointegrationOutput update(double x, double y) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_COINTEGRATION_UPDATE.invokeExact(handle, x, y, out); + if (ok == 0) { + return null; + } + return new CointegrationOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COINTEGRATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CointegrationOutput.java b/bindings/java/src/main/java/org/wickra/CointegrationOutput.java new file mode 100644 index 00000000..794c804d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CointegrationOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record CointegrationOutput(double hedgeRatio, double spread, double adfStat) {} diff --git a/bindings/java/src/main/java/org/wickra/CommonSenseRatio.java b/bindings/java/src/main/java/org/wickra/CommonSenseRatio.java new file mode 100644 index 00000000..f03003cb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CommonSenseRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CommonSenseRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CommonSenseRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CommonSenseRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COMMON_SENSE_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CommonSenseRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COMMON_SENSE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_COMMON_SENSE_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_COMMON_SENSE_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COMMON_SENSE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CompositeProfile.java b/bindings/java/src/main/java/org/wickra/CompositeProfile.java new file mode 100644 index 00000000..d27b4e10 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CompositeProfile.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CompositeProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CompositeProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CompositeProfile(int period, int bins, double valueAreaPct) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COMPOSITE_PROFILE_NEW.invokeExact((long) period, (long) bins, valueAreaPct); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CompositeProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COMPOSITE_PROFILE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public CompositeProfileOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_COMPOSITE_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new CompositeProfileOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COMPOSITE_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CompositeProfileOutput.java b/bindings/java/src/main/java/org/wickra/CompositeProfileOutput.java new file mode 100644 index 00000000..d88b2a37 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CompositeProfileOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record CompositeProfileOutput(double poc, double vah, double val) {} diff --git a/bindings/java/src/main/java/org/wickra/ConcealingBabySwallow.java b/bindings/java/src/main/java/org/wickra/ConcealingBabySwallow.java new file mode 100644 index 00000000..957828a7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ConcealingBabySwallow.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ConcealingBabySwallow indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ConcealingBabySwallow implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ConcealingBabySwallow() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CONCEALING_BABY_SWALLOW_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ConcealingBabySwallow parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CONCEALING_BABY_SWALLOW_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CONCEALING_BABY_SWALLOW_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CONCEALING_BABY_SWALLOW_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CONCEALING_BABY_SWALLOW_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ConditionalValueAtRisk.java b/bindings/java/src/main/java/org/wickra/ConditionalValueAtRisk.java new file mode 100644 index 00000000..96859adc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ConditionalValueAtRisk.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ConditionalValueAtRisk indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ConditionalValueAtRisk implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ConditionalValueAtRisk(int period, double confidence) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CONDITIONAL_VALUE_AT_RISK_NEW.invokeExact((long) period, confidence); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ConditionalValueAtRisk parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CONDITIONAL_VALUE_AT_RISK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CONDITIONAL_VALUE_AT_RISK_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CONDITIONAL_VALUE_AT_RISK_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CONDITIONAL_VALUE_AT_RISK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ConnorsRsi.java b/bindings/java/src/main/java/org/wickra/ConnorsRsi.java new file mode 100644 index 00000000..c4f590f0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ConnorsRsi.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ConnorsRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ConnorsRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ConnorsRsi(int periodRsi, int periodStreak, int periodRank) { + if (periodRsi < 0) { + throw new IllegalArgumentException("periodRsi must be non-negative"); + } + if (periodStreak < 0) { + throw new IllegalArgumentException("periodStreak must be non-negative"); + } + if (periodRank < 0) { + throw new IllegalArgumentException("periodRank must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CONNORS_RSI_NEW.invokeExact((long) periodRsi, (long) periodStreak, (long) periodRank); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ConnorsRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CONNORS_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CONNORS_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CONNORS_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CONNORS_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Coppock.java b/bindings/java/src/main/java/org/wickra/Coppock.java new file mode 100644 index 00000000..1ae6f29d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Coppock.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Coppock indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Coppock implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Coppock(int rocLongPeriod, int rocShortPeriod, int wmaPeriod) { + if (rocLongPeriod < 0) { + throw new IllegalArgumentException("rocLongPeriod must be non-negative"); + } + if (rocShortPeriod < 0) { + throw new IllegalArgumentException("rocShortPeriod must be non-negative"); + } + if (wmaPeriod < 0) { + throw new IllegalArgumentException("wmaPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COPPOCK_NEW.invokeExact((long) rocLongPeriod, (long) rocShortPeriod, (long) wmaPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Coppock parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COPPOCK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_COPPOCK_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_COPPOCK_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COPPOCK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CorrelationTrendIndicator.java b/bindings/java/src/main/java/org/wickra/CorrelationTrendIndicator.java new file mode 100644 index 00000000..33aabf4f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CorrelationTrendIndicator.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CorrelationTrendIndicator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CorrelationTrendIndicator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CorrelationTrendIndicator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CORRELATION_TREND_INDICATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CorrelationTrendIndicator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CORRELATION_TREND_INDICATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CORRELATION_TREND_INDICATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CORRELATION_TREND_INDICATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CORRELATION_TREND_INDICATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Counterattack.java b/bindings/java/src/main/java/org/wickra/Counterattack.java new file mode 100644 index 00000000..12e2ccee --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Counterattack.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Counterattack indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Counterattack implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Counterattack() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_COUNTERATTACK_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Counterattack parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_COUNTERATTACK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_COUNTERATTACK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_COUNTERATTACK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_COUNTERATTACK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Crab.java b/bindings/java/src/main/java/org/wickra/Crab.java new file mode 100644 index 00000000..3cfc1a69 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Crab.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Crab indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Crab implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Crab() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CRAB_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Crab parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CRAB_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CRAB_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CRAB_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CRAB_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CumulativeVolumeDelta.java b/bindings/java/src/main/java/org/wickra/CumulativeVolumeDelta.java new file mode 100644 index 00000000..8473ebfe --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CumulativeVolumeDelta.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CumulativeVolumeDelta indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CumulativeVolumeDelta implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CumulativeVolumeDelta() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CUMULATIVE_VOLUME_DELTA_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CumulativeVolumeDelta parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CUMULATIVE_VOLUME_DELTA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CUMULATIVE_VOLUME_DELTA_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CUMULATIVE_VOLUME_DELTA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CumulativeVolumeIndex.java b/bindings/java/src/main/java/org/wickra/CumulativeVolumeIndex.java new file mode 100644 index 00000000..9dabe396 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CumulativeVolumeIndex.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CumulativeVolumeIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CumulativeVolumeIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CumulativeVolumeIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CUMULATIVE_VOLUME_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CumulativeVolumeIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CUMULATIVE_VOLUME_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_CUMULATIVE_VOLUME_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CUMULATIVE_VOLUME_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CupAndHandle.java b/bindings/java/src/main/java/org/wickra/CupAndHandle.java new file mode 100644 index 00000000..20411441 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CupAndHandle.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CupAndHandle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CupAndHandle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CupAndHandle() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CUP_AND_HANDLE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CupAndHandle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CUP_AND_HANDLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CUP_AND_HANDLE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CUP_AND_HANDLE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CUP_AND_HANDLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/CyberneticCycle.java b/bindings/java/src/main/java/org/wickra/CyberneticCycle.java new file mode 100644 index 00000000..196de20f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/CyberneticCycle.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming CyberneticCycle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class CyberneticCycle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public CyberneticCycle(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CYBERNETIC_CYCLE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid CyberneticCycle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CYBERNETIC_CYCLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_CYBERNETIC_CYCLE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CYBERNETIC_CYCLE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CYBERNETIC_CYCLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Cypher.java b/bindings/java/src/main/java/org/wickra/Cypher.java new file mode 100644 index 00000000..ee0f4fc5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Cypher.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Cypher indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Cypher implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Cypher() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_CYPHER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Cypher parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_CYPHER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_CYPHER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_CYPHER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_CYPHER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DayOfWeekProfile.java b/bindings/java/src/main/java/org/wickra/DayOfWeekProfile.java new file mode 100644 index 00000000..333eb8d4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DayOfWeekProfile.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DayOfWeekProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DayOfWeekProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public DayOfWeekProfile(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DAY_OF_WEEK_PROFILE_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DayOfWeekProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DAY_OF_WEEK_PROFILE_FREE); + this.valuesCapacity = 4096; + } + + /** Push one observation; returns the profile values, or null during warmup. */ + public double[] update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_DAY_OF_WEEK_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return v; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DAY_OF_WEEK_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Decycler.java b/bindings/java/src/main/java/org/wickra/Decycler.java new file mode 100644 index 00000000..9908a8cc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Decycler.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Decycler indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Decycler implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Decycler(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DECYCLER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Decycler parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DECYCLER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DECYCLER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DECYCLER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DECYCLER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DecyclerOscillator.java b/bindings/java/src/main/java/org/wickra/DecyclerOscillator.java new file mode 100644 index 00000000..6e70e16a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DecyclerOscillator.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DecyclerOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DecyclerOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DecyclerOscillator(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DECYCLER_OSCILLATOR_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DecyclerOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DECYCLER_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DECYCLER_OSCILLATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DECYCLER_OSCILLATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DECYCLER_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Dema.java b/bindings/java/src/main/java/org/wickra/Dema.java new file mode 100644 index 00000000..8867e810 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Dema.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Dema indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Dema implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Dema(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DEMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Dema parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DEMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DEMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DEMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DEMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DemandIndex.java b/bindings/java/src/main/java/org/wickra/DemandIndex.java new file mode 100644 index 00000000..47e22a7c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DemandIndex.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DemandIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DemandIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DemandIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DEMAND_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DemandIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DEMAND_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DEMAND_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DEMAND_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DEMAND_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DemarkPivots.java b/bindings/java/src/main/java/org/wickra/DemarkPivots.java new file mode 100644 index 00000000..57c67ce5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DemarkPivots.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DemarkPivots indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DemarkPivots implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DemarkPivots() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DEMARK_PIVOTS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DemarkPivots parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DEMARK_PIVOTS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public DemarkPivotsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_DEMARK_PIVOTS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new DemarkPivotsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DEMARK_PIVOTS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DemarkPivotsOutput.java b/bindings/java/src/main/java/org/wickra/DemarkPivotsOutput.java new file mode 100644 index 00000000..60b7a90e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DemarkPivotsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record DemarkPivotsOutput(double pp, double r1, double s1) {} diff --git a/bindings/java/src/main/java/org/wickra/DepthSlope.java b/bindings/java/src/main/java/org/wickra/DepthSlope.java new file mode 100644 index 00000000..02965792 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DepthSlope.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DepthSlope indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DepthSlope implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DepthSlope() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DEPTH_SLOPE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DepthSlope parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DEPTH_SLOPE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_DEPTH_SLOPE_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DEPTH_SLOPE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DerivativeOscillator.java b/bindings/java/src/main/java/org/wickra/DerivativeOscillator.java new file mode 100644 index 00000000..bfec4e02 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DerivativeOscillator.java @@ -0,0 +1,78 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DerivativeOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DerivativeOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DerivativeOscillator(int rsiPeriod, int smooth1, int smooth2, int signalPeriod) { + if (rsiPeriod < 0) { + throw new IllegalArgumentException("rsiPeriod must be non-negative"); + } + if (smooth1 < 0) { + throw new IllegalArgumentException("smooth1 must be non-negative"); + } + if (smooth2 < 0) { + throw new IllegalArgumentException("smooth2 must be non-negative"); + } + if (signalPeriod < 0) { + throw new IllegalArgumentException("signalPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DERIVATIVE_OSCILLATOR_NEW.invokeExact((long) rsiPeriod, (long) smooth1, (long) smooth2, (long) signalPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DerivativeOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DERIVATIVE_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DERIVATIVE_OSCILLATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DERIVATIVE_OSCILLATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DERIVATIVE_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DetrendedStdDev.java b/bindings/java/src/main/java/org/wickra/DetrendedStdDev.java new file mode 100644 index 00000000..b9b31e9a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DetrendedStdDev.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DetrendedStdDev indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DetrendedStdDev implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DetrendedStdDev(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DETRENDED_STD_DEV_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DetrendedStdDev parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DETRENDED_STD_DEV_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DETRENDED_STD_DEV_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DETRENDED_STD_DEV_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DETRENDED_STD_DEV_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DisparityIndex.java b/bindings/java/src/main/java/org/wickra/DisparityIndex.java new file mode 100644 index 00000000..ddfdc8e4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DisparityIndex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DisparityIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DisparityIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DisparityIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DISPARITY_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DisparityIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DISPARITY_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DISPARITY_INDEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DISPARITY_INDEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DISPARITY_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DistanceSsd.java b/bindings/java/src/main/java/org/wickra/DistanceSsd.java new file mode 100644 index 00000000..207c25a3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DistanceSsd.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DistanceSsd indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DistanceSsd implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DistanceSsd(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DISTANCE_SSD_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DistanceSsd parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DISTANCE_SSD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_DISTANCE_SSD_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DISTANCE_SSD_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DISTANCE_SSD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Doji.java b/bindings/java/src/main/java/org/wickra/Doji.java new file mode 100644 index 00000000..2d687de6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Doji.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Doji indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Doji implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Doji() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOJI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Doji parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOJI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DOJI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DOJI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOJI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DojiStar.java b/bindings/java/src/main/java/org/wickra/DojiStar.java new file mode 100644 index 00000000..33640e5e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DojiStar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DojiStar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DojiStar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DojiStar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOJI_STAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DojiStar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOJI_STAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DOJI_STAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DOJI_STAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOJI_STAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DollarBar.java b/bindings/java/src/main/java/org/wickra/DollarBar.java new file mode 100644 index 00000000..acf855fd --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DollarBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record DollarBar(double open, double high, double low, double close, double volume, double dollar) {} diff --git a/bindings/java/src/main/java/org/wickra/DollarBars.java b/bindings/java/src/main/java/org/wickra/DollarBars.java new file mode 100644 index 00000000..4e01fb89 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DollarBars.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DollarBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DollarBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DollarBars(double dollarPerBar) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOLLAR_BARS_NEW.invokeExact(dollarPerBar); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DollarBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOLLAR_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public DollarBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(48L * cap); + long n = (long) NativeMethods.WICKRA_DOLLAR_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new DollarBar[0]; + } + DollarBar[] result = new DollarBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 48L; + result[i] = new DollarBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L), + out.get(JAVA_DOUBLE, b + 24L), + out.get(JAVA_DOUBLE, b + 32L), + out.get(JAVA_DOUBLE, b + 40L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOLLAR_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Donchian.java b/bindings/java/src/main/java/org/wickra/Donchian.java new file mode 100644 index 00000000..a5b9e6d7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Donchian.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Donchian indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Donchian implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Donchian(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DONCHIAN_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Donchian parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DONCHIAN_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public DonchianOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_DONCHIAN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new DonchianOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DONCHIAN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DonchianOutput.java b/bindings/java/src/main/java/org/wickra/DonchianOutput.java new file mode 100644 index 00000000..86c2d160 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DonchianOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record DonchianOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/DonchianStop.java b/bindings/java/src/main/java/org/wickra/DonchianStop.java new file mode 100644 index 00000000..96024299 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DonchianStop.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DonchianStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DonchianStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DonchianStop(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DONCHIAN_STOP_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DonchianStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DONCHIAN_STOP_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public DonchianStopOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_DONCHIAN_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new DonchianStopOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DONCHIAN_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DonchianStopOutput.java b/bindings/java/src/main/java/org/wickra/DonchianStopOutput.java new file mode 100644 index 00000000..08850315 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DonchianStopOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record DonchianStopOutput(double stopLong, double stopShort) {} diff --git a/bindings/java/src/main/java/org/wickra/DoubleBollinger.java b/bindings/java/src/main/java/org/wickra/DoubleBollinger.java new file mode 100644 index 00000000..9df63317 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DoubleBollinger.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DoubleBollinger indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DoubleBollinger implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DoubleBollinger(int period, double kInner, double kOuter) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOUBLE_BOLLINGER_NEW.invokeExact((long) period, kInner, kOuter); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DoubleBollinger parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOUBLE_BOLLINGER_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public DoubleBollingerOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_DOUBLE_BOLLINGER_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new DoubleBollingerOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOUBLE_BOLLINGER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DoubleBollingerOutput.java b/bindings/java/src/main/java/org/wickra/DoubleBollingerOutput.java new file mode 100644 index 00000000..3610147d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DoubleBollingerOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record DoubleBollingerOutput(double upperOuter, double upperInner, double middle, double lowerInner, double lowerOuter) {} diff --git a/bindings/java/src/main/java/org/wickra/DoubleTopBottom.java b/bindings/java/src/main/java/org/wickra/DoubleTopBottom.java new file mode 100644 index 00000000..502956ad --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DoubleTopBottom.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DoubleTopBottom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DoubleTopBottom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DoubleTopBottom() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOUBLE_TOP_BOTTOM_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DoubleTopBottom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOUBLE_TOP_BOTTOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DOUBLE_TOP_BOTTOM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DOUBLE_TOP_BOTTOM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOUBLE_TOP_BOTTOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DownsideGapThreeMethods.java b/bindings/java/src/main/java/org/wickra/DownsideGapThreeMethods.java new file mode 100644 index 00000000..052bdc85 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DownsideGapThreeMethods.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DownsideGapThreeMethods indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DownsideGapThreeMethods implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DownsideGapThreeMethods() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DOWNSIDE_GAP_THREE_METHODS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DownsideGapThreeMethods parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DOWNSIDE_GAP_THREE_METHODS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DOWNSIDE_GAP_THREE_METHODS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DOWNSIDE_GAP_THREE_METHODS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DOWNSIDE_GAP_THREE_METHODS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Dpo.java b/bindings/java/src/main/java/org/wickra/Dpo.java new file mode 100644 index 00000000..eab64c5d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Dpo.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Dpo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Dpo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Dpo(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DPO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Dpo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DPO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DPO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DPO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DPO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DragonflyDoji.java b/bindings/java/src/main/java/org/wickra/DragonflyDoji.java new file mode 100644 index 00000000..9dfbaff4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DragonflyDoji.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DragonflyDoji indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DragonflyDoji implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DragonflyDoji() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DRAGONFLY_DOJI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DragonflyDoji parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DRAGONFLY_DOJI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DRAGONFLY_DOJI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DRAGONFLY_DOJI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DRAGONFLY_DOJI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DrawdownDuration.java b/bindings/java/src/main/java/org/wickra/DrawdownDuration.java new file mode 100644 index 00000000..655c0e7e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DrawdownDuration.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DrawdownDuration indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DrawdownDuration implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DrawdownDuration() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DRAWDOWN_DURATION_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DrawdownDuration parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DRAWDOWN_DURATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DRAWDOWN_DURATION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DRAWDOWN_DURATION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DRAWDOWN_DURATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DumplingTop.java b/bindings/java/src/main/java/org/wickra/DumplingTop.java new file mode 100644 index 00000000..f28f8717 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DumplingTop.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DumplingTop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DumplingTop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DumplingTop(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DUMPLING_TOP_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DumplingTop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DUMPLING_TOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DUMPLING_TOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DUMPLING_TOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DUMPLING_TOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Dx.java b/bindings/java/src/main/java/org/wickra/Dx.java new file mode 100644 index 00000000..39969a65 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Dx.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Dx indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Dx implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Dx(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Dx parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_DX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/DynamicMomentumIndex.java b/bindings/java/src/main/java/org/wickra/DynamicMomentumIndex.java new file mode 100644 index 00000000..27f6599f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/DynamicMomentumIndex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming DynamicMomentumIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class DynamicMomentumIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public DynamicMomentumIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_DYNAMIC_MOMENTUM_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid DynamicMomentumIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_DYNAMIC_MOMENTUM_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_DYNAMIC_MOMENTUM_INDEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_DYNAMIC_MOMENTUM_INDEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_DYNAMIC_MOMENTUM_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EaseOfMovement.java b/bindings/java/src/main/java/org/wickra/EaseOfMovement.java new file mode 100644 index 00000000..9423d882 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EaseOfMovement.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EaseOfMovement indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EaseOfMovement implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EaseOfMovement(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EASE_OF_MOVEMENT_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EaseOfMovement parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EASE_OF_MOVEMENT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_EASE_OF_MOVEMENT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EASE_OF_MOVEMENT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EASE_OF_MOVEMENT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EffectiveSpread.java b/bindings/java/src/main/java/org/wickra/EffectiveSpread.java new file mode 100644 index 00000000..e5ce08f6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EffectiveSpread.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EffectiveSpread indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EffectiveSpread implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EffectiveSpread() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EFFECTIVE_SPREAD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EffectiveSpread parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EFFECTIVE_SPREAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp, double mid) { + try { + return (double) NativeMethods.WICKRA_EFFECTIVE_SPREAD_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp, mid); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EFFECTIVE_SPREAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EhlersStochastic.java b/bindings/java/src/main/java/org/wickra/EhlersStochastic.java new file mode 100644 index 00000000..d159e78b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EhlersStochastic.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EhlersStochastic indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EhlersStochastic implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EhlersStochastic(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EHLERS_STOCHASTIC_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EhlersStochastic parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EHLERS_STOCHASTIC_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EHLERS_STOCHASTIC_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EHLERS_STOCHASTIC_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EHLERS_STOCHASTIC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Ehma.java b/bindings/java/src/main/java/org/wickra/Ehma.java new file mode 100644 index 00000000..4903ea9c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Ehma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Ehma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Ehma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Ehma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EHMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Ehma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EHMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EHMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EHMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EHMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ElderImpulse.java b/bindings/java/src/main/java/org/wickra/ElderImpulse.java new file mode 100644 index 00000000..2eadb9a2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ElderImpulse.java @@ -0,0 +1,78 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ElderImpulse indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ElderImpulse implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ElderImpulse(int emaPeriod, int macdFast, int macdSlow, int macdSignal) { + if (emaPeriod < 0) { + throw new IllegalArgumentException("emaPeriod must be non-negative"); + } + if (macdFast < 0) { + throw new IllegalArgumentException("macdFast must be non-negative"); + } + if (macdSlow < 0) { + throw new IllegalArgumentException("macdSlow must be non-negative"); + } + if (macdSignal < 0) { + throw new IllegalArgumentException("macdSignal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ELDER_IMPULSE_NEW.invokeExact((long) emaPeriod, (long) macdFast, (long) macdSlow, (long) macdSignal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ElderImpulse parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ELDER_IMPULSE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ELDER_IMPULSE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ELDER_IMPULSE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ELDER_IMPULSE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ElderRay.java b/bindings/java/src/main/java/org/wickra/ElderRay.java new file mode 100644 index 00000000..eb638f41 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ElderRay.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ElderRay indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ElderRay implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ElderRay(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ELDER_RAY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ElderRay parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ELDER_RAY_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ElderRayOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_ELDER_RAY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ElderRayOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ELDER_RAY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ElderRayOutput.java b/bindings/java/src/main/java/org/wickra/ElderRayOutput.java new file mode 100644 index 00000000..cee00f43 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ElderRayOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ElderRayOutput(double bullPower, double bearPower) {} diff --git a/bindings/java/src/main/java/org/wickra/ElderSafeZone.java b/bindings/java/src/main/java/org/wickra/ElderSafeZone.java new file mode 100644 index 00000000..f6b589af --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ElderSafeZone.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ElderSafeZone indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ElderSafeZone implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ElderSafeZone(int period, double coeff) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ELDER_SAFE_ZONE_NEW.invokeExact((long) period, coeff); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ElderSafeZone parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ELDER_SAFE_ZONE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ElderSafeZoneOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_ELDER_SAFE_ZONE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ElderSafeZoneOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ELDER_SAFE_ZONE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ElderSafeZoneOutput.java b/bindings/java/src/main/java/org/wickra/ElderSafeZoneOutput.java new file mode 100644 index 00000000..fe700e72 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ElderSafeZoneOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ElderSafeZoneOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/Ema.java b/bindings/java/src/main/java/org/wickra/Ema.java new file mode 100644 index 00000000..2854246f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Ema.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Ema indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Ema implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Ema(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Ema parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EmpiricalModeDecomposition.java b/bindings/java/src/main/java/org/wickra/EmpiricalModeDecomposition.java new file mode 100644 index 00000000..631b7cda --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EmpiricalModeDecomposition.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EmpiricalModeDecomposition indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EmpiricalModeDecomposition implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EmpiricalModeDecomposition(int period, double fraction) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EMPIRICAL_MODE_DECOMPOSITION_NEW.invokeExact((long) period, fraction); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EmpiricalModeDecomposition parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EMPIRICAL_MODE_DECOMPOSITION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EMPIRICAL_MODE_DECOMPOSITION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EMPIRICAL_MODE_DECOMPOSITION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EMPIRICAL_MODE_DECOMPOSITION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Engulfing.java b/bindings/java/src/main/java/org/wickra/Engulfing.java new file mode 100644 index 00000000..481fa918 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Engulfing.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Engulfing indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Engulfing implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Engulfing() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ENGULFING_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Engulfing parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ENGULFING_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ENGULFING_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ENGULFING_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ENGULFING_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Equivolume.java b/bindings/java/src/main/java/org/wickra/Equivolume.java new file mode 100644 index 00000000..c5c954de --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Equivolume.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Equivolume indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Equivolume implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Equivolume(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EQUIVOLUME_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Equivolume parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EQUIVOLUME_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public EquivolumeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_EQUIVOLUME_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new EquivolumeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EQUIVOLUME_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EquivolumeOutput.java b/bindings/java/src/main/java/org/wickra/EquivolumeOutput.java new file mode 100644 index 00000000..cb1c56ff --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EquivolumeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record EquivolumeOutput(double height, double width) {} diff --git a/bindings/java/src/main/java/org/wickra/EstimatedLeverageRatio.java b/bindings/java/src/main/java/org/wickra/EstimatedLeverageRatio.java new file mode 100644 index 00000000..ee94661c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EstimatedLeverageRatio.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EstimatedLeverageRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EstimatedLeverageRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EstimatedLeverageRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ESTIMATED_LEVERAGE_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EstimatedLeverageRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ESTIMATED_LEVERAGE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ESTIMATED_LEVERAGE_RATIO_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ESTIMATED_LEVERAGE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EvenBetterSinewave.java b/bindings/java/src/main/java/org/wickra/EvenBetterSinewave.java new file mode 100644 index 00000000..2abd8860 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EvenBetterSinewave.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EvenBetterSinewave indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EvenBetterSinewave implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EvenBetterSinewave(int hpPeriod, int ssfLength) { + if (hpPeriod < 0) { + throw new IllegalArgumentException("hpPeriod must be non-negative"); + } + if (ssfLength < 0) { + throw new IllegalArgumentException("ssfLength must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EVEN_BETTER_SINEWAVE_NEW.invokeExact((long) hpPeriod, (long) ssfLength); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EvenBetterSinewave parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EVEN_BETTER_SINEWAVE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EVEN_BETTER_SINEWAVE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EVEN_BETTER_SINEWAVE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EVEN_BETTER_SINEWAVE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EveningDojiStar.java b/bindings/java/src/main/java/org/wickra/EveningDojiStar.java new file mode 100644 index 00000000..ec621cc9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EveningDojiStar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EveningDojiStar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EveningDojiStar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EveningDojiStar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EVENING_DOJI_STAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EveningDojiStar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EVENING_DOJI_STAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_EVENING_DOJI_STAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EVENING_DOJI_STAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EVENING_DOJI_STAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Evwma.java b/bindings/java/src/main/java/org/wickra/Evwma.java new file mode 100644 index 00000000..e0a25f3d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Evwma.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Evwma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Evwma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Evwma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EVWMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Evwma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EVWMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_EVWMA_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EVWMA_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EVWMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/EwmaVolatility.java b/bindings/java/src/main/java/org/wickra/EwmaVolatility.java new file mode 100644 index 00000000..7d544707 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/EwmaVolatility.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming EwmaVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class EwmaVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public EwmaVolatility(double lambda) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EWMA_VOLATILITY_NEW.invokeExact(lambda); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid EwmaVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EWMA_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EWMA_VOLATILITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EWMA_VOLATILITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EWMA_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Expectancy.java b/bindings/java/src/main/java/org/wickra/Expectancy.java new file mode 100644 index 00000000..670db1b9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Expectancy.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Expectancy indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Expectancy implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Expectancy(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_EXPECTANCY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Expectancy parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_EXPECTANCY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_EXPECTANCY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_EXPECTANCY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_EXPECTANCY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FallingThreeMethods.java b/bindings/java/src/main/java/org/wickra/FallingThreeMethods.java new file mode 100644 index 00000000..7580e4c2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FallingThreeMethods.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FallingThreeMethods indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FallingThreeMethods implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FallingThreeMethods() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FALLING_THREE_METHODS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FallingThreeMethods parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FALLING_THREE_METHODS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FALLING_THREE_METHODS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FALLING_THREE_METHODS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FALLING_THREE_METHODS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Fama.java b/bindings/java/src/main/java/org/wickra/Fama.java new file mode 100644 index 00000000..e9f3d519 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Fama.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Fama indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Fama implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Fama(double fastLimit, double slowLimit) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FAMA_NEW.invokeExact(fastLimit, slowLimit); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Fama parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FAMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_FAMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FAMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FAMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibArcs.java b/bindings/java/src/main/java/org/wickra/FibArcs.java new file mode 100644 index 00000000..5965bc64 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibArcs.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibArcs indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibArcs implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibArcs() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_ARCS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibArcs parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_ARCS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibArcsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_FIB_ARCS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibArcsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_ARCS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibArcsOutput.java b/bindings/java/src/main/java/org/wickra/FibArcsOutput.java new file mode 100644 index 00000000..9301904e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibArcsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibArcsOutput(double arc382, double arc500, double arc618) {} diff --git a/bindings/java/src/main/java/org/wickra/FibChannel.java b/bindings/java/src/main/java/org/wickra/FibChannel.java new file mode 100644 index 00000000..09bfca41 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibChannel.java @@ -0,0 +1,60 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibChannel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibChannel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibChannel() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_CHANNEL_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibChannel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_CHANNEL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibChannelOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_FIB_CHANNEL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibChannelOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_CHANNEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibChannelOutput.java b/bindings/java/src/main/java/org/wickra/FibChannelOutput.java new file mode 100644 index 00000000..d3dc25f7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibChannelOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibChannelOutput(double base, double level618, double level1000, double level1618) {} diff --git a/bindings/java/src/main/java/org/wickra/FibConfluence.java b/bindings/java/src/main/java/org/wickra/FibConfluence.java new file mode 100644 index 00000000..7461a945 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibConfluence.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibConfluence indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibConfluence implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibConfluence() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_CONFLUENCE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibConfluence parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_CONFLUENCE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibConfluenceOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_FIB_CONFLUENCE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibConfluenceOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_CONFLUENCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibConfluenceOutput.java b/bindings/java/src/main/java/org/wickra/FibConfluenceOutput.java new file mode 100644 index 00000000..8b3719ef --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibConfluenceOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibConfluenceOutput(double price, double strength) {} diff --git a/bindings/java/src/main/java/org/wickra/FibExtension.java b/bindings/java/src/main/java/org/wickra/FibExtension.java new file mode 100644 index 00000000..53f57d32 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibExtension.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibExtension indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibExtension implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibExtension() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_EXTENSION_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibExtension parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_EXTENSION_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibExtensionOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_FIB_EXTENSION_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibExtensionOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_EXTENSION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibExtensionOutput.java b/bindings/java/src/main/java/org/wickra/FibExtensionOutput.java new file mode 100644 index 00000000..7a698ee3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibExtensionOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibExtensionOutput(double level1272, double level1414, double level1618, double level2000, double level2618) {} diff --git a/bindings/java/src/main/java/org/wickra/FibFan.java b/bindings/java/src/main/java/org/wickra/FibFan.java new file mode 100644 index 00000000..48c25e3a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibFan.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibFan indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibFan implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibFan() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_FAN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibFan parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_FAN_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibFanOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_FIB_FAN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibFanOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_FAN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibFanOutput.java b/bindings/java/src/main/java/org/wickra/FibFanOutput.java new file mode 100644 index 00000000..50d639f4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibFanOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibFanOutput(double fan382, double fan500, double fan618) {} diff --git a/bindings/java/src/main/java/org/wickra/FibProjection.java b/bindings/java/src/main/java/org/wickra/FibProjection.java new file mode 100644 index 00000000..cf649f74 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibProjection.java @@ -0,0 +1,60 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibProjection indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibProjection implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibProjection() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_PROJECTION_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibProjection parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_PROJECTION_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibProjectionOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_FIB_PROJECTION_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibProjectionOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_PROJECTION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibProjectionOutput.java b/bindings/java/src/main/java/org/wickra/FibProjectionOutput.java new file mode 100644 index 00000000..86c88ca6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibProjectionOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibProjectionOutput(double level618, double level1000, double level1618, double level2618) {} diff --git a/bindings/java/src/main/java/org/wickra/FibRetracement.java b/bindings/java/src/main/java/org/wickra/FibRetracement.java new file mode 100644 index 00000000..4d26afa5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibRetracement.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibRetracement indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibRetracement implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibRetracement() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_RETRACEMENT_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibRetracement parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_RETRACEMENT_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibRetracementOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(56L); + byte ok = (byte) NativeMethods.WICKRA_FIB_RETRACEMENT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibRetracementOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_RETRACEMENT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibRetracementOutput.java b/bindings/java/src/main/java/org/wickra/FibRetracementOutput.java new file mode 100644 index 00000000..1d34cf9a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibRetracementOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibRetracementOutput(double level0, double level236, double level382, double level500, double level618, double level786, double level1000) {} diff --git a/bindings/java/src/main/java/org/wickra/FibTimeZones.java b/bindings/java/src/main/java/org/wickra/FibTimeZones.java new file mode 100644 index 00000000..f8a530d9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibTimeZones.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibTimeZones indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibTimeZones implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibTimeZones() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIB_TIME_ZONES_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibTimeZones parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIB_TIME_ZONES_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibTimeZonesOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_FIB_TIME_ZONES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibTimeZonesOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIB_TIME_ZONES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibTimeZonesOutput.java b/bindings/java/src/main/java/org/wickra/FibTimeZonesOutput.java new file mode 100644 index 00000000..ea1bf445 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibTimeZonesOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibTimeZonesOutput(double onZone, double barsToNext) {} diff --git a/bindings/java/src/main/java/org/wickra/FibonacciPivots.java b/bindings/java/src/main/java/org/wickra/FibonacciPivots.java new file mode 100644 index 00000000..73a84469 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibonacciPivots.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FibonacciPivots indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FibonacciPivots implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FibonacciPivots() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FIBONACCI_PIVOTS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FibonacciPivots parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FIBONACCI_PIVOTS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FibonacciPivotsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(56L); + byte ok = (byte) NativeMethods.WICKRA_FIBONACCI_PIVOTS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FibonacciPivotsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FIBONACCI_PIVOTS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FibonacciPivotsOutput.java b/bindings/java/src/main/java/org/wickra/FibonacciPivotsOutput.java new file mode 100644 index 00000000..311412c3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FibonacciPivotsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FibonacciPivotsOutput(double pp, double r1, double r2, double r3, double s1, double s2, double s3) {} diff --git a/bindings/java/src/main/java/org/wickra/FisherRsi.java b/bindings/java/src/main/java/org/wickra/FisherRsi.java new file mode 100644 index 00000000..4bdc0ccc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FisherRsi.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FisherRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FisherRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FisherRsi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FISHER_RSI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FisherRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FISHER_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_FISHER_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FISHER_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FISHER_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FisherTransform.java b/bindings/java/src/main/java/org/wickra/FisherTransform.java new file mode 100644 index 00000000..cad8fd18 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FisherTransform.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FisherTransform indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FisherTransform implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FisherTransform(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FISHER_TRANSFORM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FisherTransform parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FISHER_TRANSFORM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_FISHER_TRANSFORM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FISHER_TRANSFORM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FISHER_TRANSFORM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FlagPennant.java b/bindings/java/src/main/java/org/wickra/FlagPennant.java new file mode 100644 index 00000000..a0226367 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FlagPennant.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FlagPennant indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FlagPennant implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FlagPennant() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FLAG_PENNANT_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FlagPennant parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FLAG_PENNANT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FLAG_PENNANT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FLAG_PENNANT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FLAG_PENNANT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Footprint.java b/bindings/java/src/main/java/org/wickra/Footprint.java new file mode 100644 index 00000000..99b039e7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Footprint.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Footprint indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Footprint implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Footprint(double tickSize) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FOOTPRINT_NEW.invokeExact(tickSize); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Footprint parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FOOTPRINT_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public FootprintLevel[] update(double price, double size, boolean isBuy, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_FOOTPRINT_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp, out, cap); + if (n <= 0) { + return new FootprintLevel[0]; + } + FootprintLevel[] result = new FootprintLevel[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new FootprintLevel( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FOOTPRINT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FootprintLevel.java b/bindings/java/src/main/java/org/wickra/FootprintLevel.java new file mode 100644 index 00000000..ddb5e64b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FootprintLevel.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FootprintLevel(double price, double bidVol, double askVol) {} diff --git a/bindings/java/src/main/java/org/wickra/ForceIndex.java b/bindings/java/src/main/java/org/wickra/ForceIndex.java new file mode 100644 index 00000000..ff34757d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ForceIndex.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ForceIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ForceIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ForceIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FORCE_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ForceIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FORCE_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FORCE_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FORCE_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FORCE_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FractalChaosBands.java b/bindings/java/src/main/java/org/wickra/FractalChaosBands.java new file mode 100644 index 00000000..36ecbe71 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FractalChaosBands.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FractalChaosBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FractalChaosBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FractalChaosBands(int k) { + if (k < 0) { + throw new IllegalArgumentException("k must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FRACTAL_CHAOS_BANDS_NEW.invokeExact((long) k); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FractalChaosBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FRACTAL_CHAOS_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public FractalChaosBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_FRACTAL_CHAOS_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new FractalChaosBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FRACTAL_CHAOS_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FractalChaosBandsOutput.java b/bindings/java/src/main/java/org/wickra/FractalChaosBandsOutput.java new file mode 100644 index 00000000..b7853c35 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FractalChaosBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record FractalChaosBandsOutput(double upper, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/Frama.java b/bindings/java/src/main/java/org/wickra/Frama.java new file mode 100644 index 00000000..b925f6dc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Frama.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Frama indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Frama implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Frama(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FRAMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Frama parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FRAMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_FRAMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FRAMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FRAMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FryPanBottom.java b/bindings/java/src/main/java/org/wickra/FryPanBottom.java new file mode 100644 index 00000000..3dde122b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FryPanBottom.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FryPanBottom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FryPanBottom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FryPanBottom(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FRY_PAN_BOTTOM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FryPanBottom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FRY_PAN_BOTTOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FRY_PAN_BOTTOM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_FRY_PAN_BOTTOM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FRY_PAN_BOTTOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FundingBasis.java b/bindings/java/src/main/java/org/wickra/FundingBasis.java new file mode 100644 index 00000000..bfb19642 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FundingBasis.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FundingBasis indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FundingBasis implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FundingBasis() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FUNDING_BASIS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FundingBasis parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FUNDING_BASIS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FUNDING_BASIS_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FUNDING_BASIS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FundingImpliedApr.java b/bindings/java/src/main/java/org/wickra/FundingImpliedApr.java new file mode 100644 index 00000000..4698f483 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FundingImpliedApr.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FundingImpliedApr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FundingImpliedApr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FundingImpliedApr(double intervalsPerYear) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FUNDING_IMPLIED_APR_NEW.invokeExact(intervalsPerYear); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FundingImpliedApr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FUNDING_IMPLIED_APR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FUNDING_IMPLIED_APR_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FUNDING_IMPLIED_APR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FundingRate.java b/bindings/java/src/main/java/org/wickra/FundingRate.java new file mode 100644 index 00000000..eefb624c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FundingRate.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FundingRate indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FundingRate implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FundingRate() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FUNDING_RATE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FundingRate parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FUNDING_RATE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FUNDING_RATE_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FUNDING_RATE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FundingRateMean.java b/bindings/java/src/main/java/org/wickra/FundingRateMean.java new file mode 100644 index 00000000..ef196761 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FundingRateMean.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FundingRateMean indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FundingRateMean implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FundingRateMean(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FUNDING_RATE_MEAN_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FundingRateMean parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FUNDING_RATE_MEAN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FUNDING_RATE_MEAN_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FUNDING_RATE_MEAN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/FundingRateZScore.java b/bindings/java/src/main/java/org/wickra/FundingRateZScore.java new file mode 100644 index 00000000..757f160f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/FundingRateZScore.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming FundingRateZScore indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class FundingRateZScore implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public FundingRateZScore(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_FUNDING_RATE_Z_SCORE_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid FundingRateZScore parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_FUNDING_RATE_Z_SCORE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_FUNDING_RATE_Z_SCORE_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_FUNDING_RATE_Z_SCORE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GainLossRatio.java b/bindings/java/src/main/java/org/wickra/GainLossRatio.java new file mode 100644 index 00000000..f1fd3cde --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GainLossRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GainLossRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GainLossRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GainLossRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GAIN_LOSS_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GainLossRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GAIN_LOSS_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_GAIN_LOSS_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GAIN_LOSS_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GAIN_LOSS_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GainToPainRatio.java b/bindings/java/src/main/java/org/wickra/GainToPainRatio.java new file mode 100644 index 00000000..62fbc996 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GainToPainRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GainToPainRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GainToPainRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GainToPainRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GAIN_TO_PAIN_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GainToPainRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GAIN_TO_PAIN_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_GAIN_TO_PAIN_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GAIN_TO_PAIN_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GAIN_TO_PAIN_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GapSideBySideWhite.java b/bindings/java/src/main/java/org/wickra/GapSideBySideWhite.java new file mode 100644 index 00000000..03718643 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GapSideBySideWhite.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GapSideBySideWhite indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GapSideBySideWhite implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GapSideBySideWhite() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GAP_SIDE_BY_SIDE_WHITE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GapSideBySideWhite parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GAP_SIDE_BY_SIDE_WHITE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_GAP_SIDE_BY_SIDE_WHITE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GAP_SIDE_BY_SIDE_WHITE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GAP_SIDE_BY_SIDE_WHITE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Garch11.java b/bindings/java/src/main/java/org/wickra/Garch11.java new file mode 100644 index 00000000..eb044c3d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Garch11.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Garch11 indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Garch11 implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Garch11(double omega, double alpha, double beta) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GARCH11_NEW.invokeExact(omega, alpha, beta); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Garch11 parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GARCH11_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_GARCH11_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GARCH11_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GARCH11_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GarmanKlassVolatility.java b/bindings/java/src/main/java/org/wickra/GarmanKlassVolatility.java new file mode 100644 index 00000000..925dc4e7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GarmanKlassVolatility.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GarmanKlassVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GarmanKlassVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GarmanKlassVolatility(int period, int tradingPeriods) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (tradingPeriods < 0) { + throw new IllegalArgumentException("tradingPeriods must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GARMAN_KLASS_VOLATILITY_NEW.invokeExact((long) period, (long) tradingPeriods); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GarmanKlassVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GARMAN_KLASS_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_GARMAN_KLASS_VOLATILITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GARMAN_KLASS_VOLATILITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GARMAN_KLASS_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Gartley.java b/bindings/java/src/main/java/org/wickra/Gartley.java new file mode 100644 index 00000000..517510ab --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Gartley.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Gartley indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Gartley implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Gartley() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GARTLEY_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Gartley parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GARTLEY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_GARTLEY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GARTLEY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GARTLEY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GatorOscillator.java b/bindings/java/src/main/java/org/wickra/GatorOscillator.java new file mode 100644 index 00000000..696b2bf4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GatorOscillator.java @@ -0,0 +1,67 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GatorOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GatorOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GatorOscillator(int jawPeriod, int teethPeriod, int lipsPeriod) { + if (jawPeriod < 0) { + throw new IllegalArgumentException("jawPeriod must be non-negative"); + } + if (teethPeriod < 0) { + throw new IllegalArgumentException("teethPeriod must be non-negative"); + } + if (lipsPeriod < 0) { + throw new IllegalArgumentException("lipsPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GATOR_OSCILLATOR_NEW.invokeExact((long) jawPeriod, (long) teethPeriod, (long) lipsPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GatorOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GATOR_OSCILLATOR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public GatorOscillatorOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_GATOR_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new GatorOscillatorOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GATOR_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GatorOscillatorOutput.java b/bindings/java/src/main/java/org/wickra/GatorOscillatorOutput.java new file mode 100644 index 00000000..6b4a7b4a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GatorOscillatorOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record GatorOscillatorOutput(double upper, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/GeneralizedDema.java b/bindings/java/src/main/java/org/wickra/GeneralizedDema.java new file mode 100644 index 00000000..11bb317b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GeneralizedDema.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GeneralizedDema indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GeneralizedDema implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GeneralizedDema(int period, double v) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GENERALIZED_DEMA_NEW.invokeExact((long) period, v); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GeneralizedDema parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GENERALIZED_DEMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_GENERALIZED_DEMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GENERALIZED_DEMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GENERALIZED_DEMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GeometricMa.java b/bindings/java/src/main/java/org/wickra/GeometricMa.java new file mode 100644 index 00000000..43cc4d55 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GeometricMa.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GeometricMa indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GeometricMa implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GeometricMa(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GEOMETRIC_MA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GeometricMa parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GEOMETRIC_MA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_GEOMETRIC_MA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GEOMETRIC_MA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GEOMETRIC_MA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GoldenPocket.java b/bindings/java/src/main/java/org/wickra/GoldenPocket.java new file mode 100644 index 00000000..a670b806 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GoldenPocket.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GoldenPocket indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GoldenPocket implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GoldenPocket() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GOLDEN_POCKET_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GoldenPocket parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GOLDEN_POCKET_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public GoldenPocketOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_GOLDEN_POCKET_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new GoldenPocketOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GOLDEN_POCKET_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GoldenPocketOutput.java b/bindings/java/src/main/java/org/wickra/GoldenPocketOutput.java new file mode 100644 index 00000000..d2435690 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GoldenPocketOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record GoldenPocketOutput(double low, double mid, double high) {} diff --git a/bindings/java/src/main/java/org/wickra/GrangerCausality.java b/bindings/java/src/main/java/org/wickra/GrangerCausality.java new file mode 100644 index 00000000..2fee4f89 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GrangerCausality.java @@ -0,0 +1,76 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GrangerCausality indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GrangerCausality implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GrangerCausality(int period, int lag) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (lag < 0) { + throw new IllegalArgumentException("lag must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GRANGER_CAUSALITY_NEW.invokeExact((long) period, (long) lag); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GrangerCausality parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GRANGER_CAUSALITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_GRANGER_CAUSALITY_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GRANGER_CAUSALITY_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GRANGER_CAUSALITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/GravestoneDoji.java b/bindings/java/src/main/java/org/wickra/GravestoneDoji.java new file mode 100644 index 00000000..9f4cd177 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/GravestoneDoji.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming GravestoneDoji indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class GravestoneDoji implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public GravestoneDoji() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_GRAVESTONE_DOJI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid GravestoneDoji parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_GRAVESTONE_DOJI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_GRAVESTONE_DOJI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_GRAVESTONE_DOJI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_GRAVESTONE_DOJI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Hammer.java b/bindings/java/src/main/java/org/wickra/Hammer.java new file mode 100644 index 00000000..b88dc321 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Hammer.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Hammer indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Hammer implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Hammer() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HAMMER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Hammer parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HAMMER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HAMMER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HAMMER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HAMMER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HangingMan.java b/bindings/java/src/main/java/org/wickra/HangingMan.java new file mode 100644 index 00000000..81eb0562 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HangingMan.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HangingMan indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HangingMan implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HangingMan() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HANGING_MAN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HangingMan parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HANGING_MAN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HANGING_MAN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HANGING_MAN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HANGING_MAN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Harami.java b/bindings/java/src/main/java/org/wickra/Harami.java new file mode 100644 index 00000000..259aefc7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Harami.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Harami indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Harami implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Harami() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HARAMI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Harami parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HARAMI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HARAMI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HARAMI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HARAMI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HaramiCross.java b/bindings/java/src/main/java/org/wickra/HaramiCross.java new file mode 100644 index 00000000..a7349cfc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HaramiCross.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HaramiCross indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HaramiCross implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HaramiCross() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HARAMI_CROSS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HaramiCross parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HARAMI_CROSS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HARAMI_CROSS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HARAMI_CROSS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HARAMI_CROSS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HasbrouckInformationShare.java b/bindings/java/src/main/java/org/wickra/HasbrouckInformationShare.java new file mode 100644 index 00000000..dbf3cee8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HasbrouckInformationShare.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HasbrouckInformationShare indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HasbrouckInformationShare implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HasbrouckInformationShare(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HASBROUCK_INFORMATION_SHARE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HasbrouckInformationShare parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HASBROUCK_INFORMATION_SHARE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_HASBROUCK_INFORMATION_SHARE_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HASBROUCK_INFORMATION_SHARE_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HASBROUCK_INFORMATION_SHARE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HeadAndShoulders.java b/bindings/java/src/main/java/org/wickra/HeadAndShoulders.java new file mode 100644 index 00000000..9f04624d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HeadAndShoulders.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HeadAndShoulders indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HeadAndShoulders implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HeadAndShoulders() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HEAD_AND_SHOULDERS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HeadAndShoulders parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HEAD_AND_SHOULDERS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HEAD_AND_SHOULDERS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HEAD_AND_SHOULDERS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HEAD_AND_SHOULDERS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HeikinAshi.java b/bindings/java/src/main/java/org/wickra/HeikinAshi.java new file mode 100644 index 00000000..3146a1ed --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HeikinAshi.java @@ -0,0 +1,60 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HeikinAshi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HeikinAshi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HeikinAshi() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HEIKIN_ASHI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HeikinAshi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HEIKIN_ASHI_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public HeikinAshiOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_HEIKIN_ASHI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new HeikinAshiOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HEIKIN_ASHI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HeikinAshiOscillator.java b/bindings/java/src/main/java/org/wickra/HeikinAshiOscillator.java new file mode 100644 index 00000000..5b781c44 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HeikinAshiOscillator.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HeikinAshiOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HeikinAshiOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HeikinAshiOscillator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HEIKIN_ASHI_OSCILLATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HeikinAshiOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HEIKIN_ASHI_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HEIKIN_ASHI_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HEIKIN_ASHI_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HEIKIN_ASHI_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HeikinAshiOutput.java b/bindings/java/src/main/java/org/wickra/HeikinAshiOutput.java new file mode 100644 index 00000000..f4982bfe --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HeikinAshiOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record HeikinAshiOutput(double open, double high, double low, double close) {} diff --git a/bindings/java/src/main/java/org/wickra/HiLoActivator.java b/bindings/java/src/main/java/org/wickra/HiLoActivator.java new file mode 100644 index 00000000..2c6f6102 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HiLoActivator.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HiLoActivator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HiLoActivator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HiLoActivator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HI_LO_ACTIVATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HiLoActivator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HI_LO_ACTIVATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HI_LO_ACTIVATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HI_LO_ACTIVATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HI_LO_ACTIVATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HighLowIndex.java b/bindings/java/src/main/java/org/wickra/HighLowIndex.java new file mode 100644 index 00000000..b8c73516 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighLowIndex.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HighLowIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HighLowIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HighLowIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIGH_LOW_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HighLowIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIGH_LOW_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_HIGH_LOW_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIGH_LOW_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HighLowRange.java b/bindings/java/src/main/java/org/wickra/HighLowRange.java new file mode 100644 index 00000000..bd71c4af --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighLowRange.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HighLowRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HighLowRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HighLowRange() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIGH_LOW_RANGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HighLowRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIGH_LOW_RANGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HIGH_LOW_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HIGH_LOW_RANGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIGH_LOW_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HighLowVolumeNodes.java b/bindings/java/src/main/java/org/wickra/HighLowVolumeNodes.java new file mode 100644 index 00000000..46d9d170 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighLowVolumeNodes.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HighLowVolumeNodes indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HighLowVolumeNodes implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HighLowVolumeNodes(int period, int bins) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIGH_LOW_VOLUME_NODES_NEW.invokeExact((long) period, (long) bins); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HighLowVolumeNodes parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIGH_LOW_VOLUME_NODES_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public HighLowVolumeNodesOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_HIGH_LOW_VOLUME_NODES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new HighLowVolumeNodesOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIGH_LOW_VOLUME_NODES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HighLowVolumeNodesOutput.java b/bindings/java/src/main/java/org/wickra/HighLowVolumeNodesOutput.java new file mode 100644 index 00000000..c5210ec8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighLowVolumeNodesOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record HighLowVolumeNodesOutput(double hvn, double lvn) {} diff --git a/bindings/java/src/main/java/org/wickra/HighWave.java b/bindings/java/src/main/java/org/wickra/HighWave.java new file mode 100644 index 00000000..00666670 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighWave.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HighWave indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HighWave implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HighWave() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIGH_WAVE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HighWave parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIGH_WAVE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HIGH_WAVE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HIGH_WAVE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIGH_WAVE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HighpassFilter.java b/bindings/java/src/main/java/org/wickra/HighpassFilter.java new file mode 100644 index 00000000..1f663740 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HighpassFilter.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HighpassFilter indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HighpassFilter implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HighpassFilter(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIGHPASS_FILTER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HighpassFilter parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIGHPASS_FILTER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HIGHPASS_FILTER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HIGHPASS_FILTER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIGHPASS_FILTER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Hikkake.java b/bindings/java/src/main/java/org/wickra/Hikkake.java new file mode 100644 index 00000000..afad5b84 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Hikkake.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Hikkake indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Hikkake implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Hikkake() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIKKAKE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Hikkake parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIKKAKE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HIKKAKE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HIKKAKE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIKKAKE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HikkakeModified.java b/bindings/java/src/main/java/org/wickra/HikkakeModified.java new file mode 100644 index 00000000..e9894960 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HikkakeModified.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HikkakeModified indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HikkakeModified implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HikkakeModified() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HIKKAKE_MODIFIED_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HikkakeModified parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HIKKAKE_MODIFIED_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HIKKAKE_MODIFIED_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HIKKAKE_MODIFIED_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HIKKAKE_MODIFIED_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HilbertDominantCycle.java b/bindings/java/src/main/java/org/wickra/HilbertDominantCycle.java new file mode 100644 index 00000000..83761a05 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HilbertDominantCycle.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HilbertDominantCycle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HilbertDominantCycle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HilbertDominantCycle() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HILBERT_DOMINANT_CYCLE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HilbertDominantCycle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HILBERT_DOMINANT_CYCLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HILBERT_DOMINANT_CYCLE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HILBERT_DOMINANT_CYCLE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HILBERT_DOMINANT_CYCLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HistoricalVolatility.java b/bindings/java/src/main/java/org/wickra/HistoricalVolatility.java new file mode 100644 index 00000000..d50f7251 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HistoricalVolatility.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HistoricalVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HistoricalVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HistoricalVolatility(int period, int tradingPeriods) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (tradingPeriods < 0) { + throw new IllegalArgumentException("tradingPeriods must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HISTORICAL_VOLATILITY_NEW.invokeExact((long) period, (long) tradingPeriods); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HistoricalVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HISTORICAL_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HISTORICAL_VOLATILITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HISTORICAL_VOLATILITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HISTORICAL_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Hma.java b/bindings/java/src/main/java/org/wickra/Hma.java new file mode 100644 index 00000000..dda2b805 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Hma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Hma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Hma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Hma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Hma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HoltWinters.java b/bindings/java/src/main/java/org/wickra/HoltWinters.java new file mode 100644 index 00000000..103fccb9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HoltWinters.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HoltWinters indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HoltWinters implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HoltWinters(double alpha, double beta) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HOLT_WINTERS_NEW.invokeExact(alpha, beta); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HoltWinters parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HOLT_WINTERS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HOLT_WINTERS_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HOLT_WINTERS_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HOLT_WINTERS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HomingPigeon.java b/bindings/java/src/main/java/org/wickra/HomingPigeon.java new file mode 100644 index 00000000..40798f63 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HomingPigeon.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HomingPigeon indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HomingPigeon implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HomingPigeon() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HOMING_PIGEON_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HomingPigeon parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HOMING_PIGEON_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_HOMING_PIGEON_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HOMING_PIGEON_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HOMING_PIGEON_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HtDcPhase.java b/bindings/java/src/main/java/org/wickra/HtDcPhase.java new file mode 100644 index 00000000..9bc8e789 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HtDcPhase.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HtDcPhase indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HtDcPhase implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HtDcPhase() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HT_DC_PHASE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HtDcPhase parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HT_DC_PHASE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HT_DC_PHASE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HT_DC_PHASE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HT_DC_PHASE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HtPhasor.java b/bindings/java/src/main/java/org/wickra/HtPhasor.java new file mode 100644 index 00000000..b861e325 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HtPhasor.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HtPhasor indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HtPhasor implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HtPhasor() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HT_PHASOR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HtPhasor parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HT_PHASOR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public HtPhasorOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_HT_PHASOR_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new HtPhasorOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HT_PHASOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HtPhasorOutput.java b/bindings/java/src/main/java/org/wickra/HtPhasorOutput.java new file mode 100644 index 00000000..17d70109 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HtPhasorOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record HtPhasorOutput(double inphase, double quadrature) {} diff --git a/bindings/java/src/main/java/org/wickra/HtTrendMode.java b/bindings/java/src/main/java/org/wickra/HtTrendMode.java new file mode 100644 index 00000000..154b23d7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HtTrendMode.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HtTrendMode indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HtTrendMode implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HtTrendMode() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HT_TREND_MODE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HtTrendMode parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HT_TREND_MODE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HT_TREND_MODE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HT_TREND_MODE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HT_TREND_MODE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HurstChannel.java b/bindings/java/src/main/java/org/wickra/HurstChannel.java new file mode 100644 index 00000000..7dd50236 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HurstChannel.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HurstChannel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HurstChannel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HurstChannel(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HURST_CHANNEL_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HurstChannel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HURST_CHANNEL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public HurstChannelOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_HURST_CHANNEL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new HurstChannelOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HURST_CHANNEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/HurstChannelOutput.java b/bindings/java/src/main/java/org/wickra/HurstChannelOutput.java new file mode 100644 index 00000000..632a9f2d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HurstChannelOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record HurstChannelOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/HurstExponent.java b/bindings/java/src/main/java/org/wickra/HurstExponent.java new file mode 100644 index 00000000..b0a783a8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/HurstExponent.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming HurstExponent indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class HurstExponent implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public HurstExponent(int period, int chunks) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (chunks < 0) { + throw new IllegalArgumentException("chunks must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_HURST_EXPONENT_NEW.invokeExact((long) period, (long) chunks); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid HurstExponent parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_HURST_EXPONENT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_HURST_EXPONENT_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_HURST_EXPONENT_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_HURST_EXPONENT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Ichimoku.java b/bindings/java/src/main/java/org/wickra/Ichimoku.java new file mode 100644 index 00000000..17c8fa46 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Ichimoku.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Ichimoku indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Ichimoku implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Ichimoku(int tenkanPeriod, int kijunPeriod, int senkouBPeriod, int displacement) { + if (tenkanPeriod < 0) { + throw new IllegalArgumentException("tenkanPeriod must be non-negative"); + } + if (kijunPeriod < 0) { + throw new IllegalArgumentException("kijunPeriod must be non-negative"); + } + if (senkouBPeriod < 0) { + throw new IllegalArgumentException("senkouBPeriod must be non-negative"); + } + if (displacement < 0) { + throw new IllegalArgumentException("displacement must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ICHIMOKU_NEW.invokeExact((long) tenkanPeriod, (long) kijunPeriod, (long) senkouBPeriod, (long) displacement); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Ichimoku parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ICHIMOKU_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public IchimokuOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_ICHIMOKU_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new IchimokuOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ICHIMOKU_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/IchimokuOutput.java b/bindings/java/src/main/java/org/wickra/IchimokuOutput.java new file mode 100644 index 00000000..a11509fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/IchimokuOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record IchimokuOutput(double tenkan, double kijun, double senkouA, double senkouB, double chikou) {} diff --git a/bindings/java/src/main/java/org/wickra/IdenticalThreeCrows.java b/bindings/java/src/main/java/org/wickra/IdenticalThreeCrows.java new file mode 100644 index 00000000..6555c17a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/IdenticalThreeCrows.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming IdenticalThreeCrows indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class IdenticalThreeCrows implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public IdenticalThreeCrows() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_IDENTICAL_THREE_CROWS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid IdenticalThreeCrows parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_IDENTICAL_THREE_CROWS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_IDENTICAL_THREE_CROWS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_IDENTICAL_THREE_CROWS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_IDENTICAL_THREE_CROWS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ImbalanceBar.java b/bindings/java/src/main/java/org/wickra/ImbalanceBar.java new file mode 100644 index 00000000..bc9a7272 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ImbalanceBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ImbalanceBar(double open, double high, double low, double close, double imbalance, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/ImbalanceBars.java b/bindings/java/src/main/java/org/wickra/ImbalanceBars.java new file mode 100644 index 00000000..b267193c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ImbalanceBars.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ImbalanceBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ImbalanceBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ImbalanceBars(double threshold) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_IMBALANCE_BARS_NEW.invokeExact(threshold); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ImbalanceBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_IMBALANCE_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public ImbalanceBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(48L * cap); + long n = (long) NativeMethods.WICKRA_IMBALANCE_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new ImbalanceBar[0]; + } + ImbalanceBar[] result = new ImbalanceBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 48L; + result[i] = new ImbalanceBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L), + out.get(JAVA_DOUBLE, b + 24L), + out.get(JAVA_DOUBLE, b + 32L), + (double) out.get(JAVA_BYTE, b + 40L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_IMBALANCE_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InNeck.java b/bindings/java/src/main/java/org/wickra/InNeck.java new file mode 100644 index 00000000..c5e1831c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InNeck.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InNeck indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InNeck implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InNeck() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_IN_NECK_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InNeck parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_IN_NECK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_IN_NECK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_IN_NECK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_IN_NECK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Inertia.java b/bindings/java/src/main/java/org/wickra/Inertia.java new file mode 100644 index 00000000..89f96a1d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Inertia.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Inertia indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Inertia implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Inertia(int rviPeriod, int linregPeriod) { + if (rviPeriod < 0) { + throw new IllegalArgumentException("rviPeriod must be non-negative"); + } + if (linregPeriod < 0) { + throw new IllegalArgumentException("linregPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INERTIA_NEW.invokeExact((long) rviPeriod, (long) linregPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Inertia parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INERTIA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_INERTIA_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INERTIA_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INERTIA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InformationRatio.java b/bindings/java/src/main/java/org/wickra/InformationRatio.java new file mode 100644 index 00000000..9cc8e2e2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InformationRatio.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InformationRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InformationRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InformationRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INFORMATION_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InformationRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INFORMATION_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_INFORMATION_RATIO_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INFORMATION_RATIO_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INFORMATION_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InitialBalance.java b/bindings/java/src/main/java/org/wickra/InitialBalance.java new file mode 100644 index 00000000..a22864c4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InitialBalance.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InitialBalance indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InitialBalance implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InitialBalance(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INITIAL_BALANCE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InitialBalance parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INITIAL_BALANCE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public InitialBalanceOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_INITIAL_BALANCE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new InitialBalanceOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INITIAL_BALANCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InitialBalanceOutput.java b/bindings/java/src/main/java/org/wickra/InitialBalanceOutput.java new file mode 100644 index 00000000..d48ab3a1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InitialBalanceOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record InitialBalanceOutput(double high, double low) {} diff --git a/bindings/java/src/main/java/org/wickra/InstantaneousTrendline.java b/bindings/java/src/main/java/org/wickra/InstantaneousTrendline.java new file mode 100644 index 00000000..28ae9a7b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InstantaneousTrendline.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InstantaneousTrendline indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InstantaneousTrendline implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InstantaneousTrendline(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INSTANTANEOUS_TRENDLINE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InstantaneousTrendline parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INSTANTANEOUS_TRENDLINE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_INSTANTANEOUS_TRENDLINE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INSTANTANEOUS_TRENDLINE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INSTANTANEOUS_TRENDLINE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/IntradayIntensity.java b/bindings/java/src/main/java/org/wickra/IntradayIntensity.java new file mode 100644 index 00000000..e4e3c643 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/IntradayIntensity.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming IntradayIntensity indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class IntradayIntensity implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public IntradayIntensity() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INTRADAY_INTENSITY_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid IntradayIntensity parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INTRADAY_INTENSITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_INTRADAY_INTENSITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INTRADAY_INTENSITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INTRADAY_INTENSITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/IntradayMomentumIndex.java b/bindings/java/src/main/java/org/wickra/IntradayMomentumIndex.java new file mode 100644 index 00000000..5da8d84d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/IntradayMomentumIndex.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming IntradayMomentumIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class IntradayMomentumIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public IntradayMomentumIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INTRADAY_MOMENTUM_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid IntradayMomentumIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INTRADAY_MOMENTUM_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_INTRADAY_MOMENTUM_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INTRADAY_MOMENTUM_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INTRADAY_MOMENTUM_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/IntradayVolatilityProfile.java b/bindings/java/src/main/java/org/wickra/IntradayVolatilityProfile.java new file mode 100644 index 00000000..563f4c02 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/IntradayVolatilityProfile.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming IntradayVolatilityProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class IntradayVolatilityProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public IntradayVolatilityProfile(int buckets, int utcOffsetMinutes) { + if (buckets < 0) { + throw new IllegalArgumentException("buckets must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INTRADAY_VOLATILITY_PROFILE_NEW.invokeExact((long) buckets, utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid IntradayVolatilityProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INTRADAY_VOLATILITY_PROFILE_FREE); + this.valuesCapacity = buckets; + } + + /** Push one observation; returns the profile values, or null during warmup. */ + public double[] update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_INTRADAY_VOLATILITY_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return v; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INTRADAY_VOLATILITY_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InverseFisherTransform.java b/bindings/java/src/main/java/org/wickra/InverseFisherTransform.java new file mode 100644 index 00000000..b1f14b71 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InverseFisherTransform.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InverseFisherTransform indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InverseFisherTransform implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InverseFisherTransform(double scale) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INVERSE_FISHER_TRANSFORM_NEW.invokeExact(scale); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InverseFisherTransform parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INVERSE_FISHER_TRANSFORM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_INVERSE_FISHER_TRANSFORM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INVERSE_FISHER_TRANSFORM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INVERSE_FISHER_TRANSFORM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/InvertedHammer.java b/bindings/java/src/main/java/org/wickra/InvertedHammer.java new file mode 100644 index 00000000..c65c0f85 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/InvertedHammer.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming InvertedHammer indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class InvertedHammer implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public InvertedHammer() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_INVERTED_HAMMER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid InvertedHammer parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_INVERTED_HAMMER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_INVERTED_HAMMER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_INVERTED_HAMMER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_INVERTED_HAMMER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/JarqueBera.java b/bindings/java/src/main/java/org/wickra/JarqueBera.java new file mode 100644 index 00000000..c4db25ab --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/JarqueBera.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming JarqueBera indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class JarqueBera implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public JarqueBera(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_JARQUE_BERA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid JarqueBera parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_JARQUE_BERA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_JARQUE_BERA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_JARQUE_BERA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_JARQUE_BERA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Jma.java b/bindings/java/src/main/java/org/wickra/Jma.java new file mode 100644 index 00000000..ff9fd8e4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Jma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Jma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Jma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Jma(int period, double phase, int power) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_JMA_NEW.invokeExact((long) period, phase, power); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Jma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_JMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_JMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_JMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_JMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/JumpIndicator.java b/bindings/java/src/main/java/org/wickra/JumpIndicator.java new file mode 100644 index 00000000..a4d0e999 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/JumpIndicator.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming JumpIndicator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class JumpIndicator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public JumpIndicator(int period, double threshold) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_JUMP_INDICATOR_NEW.invokeExact((long) period, threshold); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid JumpIndicator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_JUMP_INDICATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_JUMP_INDICATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_JUMP_INDICATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_JUMP_INDICATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KRatio.java b/bindings/java/src/main/java/org/wickra/KRatio.java new file mode 100644 index 00000000..55bf3775 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_K_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_K_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_K_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_K_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_K_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KagiBar.java b/bindings/java/src/main/java/org/wickra/KagiBar.java new file mode 100644 index 00000000..d8e0d0d4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KagiBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KagiBar(double start, double end, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/KagiBars.java b/bindings/java/src/main/java/org/wickra/KagiBars.java new file mode 100644 index 00000000..7e959d6e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KagiBars.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KagiBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KagiBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KagiBars(double reversal) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KAGI_BARS_NEW.invokeExact(reversal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KagiBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KAGI_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public KagiBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_KAGI_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new KagiBar[0]; + } + KagiBar[] result = new KagiBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new KagiBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + (double) out.get(JAVA_BYTE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KAGI_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KalmanHedgeRatio.java b/bindings/java/src/main/java/org/wickra/KalmanHedgeRatio.java new file mode 100644 index 00000000..1331fc4e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KalmanHedgeRatio.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KalmanHedgeRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KalmanHedgeRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KalmanHedgeRatio(double delta, double observationVar) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KALMAN_HEDGE_RATIO_NEW.invokeExact(delta, observationVar); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KalmanHedgeRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KALMAN_HEDGE_RATIO_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public KalmanHedgeRatioOutput update(double x, double y) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_KALMAN_HEDGE_RATIO_UPDATE.invokeExact(handle, x, y, out); + if (ok == 0) { + return null; + } + return new KalmanHedgeRatioOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KALMAN_HEDGE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KalmanHedgeRatioOutput.java b/bindings/java/src/main/java/org/wickra/KalmanHedgeRatioOutput.java new file mode 100644 index 00000000..ba7ccfee --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KalmanHedgeRatioOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KalmanHedgeRatioOutput(double hedgeRatio, double intercept, double spread) {} diff --git a/bindings/java/src/main/java/org/wickra/Kama.java b/bindings/java/src/main/java/org/wickra/Kama.java new file mode 100644 index 00000000..538a7669 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Kama.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Kama indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Kama implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Kama(int erPeriod, int fast, int slow) { + if (erPeriod < 0) { + throw new IllegalArgumentException("erPeriod must be non-negative"); + } + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KAMA_NEW.invokeExact((long) erPeriod, (long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Kama parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KAMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_KAMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KAMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KAMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KaseDevStop.java b/bindings/java/src/main/java/org/wickra/KaseDevStop.java new file mode 100644 index 00000000..19fdd8b1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KaseDevStop.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KaseDevStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KaseDevStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KaseDevStop(int period, double dev) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KASE_DEV_STOP_NEW.invokeExact((long) period, dev); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KaseDevStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KASE_DEV_STOP_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public KaseDevStopOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_KASE_DEV_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new KaseDevStopOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KASE_DEV_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KaseDevStopOutput.java b/bindings/java/src/main/java/org/wickra/KaseDevStopOutput.java new file mode 100644 index 00000000..077fa547 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KaseDevStopOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KaseDevStopOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/KasePermissionStochastic.java b/bindings/java/src/main/java/org/wickra/KasePermissionStochastic.java new file mode 100644 index 00000000..372a9a6e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KasePermissionStochastic.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KasePermissionStochastic indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KasePermissionStochastic implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KasePermissionStochastic(int length, int smooth) { + if (length < 0) { + throw new IllegalArgumentException("length must be non-negative"); + } + if (smooth < 0) { + throw new IllegalArgumentException("smooth must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KASE_PERMISSION_STOCHASTIC_NEW.invokeExact((long) length, (long) smooth); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KasePermissionStochastic parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KASE_PERMISSION_STOCHASTIC_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public KasePermissionStochasticOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_KASE_PERMISSION_STOCHASTIC_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new KasePermissionStochasticOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KASE_PERMISSION_STOCHASTIC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KasePermissionStochasticOutput.java b/bindings/java/src/main/java/org/wickra/KasePermissionStochasticOutput.java new file mode 100644 index 00000000..27dda088 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KasePermissionStochasticOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KasePermissionStochasticOutput(double fast, double slow) {} diff --git a/bindings/java/src/main/java/org/wickra/KellyCriterion.java b/bindings/java/src/main/java/org/wickra/KellyCriterion.java new file mode 100644 index 00000000..273cc98f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KellyCriterion.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KellyCriterion indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KellyCriterion implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KellyCriterion(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KELLY_CRITERION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KellyCriterion parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KELLY_CRITERION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_KELLY_CRITERION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KELLY_CRITERION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KELLY_CRITERION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Keltner.java b/bindings/java/src/main/java/org/wickra/Keltner.java new file mode 100644 index 00000000..38262e0c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Keltner.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Keltner indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Keltner implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Keltner(int emaPeriod, int atrPeriod, double multiplier) { + if (emaPeriod < 0) { + throw new IllegalArgumentException("emaPeriod must be non-negative"); + } + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KELTNER_NEW.invokeExact((long) emaPeriod, (long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Keltner parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KELTNER_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public KeltnerOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_KELTNER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new KeltnerOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KELTNER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KeltnerOutput.java b/bindings/java/src/main/java/org/wickra/KeltnerOutput.java new file mode 100644 index 00000000..a5654850 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KeltnerOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KeltnerOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/KendallTau.java b/bindings/java/src/main/java/org/wickra/KendallTau.java new file mode 100644 index 00000000..ba642a02 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KendallTau.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KendallTau indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KendallTau implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KendallTau(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KENDALL_TAU_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KendallTau parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KENDALL_TAU_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_KENDALL_TAU_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KENDALL_TAU_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KENDALL_TAU_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Kicking.java b/bindings/java/src/main/java/org/wickra/Kicking.java new file mode 100644 index 00000000..730a9c57 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Kicking.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Kicking indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Kicking implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Kicking() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KICKING_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Kicking parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KICKING_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_KICKING_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KICKING_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KICKING_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KickingByLength.java b/bindings/java/src/main/java/org/wickra/KickingByLength.java new file mode 100644 index 00000000..4510dbdb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KickingByLength.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KickingByLength indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KickingByLength implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KickingByLength() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KICKING_BY_LENGTH_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KickingByLength parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KICKING_BY_LENGTH_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_KICKING_BY_LENGTH_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KICKING_BY_LENGTH_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KICKING_BY_LENGTH_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Kst.java b/bindings/java/src/main/java/org/wickra/Kst.java new file mode 100644 index 00000000..51b3954d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Kst.java @@ -0,0 +1,85 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Kst indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Kst implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Kst(int roc1, int roc2, int roc3, int roc4, int sma1, int sma2, int sma3, int sma4, int signal) { + if (roc1 < 0) { + throw new IllegalArgumentException("roc1 must be non-negative"); + } + if (roc2 < 0) { + throw new IllegalArgumentException("roc2 must be non-negative"); + } + if (roc3 < 0) { + throw new IllegalArgumentException("roc3 must be non-negative"); + } + if (roc4 < 0) { + throw new IllegalArgumentException("roc4 must be non-negative"); + } + if (sma1 < 0) { + throw new IllegalArgumentException("sma1 must be non-negative"); + } + if (sma2 < 0) { + throw new IllegalArgumentException("sma2 must be non-negative"); + } + if (sma3 < 0) { + throw new IllegalArgumentException("sma3 must be non-negative"); + } + if (sma4 < 0) { + throw new IllegalArgumentException("sma4 must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KST_NEW.invokeExact((long) roc1, (long) roc2, (long) roc3, (long) roc4, (long) sma1, (long) sma2, (long) sma3, (long) sma4, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Kst parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KST_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public KstOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_KST_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new KstOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KST_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KstOutput.java b/bindings/java/src/main/java/org/wickra/KstOutput.java new file mode 100644 index 00000000..0bdc741d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KstOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record KstOutput(double kst, double signal) {} diff --git a/bindings/java/src/main/java/org/wickra/Kurtosis.java b/bindings/java/src/main/java/org/wickra/Kurtosis.java new file mode 100644 index 00000000..a7c39fed --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Kurtosis.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Kurtosis indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Kurtosis implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Kurtosis(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KURTOSIS_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Kurtosis parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KURTOSIS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_KURTOSIS_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KURTOSIS_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KURTOSIS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Kvo.java b/bindings/java/src/main/java/org/wickra/Kvo.java new file mode 100644 index 00000000..f5a4553f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Kvo.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Kvo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Kvo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Kvo(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KVO_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Kvo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KVO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_KVO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_KVO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KVO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/KylesLambda.java b/bindings/java/src/main/java/org/wickra/KylesLambda.java new file mode 100644 index 00000000..b52b78ac --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/KylesLambda.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming KylesLambda indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class KylesLambda implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public KylesLambda(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_KYLES_LAMBDA_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid KylesLambda parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_KYLES_LAMBDA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp, double mid) { + try { + return (double) NativeMethods.WICKRA_KYLES_LAMBDA_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp, mid); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_KYLES_LAMBDA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LadderBottom.java b/bindings/java/src/main/java/org/wickra/LadderBottom.java new file mode 100644 index 00000000..3c2ba1ba --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LadderBottom.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LadderBottom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LadderBottom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LadderBottom() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LADDER_BOTTOM_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LadderBottom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LADDER_BOTTOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_LADDER_BOTTOM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LADDER_BOTTOM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LADDER_BOTTOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LaguerreRsi.java b/bindings/java/src/main/java/org/wickra/LaguerreRsi.java new file mode 100644 index 00000000..ab67a06f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LaguerreRsi.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LaguerreRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LaguerreRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LaguerreRsi(double gamma) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LAGUERRE_RSI_NEW.invokeExact(gamma); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LaguerreRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LAGUERRE_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LAGUERRE_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LAGUERRE_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LAGUERRE_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelation.java b/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelation.java new file mode 100644 index 00000000..a3196c6c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelation.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LeadLagCrossCorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LeadLagCrossCorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LeadLagCrossCorrelation(int window, int maxLag) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + if (maxLag < 0) { + throw new IllegalArgumentException("maxLag must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LEAD_LAG_CROSS_CORRELATION_NEW.invokeExact((long) window, (long) maxLag); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LeadLagCrossCorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LEAD_LAG_CROSS_CORRELATION_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public LeadLagCrossCorrelationOutput update(double x, double y) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_LEAD_LAG_CROSS_CORRELATION_UPDATE.invokeExact(handle, x, y, out); + if (ok == 0) { + return null; + } + return new LeadLagCrossCorrelationOutput( + (double) out.get(JAVA_LONG, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LEAD_LAG_CROSS_CORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelationOutput.java b/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelationOutput.java new file mode 100644 index 00000000..ab1ddb7f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LeadLagCrossCorrelationOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record LeadLagCrossCorrelationOutput(double lag, double correlation) {} diff --git a/bindings/java/src/main/java/org/wickra/LinRegAngle.java b/bindings/java/src/main/java/org/wickra/LinRegAngle.java new file mode 100644 index 00000000..9477f666 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinRegAngle.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LinRegAngle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LinRegAngle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LinRegAngle(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LIN_REG_ANGLE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LinRegAngle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LIN_REG_ANGLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LIN_REG_ANGLE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LIN_REG_ANGLE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LIN_REG_ANGLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LinRegChannel.java b/bindings/java/src/main/java/org/wickra/LinRegChannel.java new file mode 100644 index 00000000..9b473baa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinRegChannel.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LinRegChannel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LinRegChannel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LinRegChannel(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LIN_REG_CHANNEL_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LinRegChannel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LIN_REG_CHANNEL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public LinRegChannelOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_LIN_REG_CHANNEL_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new LinRegChannelOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LIN_REG_CHANNEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LinRegChannelOutput.java b/bindings/java/src/main/java/org/wickra/LinRegChannelOutput.java new file mode 100644 index 00000000..45b8efbf --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinRegChannelOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record LinRegChannelOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/LinRegIntercept.java b/bindings/java/src/main/java/org/wickra/LinRegIntercept.java new file mode 100644 index 00000000..8ed8223a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinRegIntercept.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LinRegIntercept indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LinRegIntercept implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LinRegIntercept(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LIN_REG_INTERCEPT_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LinRegIntercept parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LIN_REG_INTERCEPT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LIN_REG_INTERCEPT_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LIN_REG_INTERCEPT_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LIN_REG_INTERCEPT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LinRegSlope.java b/bindings/java/src/main/java/org/wickra/LinRegSlope.java new file mode 100644 index 00000000..bd61d486 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinRegSlope.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LinRegSlope indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LinRegSlope implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LinRegSlope(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LIN_REG_SLOPE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LinRegSlope parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LIN_REG_SLOPE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LIN_REG_SLOPE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LIN_REG_SLOPE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LIN_REG_SLOPE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LineBreakBar.java b/bindings/java/src/main/java/org/wickra/LineBreakBar.java new file mode 100644 index 00000000..499584b8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LineBreakBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record LineBreakBar(double open, double close, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/LinearRegression.java b/bindings/java/src/main/java/org/wickra/LinearRegression.java new file mode 100644 index 00000000..edce1160 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LinearRegression.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LinearRegression indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LinearRegression implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LinearRegression(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LINEAR_REGRESSION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LinearRegression parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LINEAR_REGRESSION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LINEAR_REGRESSION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LINEAR_REGRESSION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LINEAR_REGRESSION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LiquidationFeatures.java b/bindings/java/src/main/java/org/wickra/LiquidationFeatures.java new file mode 100644 index 00000000..3e657949 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LiquidationFeatures.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LiquidationFeatures indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LiquidationFeatures implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LiquidationFeatures() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LIQUIDATION_FEATURES_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LiquidationFeatures parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LIQUIDATION_FEATURES_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public LiquidationFeaturesOutput update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_LIQUIDATION_FEATURES_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp, out); + if (ok == 0) { + return null; + } + return new LiquidationFeaturesOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LIQUIDATION_FEATURES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LiquidationFeaturesOutput.java b/bindings/java/src/main/java/org/wickra/LiquidationFeaturesOutput.java new file mode 100644 index 00000000..cad531de --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LiquidationFeaturesOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record LiquidationFeaturesOutput(double long_, double short_, double net, double total, double imbalance) {} diff --git a/bindings/java/src/main/java/org/wickra/LogReturn.java b/bindings/java/src/main/java/org/wickra/LogReturn.java new file mode 100644 index 00000000..ef94e063 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LogReturn.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LogReturn indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LogReturn implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LogReturn(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LOG_RETURN_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LogReturn parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LOG_RETURN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_LOG_RETURN_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LOG_RETURN_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LOG_RETURN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LongLeggedDoji.java b/bindings/java/src/main/java/org/wickra/LongLeggedDoji.java new file mode 100644 index 00000000..bca7496b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LongLeggedDoji.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LongLeggedDoji indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LongLeggedDoji implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LongLeggedDoji() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LONG_LEGGED_DOJI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LongLeggedDoji parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LONG_LEGGED_DOJI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_LONG_LEGGED_DOJI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LONG_LEGGED_DOJI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LONG_LEGGED_DOJI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LongLine.java b/bindings/java/src/main/java/org/wickra/LongLine.java new file mode 100644 index 00000000..0a13e93c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LongLine.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LongLine indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LongLine implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LongLine() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LONG_LINE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LongLine parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LONG_LINE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_LONG_LINE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_LONG_LINE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LONG_LINE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/LongShortRatio.java b/bindings/java/src/main/java/org/wickra/LongShortRatio.java new file mode 100644 index 00000000..cd375956 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/LongShortRatio.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming LongShortRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class LongShortRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public LongShortRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_LONG_SHORT_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid LongShortRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_LONG_SHORT_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_LONG_SHORT_RATIO_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_LONG_SHORT_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/M2Measure.java b/bindings/java/src/main/java/org/wickra/M2Measure.java new file mode 100644 index 00000000..bab7e721 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/M2Measure.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming M2Measure indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class M2Measure implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public M2Measure(int period, double riskFree, double benchmarkStddev) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_M2_MEASURE_NEW.invokeExact((long) period, riskFree, benchmarkStddev); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid M2Measure parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_M2_MEASURE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_M2_MEASURE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_M2_MEASURE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_M2_MEASURE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MaEnvelope.java b/bindings/java/src/main/java/org/wickra/MaEnvelope.java new file mode 100644 index 00000000..5e88a73f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MaEnvelope.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MaEnvelope indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MaEnvelope implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MaEnvelope(int period, double percent) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MA_ENVELOPE_NEW.invokeExact((long) period, percent); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MaEnvelope parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MA_ENVELOPE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MaEnvelopeOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_MA_ENVELOPE_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MaEnvelopeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MA_ENVELOPE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MaEnvelopeOutput.java b/bindings/java/src/main/java/org/wickra/MaEnvelopeOutput.java new file mode 100644 index 00000000..42a761b0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MaEnvelopeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record MaEnvelopeOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/MacdExt.java b/bindings/java/src/main/java/org/wickra/MacdExt.java new file mode 100644 index 00000000..50e20d0c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MacdExt.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MacdExt indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MacdExt implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MacdExt(int fast, int fastType, int slow, int slowType, int signal, int signalType) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MACD_EXT_NEW.invokeExact((long) fast, fastType, (long) slow, slowType, (long) signal, signalType); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MacdExt parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MACD_EXT_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MacdOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_MACD_EXT_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MacdOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MACD_EXT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MacdFix.java b/bindings/java/src/main/java/org/wickra/MacdFix.java new file mode 100644 index 00000000..2da6a964 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MacdFix.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MacdFix indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MacdFix implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MacdFix(int signal) { + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MACD_FIX_NEW.invokeExact((long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MacdFix parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MACD_FIX_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MacdOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_MACD_FIX_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MacdOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MACD_FIX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MacdHistogram.java b/bindings/java/src/main/java/org/wickra/MacdHistogram.java new file mode 100644 index 00000000..20e06788 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MacdHistogram.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MacdHistogram indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MacdHistogram implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MacdHistogram(int fast, int slow, int signal) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MACD_HISTOGRAM_NEW.invokeExact((long) fast, (long) slow, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MacdHistogram parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MACD_HISTOGRAM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MACD_HISTOGRAM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MACD_HISTOGRAM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MACD_HISTOGRAM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MacdIndicator.java b/bindings/java/src/main/java/org/wickra/MacdIndicator.java new file mode 100644 index 00000000..e48a3ab5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MacdIndicator.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MacdIndicator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MacdIndicator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MacdIndicator(int fast, int slow, int signal) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MACD_INDICATOR_NEW.invokeExact((long) fast, (long) slow, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MacdIndicator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MACD_INDICATOR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MacdOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_MACD_INDICATOR_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MacdOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MACD_INDICATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MacdOutput.java b/bindings/java/src/main/java/org/wickra/MacdOutput.java new file mode 100644 index 00000000..33478576 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MacdOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record MacdOutput(double macd, double signal, double histogram) {} diff --git a/bindings/java/src/main/java/org/wickra/Mama.java b/bindings/java/src/main/java/org/wickra/Mama.java new file mode 100644 index 00000000..7b9c6b80 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Mama.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Mama indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Mama implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Mama(double fastLimit, double slowLimit) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MAMA_NEW.invokeExact(fastLimit, slowLimit); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Mama parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MAMA_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MamaOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_MAMA_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MamaOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MAMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MamaOutput.java b/bindings/java/src/main/java/org/wickra/MamaOutput.java new file mode 100644 index 00000000..e3cbb355 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MamaOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record MamaOutput(double mama, double fama) {} diff --git a/bindings/java/src/main/java/org/wickra/MarketFacilitationIndex.java b/bindings/java/src/main/java/org/wickra/MarketFacilitationIndex.java new file mode 100644 index 00000000..e8a9f3d4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MarketFacilitationIndex.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MarketFacilitationIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MarketFacilitationIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MarketFacilitationIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MARKET_FACILITATION_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MarketFacilitationIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MARKET_FACILITATION_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MARKET_FACILITATION_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MARKET_FACILITATION_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MARKET_FACILITATION_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MartinRatio.java b/bindings/java/src/main/java/org/wickra/MartinRatio.java new file mode 100644 index 00000000..c82ccc26 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MartinRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MartinRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MartinRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MartinRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MARTIN_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MartinRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MARTIN_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MARTIN_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MARTIN_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MARTIN_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Marubozu.java b/bindings/java/src/main/java/org/wickra/Marubozu.java new file mode 100644 index 00000000..0f8fc6a7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Marubozu.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Marubozu indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Marubozu implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Marubozu() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MARUBOZU_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Marubozu parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MARUBOZU_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MARUBOZU_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MARUBOZU_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MARUBOZU_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MassIndex.java b/bindings/java/src/main/java/org/wickra/MassIndex.java new file mode 100644 index 00000000..245aa275 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MassIndex.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MassIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MassIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MassIndex(int emaPeriod, int sumPeriod) { + if (emaPeriod < 0) { + throw new IllegalArgumentException("emaPeriod must be non-negative"); + } + if (sumPeriod < 0) { + throw new IllegalArgumentException("sumPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MASS_INDEX_NEW.invokeExact((long) emaPeriod, (long) sumPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MassIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MASS_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MASS_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MASS_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MASS_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MatHold.java b/bindings/java/src/main/java/org/wickra/MatHold.java new file mode 100644 index 00000000..c7872e56 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MatHold.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MatHold indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MatHold implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MatHold() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MAT_HOLD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MatHold parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MAT_HOLD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MAT_HOLD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MAT_HOLD_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MAT_HOLD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MatchingLow.java b/bindings/java/src/main/java/org/wickra/MatchingLow.java new file mode 100644 index 00000000..ecb1d922 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MatchingLow.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MatchingLow indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MatchingLow implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MatchingLow() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MATCHING_LOW_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MatchingLow parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MATCHING_LOW_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MATCHING_LOW_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MATCHING_LOW_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MATCHING_LOW_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MaxDrawdown.java b/bindings/java/src/main/java/org/wickra/MaxDrawdown.java new file mode 100644 index 00000000..0e430f3d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MaxDrawdown.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MaxDrawdown indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MaxDrawdown implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MaxDrawdown(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MAX_DRAWDOWN_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MaxDrawdown parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MAX_DRAWDOWN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MAX_DRAWDOWN_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MAX_DRAWDOWN_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MAX_DRAWDOWN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/McClellanOscillator.java b/bindings/java/src/main/java/org/wickra/McClellanOscillator.java new file mode 100644 index 00000000..bc452399 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/McClellanOscillator.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming McClellanOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class McClellanOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public McClellanOscillator() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MC_CLELLAN_OSCILLATOR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid McClellanOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MC_CLELLAN_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_MC_CLELLAN_OSCILLATOR_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MC_CLELLAN_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/McClellanSummationIndex.java b/bindings/java/src/main/java/org/wickra/McClellanSummationIndex.java new file mode 100644 index 00000000..7033a4c8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/McClellanSummationIndex.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming McClellanSummationIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class McClellanSummationIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public McClellanSummationIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MC_CLELLAN_SUMMATION_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid McClellanSummationIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MC_CLELLAN_SUMMATION_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_MC_CLELLAN_SUMMATION_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MC_CLELLAN_SUMMATION_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/McGinleyDynamic.java b/bindings/java/src/main/java/org/wickra/McGinleyDynamic.java new file mode 100644 index 00000000..0280b5c8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/McGinleyDynamic.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming McGinleyDynamic indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class McGinleyDynamic implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public McGinleyDynamic(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MC_GINLEY_DYNAMIC_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid McGinleyDynamic parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MC_GINLEY_DYNAMIC_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MC_GINLEY_DYNAMIC_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MC_GINLEY_DYNAMIC_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MC_GINLEY_DYNAMIC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MedianAbsoluteDeviation.java b/bindings/java/src/main/java/org/wickra/MedianAbsoluteDeviation.java new file mode 100644 index 00000000..05dc1184 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MedianAbsoluteDeviation.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MedianAbsoluteDeviation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MedianAbsoluteDeviation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MedianAbsoluteDeviation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MEDIAN_ABSOLUTE_DEVIATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MedianAbsoluteDeviation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MEDIAN_ABSOLUTE_DEVIATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MEDIAN_ABSOLUTE_DEVIATION_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MEDIAN_ABSOLUTE_DEVIATION_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MEDIAN_ABSOLUTE_DEVIATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MedianChannel.java b/bindings/java/src/main/java/org/wickra/MedianChannel.java new file mode 100644 index 00000000..01b80d91 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MedianChannel.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MedianChannel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MedianChannel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MedianChannel(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MEDIAN_CHANNEL_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MedianChannel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MEDIAN_CHANNEL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MedianChannelOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_MEDIAN_CHANNEL_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new MedianChannelOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MEDIAN_CHANNEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MedianChannelOutput.java b/bindings/java/src/main/java/org/wickra/MedianChannelOutput.java new file mode 100644 index 00000000..3128eee0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MedianChannelOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record MedianChannelOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/MedianMa.java b/bindings/java/src/main/java/org/wickra/MedianMa.java new file mode 100644 index 00000000..855d0882 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MedianMa.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MedianMa indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MedianMa implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MedianMa(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MEDIAN_MA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MedianMa parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MEDIAN_MA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MEDIAN_MA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MEDIAN_MA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MEDIAN_MA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MedianPrice.java b/bindings/java/src/main/java/org/wickra/MedianPrice.java new file mode 100644 index 00000000..bfef062a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MedianPrice.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MedianPrice indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MedianPrice implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MedianPrice() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MEDIAN_PRICE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MedianPrice parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MEDIAN_PRICE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MEDIAN_PRICE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MEDIAN_PRICE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MEDIAN_PRICE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Mfi.java b/bindings/java/src/main/java/org/wickra/Mfi.java new file mode 100644 index 00000000..768f300b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Mfi.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Mfi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Mfi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Mfi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MFI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Mfi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MFI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MFI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MFI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MFI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Microprice.java b/bindings/java/src/main/java/org/wickra/Microprice.java new file mode 100644 index 00000000..be3362f5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Microprice.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Microprice indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Microprice implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Microprice() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MICROPRICE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Microprice parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MICROPRICE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_MICROPRICE_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MICROPRICE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MidPoint.java b/bindings/java/src/main/java/org/wickra/MidPoint.java new file mode 100644 index 00000000..0fc1d416 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MidPoint.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MidPoint indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MidPoint implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MidPoint(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MID_POINT_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MidPoint parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MID_POINT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MID_POINT_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MID_POINT_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MID_POINT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MidPrice.java b/bindings/java/src/main/java/org/wickra/MidPrice.java new file mode 100644 index 00000000..e004ed5b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MidPrice.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MidPrice indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MidPrice implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MidPrice(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MID_PRICE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MidPrice parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MID_PRICE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MID_PRICE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MID_PRICE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MID_PRICE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MinusDi.java b/bindings/java/src/main/java/org/wickra/MinusDi.java new file mode 100644 index 00000000..10f5dab0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MinusDi.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MinusDi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MinusDi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MinusDi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MINUS_DI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MinusDi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MINUS_DI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MINUS_DI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MINUS_DI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MINUS_DI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MinusDm.java b/bindings/java/src/main/java/org/wickra/MinusDm.java new file mode 100644 index 00000000..5978b749 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MinusDm.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MinusDm indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MinusDm implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MinusDm(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MINUS_DM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MinusDm parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MINUS_DM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MINUS_DM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MINUS_DM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MINUS_DM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ModifiedMaStop.java b/bindings/java/src/main/java/org/wickra/ModifiedMaStop.java new file mode 100644 index 00000000..396ee895 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ModifiedMaStop.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ModifiedMaStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ModifiedMaStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ModifiedMaStop(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MODIFIED_MA_STOP_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ModifiedMaStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MODIFIED_MA_STOP_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ModifiedMaStopOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_MODIFIED_MA_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ModifiedMaStopOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MODIFIED_MA_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ModifiedMaStopOutput.java b/bindings/java/src/main/java/org/wickra/ModifiedMaStopOutput.java new file mode 100644 index 00000000..cc8c2efa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ModifiedMaStopOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ModifiedMaStopOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/Mom.java b/bindings/java/src/main/java/org/wickra/Mom.java new file mode 100644 index 00000000..934ad0f8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Mom.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Mom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Mom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Mom(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MOM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Mom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_MOM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MOM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MorningDojiStar.java b/bindings/java/src/main/java/org/wickra/MorningDojiStar.java new file mode 100644 index 00000000..0edcda6f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MorningDojiStar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MorningDojiStar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MorningDojiStar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MorningDojiStar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MORNING_DOJI_STAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MorningDojiStar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MORNING_DOJI_STAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MORNING_DOJI_STAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MORNING_DOJI_STAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MORNING_DOJI_STAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MorningEveningStar.java b/bindings/java/src/main/java/org/wickra/MorningEveningStar.java new file mode 100644 index 00000000..600522e4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MorningEveningStar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MorningEveningStar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MorningEveningStar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MorningEveningStar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MORNING_EVENING_STAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MorningEveningStar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MORNING_EVENING_STAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_MORNING_EVENING_STAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_MORNING_EVENING_STAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MORNING_EVENING_STAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MurreyMathLines.java b/bindings/java/src/main/java/org/wickra/MurreyMathLines.java new file mode 100644 index 00000000..da3efad4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MurreyMathLines.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming MurreyMathLines indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class MurreyMathLines implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public MurreyMathLines(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_MURREY_MATH_LINES_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid MurreyMathLines parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_MURREY_MATH_LINES_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public MurreyMathLinesOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(72L); + byte ok = (byte) NativeMethods.WICKRA_MURREY_MATH_LINES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new MurreyMathLinesOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L), + out.get(JAVA_DOUBLE, 40L), + out.get(JAVA_DOUBLE, 48L), + out.get(JAVA_DOUBLE, 56L), + out.get(JAVA_DOUBLE, 64L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_MURREY_MATH_LINES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/MurreyMathLinesOutput.java b/bindings/java/src/main/java/org/wickra/MurreyMathLinesOutput.java new file mode 100644 index 00000000..05aea60f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/MurreyMathLinesOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record MurreyMathLinesOutput(double mm88, double mm78, double mm68, double mm58, double mm48, double mm38, double mm28, double mm18, double mm08) {} diff --git a/bindings/java/src/main/java/org/wickra/NakedPoc.java b/bindings/java/src/main/java/org/wickra/NakedPoc.java new file mode 100644 index 00000000..0aa16e9e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/NakedPoc.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming NakedPoc indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class NakedPoc implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public NakedPoc(int sessionLen, int bins) { + if (sessionLen < 0) { + throw new IllegalArgumentException("sessionLen must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NAKED_POC_NEW.invokeExact((long) sessionLen, (long) bins); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid NakedPoc parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NAKED_POC_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_NAKED_POC_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_NAKED_POC_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NAKED_POC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Natr.java b/bindings/java/src/main/java/org/wickra/Natr.java new file mode 100644 index 00000000..9894d431 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Natr.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Natr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Natr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Natr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NATR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Natr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NATR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_NATR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_NATR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NATR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/NewHighsNewLows.java b/bindings/java/src/main/java/org/wickra/NewHighsNewLows.java new file mode 100644 index 00000000..61e83105 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/NewHighsNewLows.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming NewHighsNewLows indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class NewHighsNewLows implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public NewHighsNewLows() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NEW_HIGHS_NEW_LOWS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid NewHighsNewLows parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NEW_HIGHS_NEW_LOWS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_NEW_HIGHS_NEW_LOWS_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NEW_HIGHS_NEW_LOWS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/NewPriceLines.java b/bindings/java/src/main/java/org/wickra/NewPriceLines.java new file mode 100644 index 00000000..01f6696c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/NewPriceLines.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming NewPriceLines indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class NewPriceLines implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public NewPriceLines(int count) { + if (count < 0) { + throw new IllegalArgumentException("count must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NEW_PRICE_LINES_NEW.invokeExact((long) count); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid NewPriceLines parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NEW_PRICE_LINES_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_NEW_PRICE_LINES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_NEW_PRICE_LINES_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NEW_PRICE_LINES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Nrtr.java b/bindings/java/src/main/java/org/wickra/Nrtr.java new file mode 100644 index 00000000..8dc462be --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Nrtr.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Nrtr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Nrtr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Nrtr(double pct) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NRTR_NEW.invokeExact(pct); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Nrtr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NRTR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public NrtrOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_NRTR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new NrtrOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NRTR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/NrtrOutput.java b/bindings/java/src/main/java/org/wickra/NrtrOutput.java new file mode 100644 index 00000000..bab54521 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/NrtrOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record NrtrOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/Nvi.java b/bindings/java/src/main/java/org/wickra/Nvi.java new file mode 100644 index 00000000..bc1a3687 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Nvi.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Nvi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Nvi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Nvi() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_NVI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Nvi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_NVI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_NVI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_NVI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_NVI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OIPriceDivergence.java b/bindings/java/src/main/java/org/wickra/OIPriceDivergence.java new file mode 100644 index 00000000..38c876ef --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OIPriceDivergence.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OIPriceDivergence indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OIPriceDivergence implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OIPriceDivergence(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OI_PRICE_DIVERGENCE_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OIPriceDivergence parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OI_PRICE_DIVERGENCE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OI_PRICE_DIVERGENCE_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OI_PRICE_DIVERGENCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OIWeighted.java b/bindings/java/src/main/java/org/wickra/OIWeighted.java new file mode 100644 index 00000000..d300b4e8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OIWeighted.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OIWeighted indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OIWeighted implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OIWeighted() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OI_WEIGHTED_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OIWeighted parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OI_WEIGHTED_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OI_WEIGHTED_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OI_WEIGHTED_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Obv.java b/bindings/java/src/main/java/org/wickra/Obv.java new file mode 100644 index 00000000..9419cd0d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Obv.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Obv indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Obv implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Obv() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OBV_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Obv parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OBV_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OBV_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_OBV_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OBV_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OiToVolumeRatio.java b/bindings/java/src/main/java/org/wickra/OiToVolumeRatio.java new file mode 100644 index 00000000..6be3cf6f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OiToVolumeRatio.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OiToVolumeRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OiToVolumeRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OiToVolumeRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OI_TO_VOLUME_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OiToVolumeRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OI_TO_VOLUME_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OI_TO_VOLUME_RATIO_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OI_TO_VOLUME_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OmegaRatio.java b/bindings/java/src/main/java/org/wickra/OmegaRatio.java new file mode 100644 index 00000000..80624221 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OmegaRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OmegaRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OmegaRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OmegaRatio(int period, double threshold) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OMEGA_RATIO_NEW.invokeExact((long) period, threshold); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OmegaRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OMEGA_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_OMEGA_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_OMEGA_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OMEGA_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OnNeck.java b/bindings/java/src/main/java/org/wickra/OnNeck.java new file mode 100644 index 00000000..42a75a55 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OnNeck.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OnNeck indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OnNeck implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OnNeck() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ON_NECK_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OnNeck parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ON_NECK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ON_NECK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ON_NECK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ON_NECK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OpenInterestDelta.java b/bindings/java/src/main/java/org/wickra/OpenInterestDelta.java new file mode 100644 index 00000000..04e7a4ba --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OpenInterestDelta.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OpenInterestDelta indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OpenInterestDelta implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OpenInterestDelta() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OPEN_INTEREST_DELTA_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OpenInterestDelta parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OPEN_INTEREST_DELTA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OPEN_INTEREST_DELTA_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OPEN_INTEREST_DELTA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OpenInterestMomentum.java b/bindings/java/src/main/java/org/wickra/OpenInterestMomentum.java new file mode 100644 index 00000000..0911a452 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OpenInterestMomentum.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OpenInterestMomentum indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OpenInterestMomentum implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OpenInterestMomentum(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OPEN_INTEREST_MOMENTUM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OpenInterestMomentum parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OPEN_INTEREST_MOMENTUM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OPEN_INTEREST_MOMENTUM_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OPEN_INTEREST_MOMENTUM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OpeningMarubozu.java b/bindings/java/src/main/java/org/wickra/OpeningMarubozu.java new file mode 100644 index 00000000..ef4a077e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OpeningMarubozu.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OpeningMarubozu indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OpeningMarubozu implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OpeningMarubozu() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OPENING_MARUBOZU_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OpeningMarubozu parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OPENING_MARUBOZU_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OPENING_MARUBOZU_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_OPENING_MARUBOZU_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OPENING_MARUBOZU_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OpeningRange.java b/bindings/java/src/main/java/org/wickra/OpeningRange.java new file mode 100644 index 00000000..9c3f50d3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OpeningRange.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OpeningRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OpeningRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OpeningRange(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OPENING_RANGE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OpeningRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OPENING_RANGE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public OpeningRangeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_OPENING_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new OpeningRangeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OPENING_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OpeningRangeOutput.java b/bindings/java/src/main/java/org/wickra/OpeningRangeOutput.java new file mode 100644 index 00000000..dcafa25a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OpeningRangeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record OpeningRangeOutput(double high, double low, double breakoutDistance) {} diff --git a/bindings/java/src/main/java/org/wickra/OrderBookImbalanceFull.java b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceFull.java new file mode 100644 index 00000000..f78c8f89 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceFull.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OrderBookImbalanceFull indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OrderBookImbalanceFull implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OrderBookImbalanceFull() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_FULL_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OrderBookImbalanceFull parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_FULL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_FULL_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_FULL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTop1.java b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTop1.java new file mode 100644 index 00000000..d0d90e48 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTop1.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OrderBookImbalanceTop1 indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OrderBookImbalanceTop1 implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OrderBookImbalanceTop1() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP1_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OrderBookImbalanceTop1 parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP1_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP1_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP1_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTopN.java b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTopN.java new file mode 100644 index 00000000..5b1b3d0c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OrderBookImbalanceTopN.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OrderBookImbalanceTopN indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OrderBookImbalanceTopN implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OrderBookImbalanceTopN(int levels) { + if (levels < 0) { + throw new IllegalArgumentException("levels must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_NEW.invokeExact((long) levels); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OrderBookImbalanceTopN parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OrderFlowImbalance.java b/bindings/java/src/main/java/org/wickra/OrderFlowImbalance.java new file mode 100644 index 00000000..ed6c4fe4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OrderFlowImbalance.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OrderFlowImbalance indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OrderFlowImbalance implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OrderFlowImbalance(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ORDER_FLOW_IMBALANCE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OrderFlowImbalance parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ORDER_FLOW_IMBALANCE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_ORDER_FLOW_IMBALANCE_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ORDER_FLOW_IMBALANCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OuHalfLife.java b/bindings/java/src/main/java/org/wickra/OuHalfLife.java new file mode 100644 index 00000000..31d34c96 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OuHalfLife.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OuHalfLife indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OuHalfLife implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OuHalfLife(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OU_HALF_LIFE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OuHalfLife parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OU_HALF_LIFE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_OU_HALF_LIFE_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_OU_HALF_LIFE_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OU_HALF_LIFE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OvernightGap.java b/bindings/java/src/main/java/org/wickra/OvernightGap.java new file mode 100644 index 00000000..d95af9b1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OvernightGap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OvernightGap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OvernightGap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OvernightGap(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OVERNIGHT_GAP_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OvernightGap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OVERNIGHT_GAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_OVERNIGHT_GAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_OVERNIGHT_GAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OVERNIGHT_GAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OvernightIntradayReturn.java b/bindings/java/src/main/java/org/wickra/OvernightIntradayReturn.java new file mode 100644 index 00000000..46a4c39c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OvernightIntradayReturn.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming OvernightIntradayReturn indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class OvernightIntradayReturn implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public OvernightIntradayReturn(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_OVERNIGHT_INTRADAY_RETURN_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid OvernightIntradayReturn parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_OVERNIGHT_INTRADAY_RETURN_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public OvernightIntradayReturnOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_OVERNIGHT_INTRADAY_RETURN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new OvernightIntradayReturnOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_OVERNIGHT_INTRADAY_RETURN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/OvernightIntradayReturnOutput.java b/bindings/java/src/main/java/org/wickra/OvernightIntradayReturnOutput.java new file mode 100644 index 00000000..8ea4b353 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/OvernightIntradayReturnOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record OvernightIntradayReturnOutput(double overnight, double intraday) {} diff --git a/bindings/java/src/main/java/org/wickra/PainIndex.java b/bindings/java/src/main/java/org/wickra/PainIndex.java new file mode 100644 index 00000000..57f0acca --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PainIndex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PainIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PainIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PainIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PAIN_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PainIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PAIN_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PAIN_INDEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PAIN_INDEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PAIN_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PairSpreadZScore.java b/bindings/java/src/main/java/org/wickra/PairSpreadZScore.java new file mode 100644 index 00000000..1d084db9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PairSpreadZScore.java @@ -0,0 +1,76 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PairSpreadZScore indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PairSpreadZScore implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PairSpreadZScore(int betaPeriod, int zPeriod) { + if (betaPeriod < 0) { + throw new IllegalArgumentException("betaPeriod must be non-negative"); + } + if (zPeriod < 0) { + throw new IllegalArgumentException("zPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PAIR_SPREAD_Z_SCORE_NEW.invokeExact((long) betaPeriod, (long) zPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PairSpreadZScore parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PAIR_SPREAD_Z_SCORE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_PAIR_SPREAD_Z_SCORE_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PAIR_SPREAD_Z_SCORE_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PAIR_SPREAD_Z_SCORE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PairwiseBeta.java b/bindings/java/src/main/java/org/wickra/PairwiseBeta.java new file mode 100644 index 00000000..0bc88ac8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PairwiseBeta.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PairwiseBeta indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PairwiseBeta implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PairwiseBeta(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PAIRWISE_BETA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PairwiseBeta parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PAIRWISE_BETA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_PAIRWISE_BETA_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PAIRWISE_BETA_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PAIRWISE_BETA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ParkinsonVolatility.java b/bindings/java/src/main/java/org/wickra/ParkinsonVolatility.java new file mode 100644 index 00000000..f9ecf08b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ParkinsonVolatility.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ParkinsonVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ParkinsonVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ParkinsonVolatility(int period, int tradingPeriods) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (tradingPeriods < 0) { + throw new IllegalArgumentException("tradingPeriods must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PARKINSON_VOLATILITY_NEW.invokeExact((long) period, (long) tradingPeriods); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ParkinsonVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PARKINSON_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PARKINSON_VOLATILITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PARKINSON_VOLATILITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PARKINSON_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PearsonCorrelation.java b/bindings/java/src/main/java/org/wickra/PearsonCorrelation.java new file mode 100644 index 00000000..63b0d4cf --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PearsonCorrelation.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PearsonCorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PearsonCorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PearsonCorrelation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PEARSON_CORRELATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PearsonCorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PEARSON_CORRELATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_PEARSON_CORRELATION_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PEARSON_CORRELATION_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PEARSON_CORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PercentAboveMa.java b/bindings/java/src/main/java/org/wickra/PercentAboveMa.java new file mode 100644 index 00000000..02bac08e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PercentAboveMa.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PercentAboveMa indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PercentAboveMa implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PercentAboveMa() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PERCENT_ABOVE_MA_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PercentAboveMa parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PERCENT_ABOVE_MA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_PERCENT_ABOVE_MA_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PERCENT_ABOVE_MA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PercentB.java b/bindings/java/src/main/java/org/wickra/PercentB.java new file mode 100644 index 00000000..18a69cb2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PercentB.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PercentB indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PercentB implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PercentB(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PERCENT_B_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PercentB parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PERCENT_B_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PERCENT_B_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PERCENT_B_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PERCENT_B_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PercentageTrailingStop.java b/bindings/java/src/main/java/org/wickra/PercentageTrailingStop.java new file mode 100644 index 00000000..cf2dada7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PercentageTrailingStop.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PercentageTrailingStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PercentageTrailingStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PercentageTrailingStop(double percent) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PERCENTAGE_TRAILING_STOP_NEW.invokeExact(percent); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PercentageTrailingStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PERCENTAGE_TRAILING_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PERCENTAGE_TRAILING_STOP_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PERCENTAGE_TRAILING_STOP_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PERCENTAGE_TRAILING_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PerpetualPremiumIndex.java b/bindings/java/src/main/java/org/wickra/PerpetualPremiumIndex.java new file mode 100644 index 00000000..955976b5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PerpetualPremiumIndex.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PerpetualPremiumIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PerpetualPremiumIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PerpetualPremiumIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PERPETUAL_PREMIUM_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PerpetualPremiumIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PERPETUAL_PREMIUM_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PERPETUAL_PREMIUM_INDEX_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PERPETUAL_PREMIUM_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Pgo.java b/bindings/java/src/main/java/org/wickra/Pgo.java new file mode 100644 index 00000000..02e1e5a9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Pgo.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Pgo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Pgo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Pgo(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PGO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Pgo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PGO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PGO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PGO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PGO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PiercingDarkCloud.java b/bindings/java/src/main/java/org/wickra/PiercingDarkCloud.java new file mode 100644 index 00000000..bf8da7bb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PiercingDarkCloud.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PiercingDarkCloud indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PiercingDarkCloud implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PiercingDarkCloud() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PIERCING_DARK_CLOUD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PiercingDarkCloud parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PIERCING_DARK_CLOUD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PIERCING_DARK_CLOUD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PIERCING_DARK_CLOUD_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PIERCING_DARK_CLOUD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Pin.java b/bindings/java/src/main/java/org/wickra/Pin.java new file mode 100644 index 00000000..13b9e621 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Pin.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Pin indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Pin implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Pin(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PIN_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Pin parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PIN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PIN_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PIN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PivotReversal.java b/bindings/java/src/main/java/org/wickra/PivotReversal.java new file mode 100644 index 00000000..0a0273bb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PivotReversal.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PivotReversal indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PivotReversal implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PivotReversal(int left, int right) { + if (left < 0) { + throw new IllegalArgumentException("left must be non-negative"); + } + if (right < 0) { + throw new IllegalArgumentException("right must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PIVOT_REVERSAL_NEW.invokeExact((long) left, (long) right); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PivotReversal parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PIVOT_REVERSAL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PIVOT_REVERSAL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PIVOT_REVERSAL_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PIVOT_REVERSAL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PlusDi.java b/bindings/java/src/main/java/org/wickra/PlusDi.java new file mode 100644 index 00000000..26c76828 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PlusDi.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PlusDi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PlusDi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PlusDi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PLUS_DI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PlusDi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PLUS_DI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PLUS_DI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PLUS_DI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PLUS_DI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PlusDm.java b/bindings/java/src/main/java/org/wickra/PlusDm.java new file mode 100644 index 00000000..da9e3f29 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PlusDm.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PlusDm indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PlusDm implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PlusDm(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PLUS_DM_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PlusDm parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PLUS_DM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PLUS_DM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PLUS_DM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PLUS_DM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Pmo.java b/bindings/java/src/main/java/org/wickra/Pmo.java new file mode 100644 index 00000000..78aea686 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Pmo.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Pmo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Pmo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Pmo(int smoothing1, int smoothing2) { + if (smoothing1 < 0) { + throw new IllegalArgumentException("smoothing1 must be non-negative"); + } + if (smoothing2 < 0) { + throw new IllegalArgumentException("smoothing2 must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PMO_NEW.invokeExact((long) smoothing1, (long) smoothing2); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Pmo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PMO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PMO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PMO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PMO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PnfColumn.java b/bindings/java/src/main/java/org/wickra/PnfColumn.java new file mode 100644 index 00000000..0c990a85 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PnfColumn.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record PnfColumn(double direction, double high, double low) {} diff --git a/bindings/java/src/main/java/org/wickra/PointAndFigureBars.java b/bindings/java/src/main/java/org/wickra/PointAndFigureBars.java new file mode 100644 index 00000000..f63269e9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PointAndFigureBars.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PointAndFigureBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PointAndFigureBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PointAndFigureBars(double boxSize, int reversal) { + if (reversal < 0) { + throw new IllegalArgumentException("reversal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_POINT_AND_FIGURE_BARS_NEW.invokeExact(boxSize, (long) reversal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PointAndFigureBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_POINT_AND_FIGURE_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public PnfColumn[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_POINT_AND_FIGURE_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new PnfColumn[0]; + } + PnfColumn[] result = new PnfColumn[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new PnfColumn( + (double) out.get(JAVA_BYTE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_POINT_AND_FIGURE_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PolarizedFractalEfficiency.java b/bindings/java/src/main/java/org/wickra/PolarizedFractalEfficiency.java new file mode 100644 index 00000000..ac919493 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PolarizedFractalEfficiency.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PolarizedFractalEfficiency indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PolarizedFractalEfficiency implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PolarizedFractalEfficiency(int period, int smoothing) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (smoothing < 0) { + throw new IllegalArgumentException("smoothing must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_POLARIZED_FRACTAL_EFFICIENCY_NEW.invokeExact((long) period, (long) smoothing); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PolarizedFractalEfficiency parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_POLARIZED_FRACTAL_EFFICIENCY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_POLARIZED_FRACTAL_EFFICIENCY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_POLARIZED_FRACTAL_EFFICIENCY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_POLARIZED_FRACTAL_EFFICIENCY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Ppo.java b/bindings/java/src/main/java/org/wickra/Ppo.java new file mode 100644 index 00000000..8c80ec1c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Ppo.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Ppo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Ppo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Ppo(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PPO_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Ppo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PPO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PPO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PPO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PPO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/PpoHistogram.java b/bindings/java/src/main/java/org/wickra/PpoHistogram.java new file mode 100644 index 00000000..cb2a3a1f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/PpoHistogram.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming PpoHistogram indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class PpoHistogram implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public PpoHistogram(int fast, int slow, int signal) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PPO_HISTOGRAM_NEW.invokeExact((long) fast, (long) slow, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid PpoHistogram parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PPO_HISTOGRAM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PPO_HISTOGRAM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PPO_HISTOGRAM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PPO_HISTOGRAM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ProfileShape.java b/bindings/java/src/main/java/org/wickra/ProfileShape.java new file mode 100644 index 00000000..e857403c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ProfileShape.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ProfileShape indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ProfileShape implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ProfileShape(int period, int bins) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PROFILE_SHAPE_NEW.invokeExact((long) period, (long) bins); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ProfileShape parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PROFILE_SHAPE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PROFILE_SHAPE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PROFILE_SHAPE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PROFILE_SHAPE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ProfitFactor.java b/bindings/java/src/main/java/org/wickra/ProfitFactor.java new file mode 100644 index 00000000..d4133b55 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ProfitFactor.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ProfitFactor indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ProfitFactor implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ProfitFactor(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PROFIT_FACTOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ProfitFactor parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PROFIT_FACTOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_PROFIT_FACTOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PROFIT_FACTOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PROFIT_FACTOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ProjectionBands.java b/bindings/java/src/main/java/org/wickra/ProjectionBands.java new file mode 100644 index 00000000..dec1233f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ProjectionBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ProjectionBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ProjectionBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ProjectionBands(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PROJECTION_BANDS_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ProjectionBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PROJECTION_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ProjectionBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_PROJECTION_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ProjectionBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PROJECTION_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ProjectionBandsOutput.java b/bindings/java/src/main/java/org/wickra/ProjectionBandsOutput.java new file mode 100644 index 00000000..25ac0fe2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ProjectionBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ProjectionBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/ProjectionOscillator.java b/bindings/java/src/main/java/org/wickra/ProjectionOscillator.java new file mode 100644 index 00000000..12d51eb1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ProjectionOscillator.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ProjectionOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ProjectionOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ProjectionOscillator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PROJECTION_OSCILLATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ProjectionOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PROJECTION_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PROJECTION_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PROJECTION_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PROJECTION_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Psar.java b/bindings/java/src/main/java/org/wickra/Psar.java new file mode 100644 index 00000000..0088c69f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Psar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Psar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Psar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Psar(double afStart, double afStep, double afMax) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PSAR_NEW.invokeExact(afStart, afStep, afMax); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Psar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PSAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PSAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PSAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PSAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Pvi.java b/bindings/java/src/main/java/org/wickra/Pvi.java new file mode 100644 index 00000000..b3f97601 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Pvi.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Pvi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Pvi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Pvi() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_PVI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Pvi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_PVI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_PVI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_PVI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_PVI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Qqe.java b/bindings/java/src/main/java/org/wickra/Qqe.java new file mode 100644 index 00000000..f56b771b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Qqe.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Qqe indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Qqe implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Qqe(int rsiPeriod, int smoothing, double factor) { + if (rsiPeriod < 0) { + throw new IllegalArgumentException("rsiPeriod must be non-negative"); + } + if (smoothing < 0) { + throw new IllegalArgumentException("smoothing must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_QQE_NEW.invokeExact((long) rsiPeriod, (long) smoothing, factor); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Qqe parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_QQE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public QqeOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_QQE_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new QqeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_QQE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/QqeOutput.java b/bindings/java/src/main/java/org/wickra/QqeOutput.java new file mode 100644 index 00000000..1926dbd1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/QqeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record QqeOutput(double rsiMa, double trailingLine) {} diff --git a/bindings/java/src/main/java/org/wickra/Qstick.java b/bindings/java/src/main/java/org/wickra/Qstick.java new file mode 100644 index 00000000..261b065e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Qstick.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Qstick indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Qstick implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Qstick(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_QSTICK_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Qstick parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_QSTICK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_QSTICK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_QSTICK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_QSTICK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/QuartileBands.java b/bindings/java/src/main/java/org/wickra/QuartileBands.java new file mode 100644 index 00000000..6b20fec8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/QuartileBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming QuartileBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class QuartileBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public QuartileBands(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_QUARTILE_BANDS_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid QuartileBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_QUARTILE_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public QuartileBandsOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_QUARTILE_BANDS_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new QuartileBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_QUARTILE_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/QuartileBandsOutput.java b/bindings/java/src/main/java/org/wickra/QuartileBandsOutput.java new file mode 100644 index 00000000..83e91d2e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/QuartileBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record QuartileBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/QuotedSpread.java b/bindings/java/src/main/java/org/wickra/QuotedSpread.java new file mode 100644 index 00000000..00584ee8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/QuotedSpread.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming QuotedSpread indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class QuotedSpread implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public QuotedSpread() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_QUOTED_SPREAD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid QuotedSpread parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_QUOTED_SPREAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] bidPrice, double[] bidSize, double[] askPrice, double[] askSize) { + if (bidSize.length != bidPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (askSize.length != askPrice.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment bidPriceSeg = a.allocateFrom(JAVA_DOUBLE, bidPrice); + MemorySegment bidSizeSeg = a.allocateFrom(JAVA_DOUBLE, bidSize); + MemorySegment askPriceSeg = a.allocateFrom(JAVA_DOUBLE, askPrice); + MemorySegment askSizeSeg = a.allocateFrom(JAVA_DOUBLE, askSize); + return (double) NativeMethods.WICKRA_QUOTED_SPREAD_UPDATE.invokeExact(handle, bidPriceSeg, bidSizeSeg, (long) bidPrice.length, askPriceSeg, askSizeSeg, (long) askPrice.length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_QUOTED_SPREAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RSquared.java b/bindings/java/src/main/java/org/wickra/RSquared.java new file mode 100644 index 00000000..86c66ece --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RSquared.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RSquared indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RSquared implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RSquared(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_R_SQUARED_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RSquared parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_R_SQUARED_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_R_SQUARED_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_R_SQUARED_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_R_SQUARED_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RangeBar.java b/bindings/java/src/main/java/org/wickra/RangeBar.java new file mode 100644 index 00000000..ae4e3007 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RangeBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record RangeBar(double open, double close, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/RangeBars.java b/bindings/java/src/main/java/org/wickra/RangeBars.java new file mode 100644 index 00000000..769a6f8a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RangeBars.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RangeBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RangeBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RangeBars(double range) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RANGE_BARS_NEW.invokeExact(range); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RangeBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RANGE_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public RangeBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_RANGE_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new RangeBar[0]; + } + RangeBar[] result = new RangeBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new RangeBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + (double) out.get(JAVA_BYTE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RANGE_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RealizedSpread.java b/bindings/java/src/main/java/org/wickra/RealizedSpread.java new file mode 100644 index 00000000..a4ea490c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RealizedSpread.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RealizedSpread indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RealizedSpread implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RealizedSpread(int horizon) { + if (horizon < 0) { + throw new IllegalArgumentException("horizon must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_REALIZED_SPREAD_NEW.invokeExact((long) horizon); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RealizedSpread parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_REALIZED_SPREAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp, double mid) { + try { + return (double) NativeMethods.WICKRA_REALIZED_SPREAD_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp, mid); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_REALIZED_SPREAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RealizedVolatility.java b/bindings/java/src/main/java/org/wickra/RealizedVolatility.java new file mode 100644 index 00000000..898a51fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RealizedVolatility.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RealizedVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RealizedVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RealizedVolatility(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_REALIZED_VOLATILITY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RealizedVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_REALIZED_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_REALIZED_VOLATILITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_REALIZED_VOLATILITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_REALIZED_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RecoveryFactor.java b/bindings/java/src/main/java/org/wickra/RecoveryFactor.java new file mode 100644 index 00000000..6606e4c4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RecoveryFactor.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RecoveryFactor indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RecoveryFactor implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RecoveryFactor() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RECOVERY_FACTOR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RecoveryFactor parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RECOVERY_FACTOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RECOVERY_FACTOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RECOVERY_FACTOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RECOVERY_FACTOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RectangleRange.java b/bindings/java/src/main/java/org/wickra/RectangleRange.java new file mode 100644 index 00000000..10dd5492 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RectangleRange.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RectangleRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RectangleRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RectangleRange() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RECTANGLE_RANGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RectangleRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RECTANGLE_RANGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_RECTANGLE_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RECTANGLE_RANGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RECTANGLE_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Reflex.java b/bindings/java/src/main/java/org/wickra/Reflex.java new file mode 100644 index 00000000..aab57b9c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Reflex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Reflex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Reflex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Reflex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_REFLEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Reflex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_REFLEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_REFLEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_REFLEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_REFLEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RegimeLabel.java b/bindings/java/src/main/java/org/wickra/RegimeLabel.java new file mode 100644 index 00000000..d89c7203 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RegimeLabel.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RegimeLabel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RegimeLabel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RegimeLabel(int volPeriod, int lookback) { + if (volPeriod < 0) { + throw new IllegalArgumentException("volPeriod must be non-negative"); + } + if (lookback < 0) { + throw new IllegalArgumentException("lookback must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_REGIME_LABEL_NEW.invokeExact((long) volPeriod, (long) lookback); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RegimeLabel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_REGIME_LABEL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_REGIME_LABEL_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_REGIME_LABEL_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_REGIME_LABEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RelativeStrengthAB.java b/bindings/java/src/main/java/org/wickra/RelativeStrengthAB.java new file mode 100644 index 00000000..0d494664 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RelativeStrengthAB.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RelativeStrengthAB indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RelativeStrengthAB implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RelativeStrengthAB(int maPeriod, int rsiPeriod) { + if (maPeriod < 0) { + throw new IllegalArgumentException("maPeriod must be non-negative"); + } + if (rsiPeriod < 0) { + throw new IllegalArgumentException("rsiPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RELATIVE_STRENGTH_AB_NEW.invokeExact((long) maPeriod, (long) rsiPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RelativeStrengthAB parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RELATIVE_STRENGTH_AB_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public RelativeStrengthOutput update(double x, double y) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_RELATIVE_STRENGTH_AB_UPDATE.invokeExact(handle, x, y, out); + if (ok == 0) { + return null; + } + return new RelativeStrengthOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RELATIVE_STRENGTH_AB_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RelativeStrengthOutput.java b/bindings/java/src/main/java/org/wickra/RelativeStrengthOutput.java new file mode 100644 index 00000000..db4406af --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RelativeStrengthOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record RelativeStrengthOutput(double ratio, double ratioMa, double ratioRsi) {} diff --git a/bindings/java/src/main/java/org/wickra/RenkoBars.java b/bindings/java/src/main/java/org/wickra/RenkoBars.java new file mode 100644 index 00000000..d5ee5558 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RenkoBars.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RenkoBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RenkoBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RenkoBars(double boxSize) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RENKO_BARS_NEW.invokeExact(boxSize); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RenkoBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RENKO_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public RenkoBrick[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_RENKO_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new RenkoBrick[0]; + } + RenkoBrick[] result = new RenkoBrick[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new RenkoBrick( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + (double) out.get(JAVA_BYTE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RENKO_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RenkoBrick.java b/bindings/java/src/main/java/org/wickra/RenkoBrick.java new file mode 100644 index 00000000..b0e79ff2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RenkoBrick.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record RenkoBrick(double open, double close, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/RenkoTrailingStop.java b/bindings/java/src/main/java/org/wickra/RenkoTrailingStop.java new file mode 100644 index 00000000..9d8ea478 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RenkoTrailingStop.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RenkoTrailingStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RenkoTrailingStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RenkoTrailingStop(double blockSize) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RENKO_TRAILING_STOP_NEW.invokeExact(blockSize); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RenkoTrailingStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RENKO_TRAILING_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RENKO_TRAILING_STOP_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RENKO_TRAILING_STOP_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RENKO_TRAILING_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RickshawMan.java b/bindings/java/src/main/java/org/wickra/RickshawMan.java new file mode 100644 index 00000000..d8d2a027 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RickshawMan.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RickshawMan indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RickshawMan implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RickshawMan() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RICKSHAW_MAN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RickshawMan parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RICKSHAW_MAN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_RICKSHAW_MAN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RICKSHAW_MAN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RICKSHAW_MAN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RisingThreeMethods.java b/bindings/java/src/main/java/org/wickra/RisingThreeMethods.java new file mode 100644 index 00000000..96a57ace --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RisingThreeMethods.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RisingThreeMethods indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RisingThreeMethods implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RisingThreeMethods() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RISING_THREE_METHODS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RisingThreeMethods parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RISING_THREE_METHODS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_RISING_THREE_METHODS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RISING_THREE_METHODS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RISING_THREE_METHODS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rmi.java b/bindings/java/src/main/java/org/wickra/Rmi.java new file mode 100644 index 00000000..2439591d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rmi.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rmi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rmi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rmi(int period, int momentum) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (momentum < 0) { + throw new IllegalArgumentException("momentum must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RMI_NEW.invokeExact((long) period, (long) momentum); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rmi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RMI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RMI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RMI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RMI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Roc.java b/bindings/java/src/main/java/org/wickra/Roc.java new file mode 100644 index 00000000..5172452f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Roc.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Roc indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Roc implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Roc(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROC_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Roc parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROC_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROC_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROC_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rocp.java b/bindings/java/src/main/java/org/wickra/Rocp.java new file mode 100644 index 00000000..1ae03afc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rocp.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rocp indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rocp implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rocp(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROCP_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rocp parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROCP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROCP_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROCP_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROCP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rocr.java b/bindings/java/src/main/java/org/wickra/Rocr.java new file mode 100644 index 00000000..4b728443 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rocr.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rocr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rocr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rocr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROCR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rocr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROCR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROCR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROCR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROCR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rocr100.java b/bindings/java/src/main/java/org/wickra/Rocr100.java new file mode 100644 index 00000000..c8273b2b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rocr100.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rocr100 indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rocr100 implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rocr100(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROCR100_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rocr100 parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROCR100_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROCR100_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROCR100_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROCR100_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RogersSatchellVolatility.java b/bindings/java/src/main/java/org/wickra/RogersSatchellVolatility.java new file mode 100644 index 00000000..a04dbcf9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RogersSatchellVolatility.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RogersSatchellVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RogersSatchellVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RogersSatchellVolatility(int period, int tradingPeriods) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (tradingPeriods < 0) { + throw new IllegalArgumentException("tradingPeriods must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROGERS_SATCHELL_VOLATILITY_NEW.invokeExact((long) period, (long) tradingPeriods); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RogersSatchellVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROGERS_SATCHELL_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ROGERS_SATCHELL_VOLATILITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROGERS_SATCHELL_VOLATILITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROGERS_SATCHELL_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollMeasure.java b/bindings/java/src/main/java/org/wickra/RollMeasure.java new file mode 100644 index 00000000..0219632d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollMeasure.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollMeasure indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollMeasure implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollMeasure(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLL_MEASURE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollMeasure parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLL_MEASURE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ROLL_MEASURE_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLL_MEASURE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingCorrelation.java b/bindings/java/src/main/java/org/wickra/RollingCorrelation.java new file mode 100644 index 00000000..4cd073ce --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingCorrelation.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingCorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingCorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingCorrelation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_CORRELATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingCorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_CORRELATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_ROLLING_CORRELATION_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_CORRELATION_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_CORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingCovariance.java b/bindings/java/src/main/java/org/wickra/RollingCovariance.java new file mode 100644 index 00000000..ecb69e86 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingCovariance.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingCovariance indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingCovariance implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingCovariance(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_COVARIANCE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingCovariance parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_COVARIANCE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_ROLLING_COVARIANCE_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_COVARIANCE_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_COVARIANCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingIqr.java b/bindings/java/src/main/java/org/wickra/RollingIqr.java new file mode 100644 index 00000000..dd42f807 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingIqr.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingIqr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingIqr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingIqr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_IQR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingIqr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_IQR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROLLING_IQR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_IQR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_IQR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingMinMaxScaler.java b/bindings/java/src/main/java/org/wickra/RollingMinMaxScaler.java new file mode 100644 index 00000000..62dfbff2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingMinMaxScaler.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingMinMaxScaler indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingMinMaxScaler implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingMinMaxScaler(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_MIN_MAX_SCALER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingMinMaxScaler parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_MIN_MAX_SCALER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROLLING_MIN_MAX_SCALER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_MIN_MAX_SCALER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_MIN_MAX_SCALER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingPercentileRank.java b/bindings/java/src/main/java/org/wickra/RollingPercentileRank.java new file mode 100644 index 00000000..db769177 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingPercentileRank.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingPercentileRank indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingPercentileRank implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingPercentileRank(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_PERCENTILE_RANK_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingPercentileRank parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_PERCENTILE_RANK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROLLING_PERCENTILE_RANK_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_PERCENTILE_RANK_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_PERCENTILE_RANK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingQuantile.java b/bindings/java/src/main/java/org/wickra/RollingQuantile.java new file mode 100644 index 00000000..8b7307a8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingQuantile.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingQuantile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingQuantile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingQuantile(int period, double quantile) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_QUANTILE_NEW.invokeExact((long) period, quantile); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingQuantile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_QUANTILE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROLLING_QUANTILE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_QUANTILE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_QUANTILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RollingVwap.java b/bindings/java/src/main/java/org/wickra/RollingVwap.java new file mode 100644 index 00000000..fd9462fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RollingVwap.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RollingVwap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RollingVwap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RollingVwap(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROLLING_VWAP_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RollingVwap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROLLING_VWAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ROLLING_VWAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROLLING_VWAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROLLING_VWAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RoofingFilter.java b/bindings/java/src/main/java/org/wickra/RoofingFilter.java new file mode 100644 index 00000000..0dade089 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RoofingFilter.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RoofingFilter indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RoofingFilter implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RoofingFilter(int lpPeriod, int hpPeriod) { + if (lpPeriod < 0) { + throw new IllegalArgumentException("lpPeriod must be non-negative"); + } + if (hpPeriod < 0) { + throw new IllegalArgumentException("hpPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ROOFING_FILTER_NEW.invokeExact((long) lpPeriod, (long) hpPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RoofingFilter parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ROOFING_FILTER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ROOFING_FILTER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ROOFING_FILTER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ROOFING_FILTER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rsi.java b/bindings/java/src/main/java/org/wickra/Rsi.java new file mode 100644 index 00000000..4b4b6ddb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rsi.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rsi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RSI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rsx.java b/bindings/java/src/main/java/org/wickra/Rsx.java new file mode 100644 index 00000000..2be91cb5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rsx.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rsx indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rsx implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rsx(int length) { + if (length < 0) { + throw new IllegalArgumentException("length must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RSX_NEW.invokeExact((long) length); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rsx parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RSX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RSX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RSX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RSX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RunBar.java b/bindings/java/src/main/java/org/wickra/RunBar.java new file mode 100644 index 00000000..eb838620 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RunBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record RunBar(double open, double high, double low, double close, double length, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/RunBars.java b/bindings/java/src/main/java/org/wickra/RunBars.java new file mode 100644 index 00000000..16cbda40 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RunBars.java @@ -0,0 +1,71 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RunBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RunBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RunBars(int runLength) { + if (runLength < 0) { + throw new IllegalArgumentException("runLength must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RUN_BARS_NEW.invokeExact((long) runLength); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RunBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RUN_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public RunBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(48L * cap); + long n = (long) NativeMethods.WICKRA_RUN_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new RunBar[0]; + } + RunBar[] result = new RunBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 48L; + result[i] = new RunBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L), + out.get(JAVA_DOUBLE, b + 24L), + (double) out.get(JAVA_LONG, b + 32L), + (double) out.get(JAVA_BYTE, b + 40L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RUN_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rvi.java b/bindings/java/src/main/java/org/wickra/Rvi.java new file mode 100644 index 00000000..8e81a077 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rvi.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rvi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rvi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rvi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RVI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rvi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RVI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_RVI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RVI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RVI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RviVolatility.java b/bindings/java/src/main/java/org/wickra/RviVolatility.java new file mode 100644 index 00000000..e94e50c3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RviVolatility.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming RviVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class RviVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public RviVolatility(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RVI_VOLATILITY_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid RviVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RVI_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_RVI_VOLATILITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_RVI_VOLATILITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RVI_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Rwi.java b/bindings/java/src/main/java/org/wickra/Rwi.java new file mode 100644 index 00000000..e41c53cd --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Rwi.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Rwi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Rwi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Rwi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_RWI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Rwi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_RWI_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public RwiOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_RWI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new RwiOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_RWI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/RwiOutput.java b/bindings/java/src/main/java/org/wickra/RwiOutput.java new file mode 100644 index 00000000..5b3371ba --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/RwiOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record RwiOutput(double high, double low) {} diff --git a/bindings/java/src/main/java/org/wickra/SampleEntropy.java b/bindings/java/src/main/java/org/wickra/SampleEntropy.java new file mode 100644 index 00000000..3db527c7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SampleEntropy.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SampleEntropy indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SampleEntropy implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SampleEntropy(int period, int m, double rFactor) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (m < 0) { + throw new IllegalArgumentException("m must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SAMPLE_ENTROPY_NEW.invokeExact((long) period, (long) m, rFactor); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SampleEntropy parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SAMPLE_ENTROPY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SAMPLE_ENTROPY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SAMPLE_ENTROPY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SAMPLE_ENTROPY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SarExt.java b/bindings/java/src/main/java/org/wickra/SarExt.java new file mode 100644 index 00000000..d59a8b00 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SarExt.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SarExt indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SarExt implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SarExt(double startValue, double offsetOnReverse, double accelInitLong, double accelLong, double accelMaxLong, double accelInitShort, double accelShort, double accelMaxShort) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SAR_EXT_NEW.invokeExact(startValue, offsetOnReverse, accelInitLong, accelLong, accelMaxLong, accelInitShort, accelShort, accelMaxShort); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SarExt parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SAR_EXT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SAR_EXT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SAR_EXT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SAR_EXT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SeasonalZScore.java b/bindings/java/src/main/java/org/wickra/SeasonalZScore.java new file mode 100644 index 00000000..f1f285de --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SeasonalZScore.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SeasonalZScore indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SeasonalZScore implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SeasonalZScore(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SEASONAL_Z_SCORE_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SeasonalZScore parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SEASONAL_Z_SCORE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SEASONAL_Z_SCORE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SEASONAL_Z_SCORE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SEASONAL_Z_SCORE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SeparatingLines.java b/bindings/java/src/main/java/org/wickra/SeparatingLines.java new file mode 100644 index 00000000..05fe46a3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SeparatingLines.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SeparatingLines indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SeparatingLines implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SeparatingLines() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SEPARATING_LINES_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SeparatingLines parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SEPARATING_LINES_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SEPARATING_LINES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SEPARATING_LINES_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SEPARATING_LINES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SessionHighLow.java b/bindings/java/src/main/java/org/wickra/SessionHighLow.java new file mode 100644 index 00000000..9f9648b4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SessionHighLow.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SessionHighLow indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SessionHighLow implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SessionHighLow(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SESSION_HIGH_LOW_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SessionHighLow parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SESSION_HIGH_LOW_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public SessionHighLowOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_SESSION_HIGH_LOW_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new SessionHighLowOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SESSION_HIGH_LOW_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SessionHighLowOutput.java b/bindings/java/src/main/java/org/wickra/SessionHighLowOutput.java new file mode 100644 index 00000000..c2a5d1aa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SessionHighLowOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record SessionHighLowOutput(double high, double low) {} diff --git a/bindings/java/src/main/java/org/wickra/SessionRange.java b/bindings/java/src/main/java/org/wickra/SessionRange.java new file mode 100644 index 00000000..6036597b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SessionRange.java @@ -0,0 +1,59 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SessionRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SessionRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SessionRange(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SESSION_RANGE_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SessionRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SESSION_RANGE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public SessionRangeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_SESSION_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new SessionRangeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SESSION_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SessionRangeOutput.java b/bindings/java/src/main/java/org/wickra/SessionRangeOutput.java new file mode 100644 index 00000000..3992b500 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SessionRangeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record SessionRangeOutput(double asia, double eu, double us) {} diff --git a/bindings/java/src/main/java/org/wickra/SessionVwap.java b/bindings/java/src/main/java/org/wickra/SessionVwap.java new file mode 100644 index 00000000..588a0484 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SessionVwap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SessionVwap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SessionVwap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SessionVwap(int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SESSION_VWAP_NEW.invokeExact(utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SessionVwap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SESSION_VWAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SESSION_VWAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SESSION_VWAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SESSION_VWAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ShannonEntropy.java b/bindings/java/src/main/java/org/wickra/ShannonEntropy.java new file mode 100644 index 00000000..87e8c795 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ShannonEntropy.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ShannonEntropy indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ShannonEntropy implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ShannonEntropy(int period, int bins) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SHANNON_ENTROPY_NEW.invokeExact((long) period, (long) bins); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ShannonEntropy parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SHANNON_ENTROPY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SHANNON_ENTROPY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SHANNON_ENTROPY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SHANNON_ENTROPY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Shark.java b/bindings/java/src/main/java/org/wickra/Shark.java new file mode 100644 index 00000000..bdca1e79 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Shark.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Shark indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Shark implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Shark() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SHARK_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Shark parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SHARK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SHARK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SHARK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SHARK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SharpeRatio.java b/bindings/java/src/main/java/org/wickra/SharpeRatio.java new file mode 100644 index 00000000..353c6cb0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SharpeRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SharpeRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SharpeRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SharpeRatio(int period, double riskFree) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SHARPE_RATIO_NEW.invokeExact((long) period, riskFree); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SharpeRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SHARPE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SHARPE_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SHARPE_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SHARPE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ShootingStar.java b/bindings/java/src/main/java/org/wickra/ShootingStar.java new file mode 100644 index 00000000..539d422c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ShootingStar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ShootingStar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ShootingStar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ShootingStar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SHOOTING_STAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ShootingStar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SHOOTING_STAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SHOOTING_STAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SHOOTING_STAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SHOOTING_STAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ShortLine.java b/bindings/java/src/main/java/org/wickra/ShortLine.java new file mode 100644 index 00000000..5ba4063d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ShortLine.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ShortLine indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ShortLine implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ShortLine() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SHORT_LINE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ShortLine parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SHORT_LINE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SHORT_LINE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SHORT_LINE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SHORT_LINE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SignedVolume.java b/bindings/java/src/main/java/org/wickra/SignedVolume.java new file mode 100644 index 00000000..053e526d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SignedVolume.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SignedVolume indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SignedVolume implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SignedVolume() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SIGNED_VOLUME_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SignedVolume parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SIGNED_VOLUME_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SIGNED_VOLUME_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SIGNED_VOLUME_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SineWave.java b/bindings/java/src/main/java/org/wickra/SineWave.java new file mode 100644 index 00000000..331841ae --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SineWave.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SineWave indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SineWave implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SineWave() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SINE_WAVE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SineWave parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SINE_WAVE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SINE_WAVE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SINE_WAVE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SINE_WAVE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SineWeightedMa.java b/bindings/java/src/main/java/org/wickra/SineWeightedMa.java new file mode 100644 index 00000000..2b81e81a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SineWeightedMa.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SineWeightedMa indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SineWeightedMa implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SineWeightedMa(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SINE_WEIGHTED_MA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SineWeightedMa parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SINE_WEIGHTED_MA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SINE_WEIGHTED_MA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SINE_WEIGHTED_MA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SINE_WEIGHTED_MA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SinglePrints.java b/bindings/java/src/main/java/org/wickra/SinglePrints.java new file mode 100644 index 00000000..bf764be3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SinglePrints.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SinglePrints indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SinglePrints implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SinglePrints(int period, int bins) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (bins < 0) { + throw new IllegalArgumentException("bins must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SINGLE_PRINTS_NEW.invokeExact((long) period, (long) bins); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SinglePrints parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SINGLE_PRINTS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SINGLE_PRINTS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SINGLE_PRINTS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SINGLE_PRINTS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Skewness.java b/bindings/java/src/main/java/org/wickra/Skewness.java new file mode 100644 index 00000000..76d0b2fa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Skewness.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Skewness indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Skewness implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Skewness(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SKEWNESS_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Skewness parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SKEWNESS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SKEWNESS_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SKEWNESS_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SKEWNESS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Sma.java b/bindings/java/src/main/java/org/wickra/Sma.java new file mode 100644 index 00000000..c607acf7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Sma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Sma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Sma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Sma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Sma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Smi.java b/bindings/java/src/main/java/org/wickra/Smi.java new file mode 100644 index 00000000..9279e134 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Smi.java @@ -0,0 +1,95 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Smi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Smi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Smi(int period, int dPeriod, int d2Period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (dPeriod < 0) { + throw new IllegalArgumentException("dPeriod must be non-negative"); + } + if (d2Period < 0) { + throw new IllegalArgumentException("d2Period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SMI_NEW.invokeExact((long) period, (long) dPeriod, (long) d2Period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Smi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SMI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SMI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SMI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SMI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Smma.java b/bindings/java/src/main/java/org/wickra/Smma.java new file mode 100644 index 00000000..6d446d01 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Smma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Smma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Smma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Smma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SMMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Smma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SMMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SMMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SMMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SMMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshi.java b/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshi.java new file mode 100644 index 00000000..8738e69c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshi.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SmoothedHeikinAshi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SmoothedHeikinAshi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SmoothedHeikinAshi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SMOOTHED_HEIKIN_ASHI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SmoothedHeikinAshi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SMOOTHED_HEIKIN_ASHI_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public SmoothedHeikinAshiOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_SMOOTHED_HEIKIN_ASHI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new SmoothedHeikinAshiOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SMOOTHED_HEIKIN_ASHI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshiOutput.java b/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshiOutput.java new file mode 100644 index 00000000..70b370f2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SmoothedHeikinAshiOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record SmoothedHeikinAshiOutput(double open, double high, double low, double close) {} diff --git a/bindings/java/src/main/java/org/wickra/SortinoRatio.java b/bindings/java/src/main/java/org/wickra/SortinoRatio.java new file mode 100644 index 00000000..688234ae --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SortinoRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SortinoRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SortinoRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SortinoRatio(int period, double mar) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SORTINO_RATIO_NEW.invokeExact((long) period, mar); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SortinoRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SORTINO_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SORTINO_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SORTINO_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SORTINO_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SpearmanCorrelation.java b/bindings/java/src/main/java/org/wickra/SpearmanCorrelation.java new file mode 100644 index 00000000..eaad0f76 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpearmanCorrelation.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SpearmanCorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SpearmanCorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SpearmanCorrelation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SPEARMAN_CORRELATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SpearmanCorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SPEARMAN_CORRELATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_SPEARMAN_CORRELATION_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SPEARMAN_CORRELATION_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SPEARMAN_CORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SpinningTop.java b/bindings/java/src/main/java/org/wickra/SpinningTop.java new file mode 100644 index 00000000..6535c069 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpinningTop.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SpinningTop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SpinningTop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SpinningTop() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SPINNING_TOP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SpinningTop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SPINNING_TOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_SPINNING_TOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SPINNING_TOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SPINNING_TOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SpreadAr1Coefficient.java b/bindings/java/src/main/java/org/wickra/SpreadAr1Coefficient.java new file mode 100644 index 00000000..46ff2b7a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpreadAr1Coefficient.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SpreadAr1Coefficient indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SpreadAr1Coefficient implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SpreadAr1Coefficient(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SPREAD_AR1_COEFFICIENT_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SpreadAr1Coefficient parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SPREAD_AR1_COEFFICIENT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_SPREAD_AR1_COEFFICIENT_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SPREAD_AR1_COEFFICIENT_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SPREAD_AR1_COEFFICIENT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SpreadBollingerBands.java b/bindings/java/src/main/java/org/wickra/SpreadBollingerBands.java new file mode 100644 index 00000000..44dce188 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpreadBollingerBands.java @@ -0,0 +1,63 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SpreadBollingerBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SpreadBollingerBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SpreadBollingerBands(int period, double numStd) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SPREAD_BOLLINGER_BANDS_NEW.invokeExact((long) period, numStd); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SpreadBollingerBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SPREAD_BOLLINGER_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public SpreadBollingerBandsOutput update(double x, double y) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_SPREAD_BOLLINGER_BANDS_UPDATE.invokeExact(handle, x, y, out); + if (ok == 0) { + return null; + } + return new SpreadBollingerBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SPREAD_BOLLINGER_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SpreadBollingerBandsOutput.java b/bindings/java/src/main/java/org/wickra/SpreadBollingerBandsOutput.java new file mode 100644 index 00000000..dbcb7748 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpreadBollingerBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record SpreadBollingerBandsOutput(double middle, double upper, double lower, double percentB) {} diff --git a/bindings/java/src/main/java/org/wickra/SpreadHurst.java b/bindings/java/src/main/java/org/wickra/SpreadHurst.java new file mode 100644 index 00000000..e89afa6a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SpreadHurst.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SpreadHurst indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SpreadHurst implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SpreadHurst(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SPREAD_HURST_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SpreadHurst parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SPREAD_HURST_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_SPREAD_HURST_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SPREAD_HURST_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SPREAD_HURST_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StalledPattern.java b/bindings/java/src/main/java/org/wickra/StalledPattern.java new file mode 100644 index 00000000..b3e99577 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StalledPattern.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StalledPattern indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StalledPattern implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StalledPattern() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STALLED_PATTERN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StalledPattern parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STALLED_PATTERN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_STALLED_PATTERN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STALLED_PATTERN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STALLED_PATTERN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StandardError.java b/bindings/java/src/main/java/org/wickra/StandardError.java new file mode 100644 index 00000000..70d2ce75 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StandardError.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StandardError indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StandardError implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StandardError(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STANDARD_ERROR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StandardError parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STANDARD_ERROR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STANDARD_ERROR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STANDARD_ERROR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STANDARD_ERROR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StandardErrorBands.java b/bindings/java/src/main/java/org/wickra/StandardErrorBands.java new file mode 100644 index 00000000..3dda7f1f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StandardErrorBands.java @@ -0,0 +1,62 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StandardErrorBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StandardErrorBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StandardErrorBands(int period, double multiplier) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STANDARD_ERROR_BANDS_NEW.invokeExact((long) period, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StandardErrorBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STANDARD_ERROR_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public StandardErrorBandsOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_STANDARD_ERROR_BANDS_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new StandardErrorBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STANDARD_ERROR_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StandardErrorBandsOutput.java b/bindings/java/src/main/java/org/wickra/StandardErrorBandsOutput.java new file mode 100644 index 00000000..8b01b0cb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StandardErrorBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record StandardErrorBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/StarcBands.java b/bindings/java/src/main/java/org/wickra/StarcBands.java new file mode 100644 index 00000000..4ee6c79a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StarcBands.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StarcBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StarcBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StarcBands(int smaPeriod, int atrPeriod, double multiplier) { + if (smaPeriod < 0) { + throw new IllegalArgumentException("smaPeriod must be non-negative"); + } + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STARC_BANDS_NEW.invokeExact((long) smaPeriod, (long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StarcBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STARC_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public StarcBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_STARC_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new StarcBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STARC_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StarcBandsOutput.java b/bindings/java/src/main/java/org/wickra/StarcBandsOutput.java new file mode 100644 index 00000000..b11fb8e6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StarcBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record StarcBandsOutput(double upper, double middle, double lower) {} diff --git a/bindings/java/src/main/java/org/wickra/Stc.java b/bindings/java/src/main/java/org/wickra/Stc.java new file mode 100644 index 00000000..7b9ccebb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Stc.java @@ -0,0 +1,75 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Stc indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Stc implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Stc(int fast, int slow, int schaffPeriod, double factor) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (schaffPeriod < 0) { + throw new IllegalArgumentException("schaffPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STC_NEW.invokeExact((long) fast, (long) slow, (long) schaffPeriod, factor); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Stc parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STC_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STC_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STC_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StdDev.java b/bindings/java/src/main/java/org/wickra/StdDev.java new file mode 100644 index 00000000..e1ea9859 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StdDev.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StdDev indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StdDev implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StdDev(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STD_DEV_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StdDev parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STD_DEV_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STD_DEV_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STD_DEV_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STD_DEV_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StepTrailingStop.java b/bindings/java/src/main/java/org/wickra/StepTrailingStop.java new file mode 100644 index 00000000..18a7aeca --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StepTrailingStop.java @@ -0,0 +1,66 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StepTrailingStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StepTrailingStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StepTrailingStop(double stepSize) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STEP_TRAILING_STOP_NEW.invokeExact(stepSize); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StepTrailingStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STEP_TRAILING_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STEP_TRAILING_STOP_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STEP_TRAILING_STOP_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STEP_TRAILING_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SterlingRatio.java b/bindings/java/src/main/java/org/wickra/SterlingRatio.java new file mode 100644 index 00000000..8714008e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SterlingRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SterlingRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SterlingRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SterlingRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STERLING_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SterlingRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STERLING_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STERLING_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STERLING_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STERLING_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StickSandwich.java b/bindings/java/src/main/java/org/wickra/StickSandwich.java new file mode 100644 index 00000000..8b204e2c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StickSandwich.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StickSandwich indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StickSandwich implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StickSandwich() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STICK_SANDWICH_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StickSandwich parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STICK_SANDWICH_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_STICK_SANDWICH_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STICK_SANDWICH_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STICK_SANDWICH_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StochRsi.java b/bindings/java/src/main/java/org/wickra/StochRsi.java new file mode 100644 index 00000000..527a92c1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StochRsi.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StochRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StochRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StochRsi(int rsiPeriod, int stochPeriod) { + if (rsiPeriod < 0) { + throw new IllegalArgumentException("rsiPeriod must be non-negative"); + } + if (stochPeriod < 0) { + throw new IllegalArgumentException("stochPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STOCH_RSI_NEW.invokeExact((long) rsiPeriod, (long) stochPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StochRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STOCH_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_STOCH_RSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STOCH_RSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STOCH_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Stochastic.java b/bindings/java/src/main/java/org/wickra/Stochastic.java new file mode 100644 index 00000000..170cb1fe --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Stochastic.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Stochastic indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Stochastic implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Stochastic(int kPeriod, int dPeriod) { + if (kPeriod < 0) { + throw new IllegalArgumentException("kPeriod must be non-negative"); + } + if (dPeriod < 0) { + throw new IllegalArgumentException("dPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STOCHASTIC_NEW.invokeExact((long) kPeriod, (long) dPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Stochastic parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STOCHASTIC_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public StochasticOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_STOCHASTIC_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new StochasticOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STOCHASTIC_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StochasticCci.java b/bindings/java/src/main/java/org/wickra/StochasticCci.java new file mode 100644 index 00000000..e744e391 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StochasticCci.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming StochasticCci indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class StochasticCci implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public StochasticCci(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_STOCHASTIC_CCI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid StochasticCci parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_STOCHASTIC_CCI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_STOCHASTIC_CCI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_STOCHASTIC_CCI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_STOCHASTIC_CCI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/StochasticOutput.java b/bindings/java/src/main/java/org/wickra/StochasticOutput.java new file mode 100644 index 00000000..2bbd66d4 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/StochasticOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record StochasticOutput(double k, double d) {} diff --git a/bindings/java/src/main/java/org/wickra/SuperSmoother.java b/bindings/java/src/main/java/org/wickra/SuperSmoother.java new file mode 100644 index 00000000..cf4223da --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SuperSmoother.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SuperSmoother indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SuperSmoother implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SuperSmoother(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SUPER_SMOOTHER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SuperSmoother parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SUPER_SMOOTHER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_SUPER_SMOOTHER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_SUPER_SMOOTHER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SUPER_SMOOTHER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SuperTrend.java b/bindings/java/src/main/java/org/wickra/SuperTrend.java new file mode 100644 index 00000000..ef46179d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SuperTrend.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming SuperTrend indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class SuperTrend implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public SuperTrend(int atrPeriod, double multiplier) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_SUPER_TREND_NEW.invokeExact((long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid SuperTrend parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_SUPER_TREND_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public SuperTrendOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_SUPER_TREND_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new SuperTrendOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_SUPER_TREND_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/SuperTrendOutput.java b/bindings/java/src/main/java/org/wickra/SuperTrendOutput.java new file mode 100644 index 00000000..f7df0367 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/SuperTrendOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record SuperTrendOutput(double value, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/T3.java b/bindings/java/src/main/java/org/wickra/T3.java new file mode 100644 index 00000000..138f48a8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/T3.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming T3 indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class T3 implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public T3(int period, double v) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_T3_NEW.invokeExact((long) period, v); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid T3 parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_T3_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_T3_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_T3_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_T3_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TailRatio.java b/bindings/java/src/main/java/org/wickra/TailRatio.java new file mode 100644 index 00000000..b66b9993 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TailRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TailRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TailRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TailRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TAIL_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TailRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TAIL_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TAIL_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TAIL_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TAIL_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TakerBuySellRatio.java b/bindings/java/src/main/java/org/wickra/TakerBuySellRatio.java new file mode 100644 index 00000000..be2aaba6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TakerBuySellRatio.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TakerBuySellRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TakerBuySellRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TakerBuySellRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TAKER_BUY_SELL_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TakerBuySellRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TAKER_BUY_SELL_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TAKER_BUY_SELL_RATIO_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TAKER_BUY_SELL_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Takuri.java b/bindings/java/src/main/java/org/wickra/Takuri.java new file mode 100644 index 00000000..f2c452aa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Takuri.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Takuri indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Takuri implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Takuri() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TAKURI_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Takuri parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TAKURI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TAKURI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TAKURI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TAKURI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TasukiGap.java b/bindings/java/src/main/java/org/wickra/TasukiGap.java new file mode 100644 index 00000000..8d3e7604 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TasukiGap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TasukiGap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TasukiGap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TasukiGap() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TASUKI_GAP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TasukiGap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TASUKI_GAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TASUKI_GAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TASUKI_GAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TASUKI_GAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdCamouflage.java b/bindings/java/src/main/java/org/wickra/TdCamouflage.java new file mode 100644 index 00000000..63d0279f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdCamouflage.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdCamouflage indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdCamouflage implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdCamouflage() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_CAMOUFLAGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdCamouflage parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_CAMOUFLAGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_CAMOUFLAGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_CAMOUFLAGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_CAMOUFLAGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdClop.java b/bindings/java/src/main/java/org/wickra/TdClop.java new file mode 100644 index 00000000..48c94fa8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdClop.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdClop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdClop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdClop() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_CLOP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdClop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_CLOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_CLOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_CLOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_CLOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdClopwin.java b/bindings/java/src/main/java/org/wickra/TdClopwin.java new file mode 100644 index 00000000..03f7beab --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdClopwin.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdClopwin indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdClopwin implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdClopwin() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_CLOPWIN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdClopwin parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_CLOPWIN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_CLOPWIN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_CLOPWIN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_CLOPWIN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdCombo.java b/bindings/java/src/main/java/org/wickra/TdCombo.java new file mode 100644 index 00000000..33ff6e97 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdCombo.java @@ -0,0 +1,98 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdCombo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdCombo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdCombo(int setupLookback, int setupTarget, int countdownLookback, int countdownTarget) { + if (setupLookback < 0) { + throw new IllegalArgumentException("setupLookback must be non-negative"); + } + if (setupTarget < 0) { + throw new IllegalArgumentException("setupTarget must be non-negative"); + } + if (countdownLookback < 0) { + throw new IllegalArgumentException("countdownLookback must be non-negative"); + } + if (countdownTarget < 0) { + throw new IllegalArgumentException("countdownTarget must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_COMBO_NEW.invokeExact((long) setupLookback, (long) setupTarget, (long) countdownLookback, (long) countdownTarget); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdCombo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_COMBO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_COMBO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_COMBO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_COMBO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdCountdown.java b/bindings/java/src/main/java/org/wickra/TdCountdown.java new file mode 100644 index 00000000..e0aa143a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdCountdown.java @@ -0,0 +1,98 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdCountdown indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdCountdown implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdCountdown(int setupLookback, int setupTarget, int countdownLookback, int countdownTarget) { + if (setupLookback < 0) { + throw new IllegalArgumentException("setupLookback must be non-negative"); + } + if (setupTarget < 0) { + throw new IllegalArgumentException("setupTarget must be non-negative"); + } + if (countdownLookback < 0) { + throw new IllegalArgumentException("countdownLookback must be non-negative"); + } + if (countdownTarget < 0) { + throw new IllegalArgumentException("countdownTarget must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_COUNTDOWN_NEW.invokeExact((long) setupLookback, (long) setupTarget, (long) countdownLookback, (long) countdownTarget); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdCountdown parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_COUNTDOWN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_COUNTDOWN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_COUNTDOWN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_COUNTDOWN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdDWave.java b/bindings/java/src/main/java/org/wickra/TdDWave.java new file mode 100644 index 00000000..63f465d6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdDWave.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdDWave indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdDWave implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdDWave(int strength) { + if (strength < 0) { + throw new IllegalArgumentException("strength must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_D_WAVE_NEW.invokeExact((long) strength); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdDWave parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_D_WAVE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_D_WAVE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_D_WAVE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_D_WAVE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdDeMarker.java b/bindings/java/src/main/java/org/wickra/TdDeMarker.java new file mode 100644 index 00000000..3325e952 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdDeMarker.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdDeMarker indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdDeMarker implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdDeMarker(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_DE_MARKER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdDeMarker parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_DE_MARKER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_DE_MARKER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_DE_MARKER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_DE_MARKER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdDifferential.java b/bindings/java/src/main/java/org/wickra/TdDifferential.java new file mode 100644 index 00000000..9d05d5eb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdDifferential.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdDifferential indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdDifferential implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdDifferential() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_DIFFERENTIAL_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdDifferential parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_DIFFERENTIAL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_DIFFERENTIAL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_DIFFERENTIAL_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_DIFFERENTIAL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdLines.java b/bindings/java/src/main/java/org/wickra/TdLines.java new file mode 100644 index 00000000..cc3fa57a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdLines.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdLines indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdLines implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdLines(int lookback, int target) { + if (lookback < 0) { + throw new IllegalArgumentException("lookback must be non-negative"); + } + if (target < 0) { + throw new IllegalArgumentException("target must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_LINES_NEW.invokeExact((long) lookback, (long) target); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdLines parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_LINES_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TdLinesOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_TD_LINES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TdLinesOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_LINES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdLinesOutput.java b/bindings/java/src/main/java/org/wickra/TdLinesOutput.java new file mode 100644 index 00000000..527aa3d5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdLinesOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TdLinesOutput(double resistance, double support) {} diff --git a/bindings/java/src/main/java/org/wickra/TdMovingAverage.java b/bindings/java/src/main/java/org/wickra/TdMovingAverage.java new file mode 100644 index 00000000..8ac55e82 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdMovingAverage.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdMovingAverage indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdMovingAverage implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdMovingAverage(int periodSt1, int periodSt2) { + if (periodSt1 < 0) { + throw new IllegalArgumentException("periodSt1 must be non-negative"); + } + if (periodSt2 < 0) { + throw new IllegalArgumentException("periodSt2 must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_MOVING_AVERAGE_NEW.invokeExact((long) periodSt1, (long) periodSt2); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdMovingAverage parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_MOVING_AVERAGE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TdMovingAverageOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_TD_MOVING_AVERAGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TdMovingAverageOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_MOVING_AVERAGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdMovingAverageOutput.java b/bindings/java/src/main/java/org/wickra/TdMovingAverageOutput.java new file mode 100644 index 00000000..5b050c8e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdMovingAverageOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TdMovingAverageOutput(double st1, double st2) {} diff --git a/bindings/java/src/main/java/org/wickra/TdOpen.java b/bindings/java/src/main/java/org/wickra/TdOpen.java new file mode 100644 index 00000000..37c6dd0e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdOpen.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdOpen indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdOpen implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdOpen() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_OPEN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdOpen parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_OPEN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_OPEN_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_OPEN_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_OPEN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdPressure.java b/bindings/java/src/main/java/org/wickra/TdPressure.java new file mode 100644 index 00000000..ee05644f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdPressure.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdPressure indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdPressure implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdPressure(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_PRESSURE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdPressure parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_PRESSURE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_PRESSURE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_PRESSURE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_PRESSURE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdPropulsion.java b/bindings/java/src/main/java/org/wickra/TdPropulsion.java new file mode 100644 index 00000000..a7908d42 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdPropulsion.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdPropulsion indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdPropulsion implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdPropulsion() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_PROPULSION_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdPropulsion parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_PROPULSION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_PROPULSION_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_PROPULSION_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_PROPULSION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdRangeProjection.java b/bindings/java/src/main/java/org/wickra/TdRangeProjection.java new file mode 100644 index 00000000..585aa39b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdRangeProjection.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdRangeProjection indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdRangeProjection implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdRangeProjection() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_RANGE_PROJECTION_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdRangeProjection parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_RANGE_PROJECTION_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TdRangeProjectionOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_TD_RANGE_PROJECTION_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TdRangeProjectionOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_RANGE_PROJECTION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdRangeProjectionOutput.java b/bindings/java/src/main/java/org/wickra/TdRangeProjectionOutput.java new file mode 100644 index 00000000..a327b1fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdRangeProjectionOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TdRangeProjectionOutput(double high, double low) {} diff --git a/bindings/java/src/main/java/org/wickra/TdRei.java b/bindings/java/src/main/java/org/wickra/TdRei.java new file mode 100644 index 00000000..23fa1bbb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdRei.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdRei indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdRei implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdRei(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_REI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdRei parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_REI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_REI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_REI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_REI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdRiskLevel.java b/bindings/java/src/main/java/org/wickra/TdRiskLevel.java new file mode 100644 index 00000000..fe512458 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdRiskLevel.java @@ -0,0 +1,64 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdRiskLevel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdRiskLevel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdRiskLevel(int lookback, int target) { + if (lookback < 0) { + throw new IllegalArgumentException("lookback must be non-negative"); + } + if (target < 0) { + throw new IllegalArgumentException("target must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_RISK_LEVEL_NEW.invokeExact((long) lookback, (long) target); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdRiskLevel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_RISK_LEVEL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TdRiskLevelOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_TD_RISK_LEVEL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TdRiskLevelOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_RISK_LEVEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdRiskLevelOutput.java b/bindings/java/src/main/java/org/wickra/TdRiskLevelOutput.java new file mode 100644 index 00000000..82509152 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdRiskLevelOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TdRiskLevelOutput(double buyRisk, double sellRisk) {} diff --git a/bindings/java/src/main/java/org/wickra/TdSequential.java b/bindings/java/src/main/java/org/wickra/TdSequential.java new file mode 100644 index 00000000..76dc8e6e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdSequential.java @@ -0,0 +1,71 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdSequential indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdSequential implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdSequential(int setupLookback, int setupTarget, int countdownLookback, int countdownTarget) { + if (setupLookback < 0) { + throw new IllegalArgumentException("setupLookback must be non-negative"); + } + if (setupTarget < 0) { + throw new IllegalArgumentException("setupTarget must be non-negative"); + } + if (countdownLookback < 0) { + throw new IllegalArgumentException("countdownLookback must be non-negative"); + } + if (countdownTarget < 0) { + throw new IllegalArgumentException("countdownTarget must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_SEQUENTIAL_NEW.invokeExact((long) setupLookback, (long) setupTarget, (long) countdownLookback, (long) countdownTarget); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdSequential parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_SEQUENTIAL_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TdSequentialOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_TD_SEQUENTIAL_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TdSequentialOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_SEQUENTIAL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdSequentialOutput.java b/bindings/java/src/main/java/org/wickra/TdSequentialOutput.java new file mode 100644 index 00000000..7fb5dc23 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdSequentialOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TdSequentialOutput(double setup, double countdown, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/TdSetup.java b/bindings/java/src/main/java/org/wickra/TdSetup.java new file mode 100644 index 00000000..6f4eea77 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdSetup.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdSetup indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdSetup implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdSetup(int lookback, int target) { + if (lookback < 0) { + throw new IllegalArgumentException("lookback must be non-negative"); + } + if (target < 0) { + throw new IllegalArgumentException("target must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_SETUP_NEW.invokeExact((long) lookback, (long) target); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdSetup parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_SETUP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_SETUP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_SETUP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_SETUP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TdTrap.java b/bindings/java/src/main/java/org/wickra/TdTrap.java new file mode 100644 index 00000000..ff69c5f6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TdTrap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TdTrap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TdTrap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TdTrap() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TD_TRAP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TdTrap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TD_TRAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TD_TRAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TD_TRAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TD_TRAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tema.java b/bindings/java/src/main/java/org/wickra/Tema.java new file mode 100644 index 00000000..cf66a33a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tema.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tema indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tema implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tema(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TEMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tema parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TEMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TEMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TEMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TEMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TermStructureBasis.java b/bindings/java/src/main/java/org/wickra/TermStructureBasis.java new file mode 100644 index 00000000..788573fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TermStructureBasis.java @@ -0,0 +1,51 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TermStructureBasis indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TermStructureBasis implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TermStructureBasis() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TERM_STRUCTURE_BASIS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TermStructureBasis parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TERM_STRUCTURE_BASIS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double fundingRate, double markPrice, double indexPrice, double futuresPrice, double openInterest, double longSize, double shortSize, double takerBuyVolume, double takerSellVolume, double longLiquidation, double shortLiquidation, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TERM_STRUCTURE_BASIS_UPDATE.invokeExact(handle, fundingRate, markPrice, indexPrice, futuresPrice, openInterest, longSize, shortSize, takerBuyVolume, takerSellVolume, longLiquidation, shortLiquidation, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TERM_STRUCTURE_BASIS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeDrives.java b/bindings/java/src/main/java/org/wickra/ThreeDrives.java new file mode 100644 index 00000000..a8eb807d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeDrives.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeDrives indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeDrives implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeDrives() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_DRIVES_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeDrives parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_DRIVES_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_DRIVES_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_DRIVES_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_DRIVES_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeInside.java b/bindings/java/src/main/java/org/wickra/ThreeInside.java new file mode 100644 index 00000000..882915d8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeInside.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeInside indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeInside implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeInside() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_INSIDE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeInside parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_INSIDE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_INSIDE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_INSIDE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_INSIDE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeLineBreak.java b/bindings/java/src/main/java/org/wickra/ThreeLineBreak.java new file mode 100644 index 00000000..fc957801 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeLineBreak.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeLineBreak indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeLineBreak implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeLineBreak(int lines) { + if (lines < 0) { + throw new IllegalArgumentException("lines must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_LINE_BREAK_NEW.invokeExact((long) lines); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeLineBreak parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_LINE_BREAK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_LINE_BREAK_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_LINE_BREAK_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_LINE_BREAK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeLineBreakBars.java b/bindings/java/src/main/java/org/wickra/ThreeLineBreakBars.java new file mode 100644 index 00000000..98d75ff7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeLineBreakBars.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeLineBreakBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeLineBreakBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeLineBreakBars(int lines) { + if (lines < 0) { + throw new IllegalArgumentException("lines must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_LINE_BREAK_BARS_NEW.invokeExact((long) lines); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeLineBreakBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_LINE_BREAK_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public LineBreakBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L * cap); + long n = (long) NativeMethods.WICKRA_THREE_LINE_BREAK_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new LineBreakBar[0]; + } + LineBreakBar[] result = new LineBreakBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 24L; + result[i] = new LineBreakBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + (double) out.get(JAVA_BYTE, b + 16L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_LINE_BREAK_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeLineStrike.java b/bindings/java/src/main/java/org/wickra/ThreeLineStrike.java new file mode 100644 index 00000000..2569496c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeLineStrike.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeLineStrike indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeLineStrike implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeLineStrike() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_LINE_STRIKE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeLineStrike parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_LINE_STRIKE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_LINE_STRIKE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_LINE_STRIKE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_LINE_STRIKE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeOutside.java b/bindings/java/src/main/java/org/wickra/ThreeOutside.java new file mode 100644 index 00000000..f41bb0cc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeOutside.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeOutside indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeOutside implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeOutside() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_OUTSIDE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeOutside parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_OUTSIDE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_OUTSIDE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_OUTSIDE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_OUTSIDE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeSoldiersOrCrows.java b/bindings/java/src/main/java/org/wickra/ThreeSoldiersOrCrows.java new file mode 100644 index 00000000..e114e314 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeSoldiersOrCrows.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeSoldiersOrCrows indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeSoldiersOrCrows implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeSoldiersOrCrows() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_SOLDIERS_OR_CROWS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeSoldiersOrCrows parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_SOLDIERS_OR_CROWS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_SOLDIERS_OR_CROWS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_SOLDIERS_OR_CROWS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_SOLDIERS_OR_CROWS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ThreeStarsInSouth.java b/bindings/java/src/main/java/org/wickra/ThreeStarsInSouth.java new file mode 100644 index 00000000..2d9a3be5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ThreeStarsInSouth.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ThreeStarsInSouth indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ThreeStarsInSouth implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ThreeStarsInSouth() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THREE_STARS_IN_SOUTH_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ThreeStarsInSouth parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THREE_STARS_IN_SOUTH_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THREE_STARS_IN_SOUTH_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THREE_STARS_IN_SOUTH_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THREE_STARS_IN_SOUTH_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Thrusting.java b/bindings/java/src/main/java/org/wickra/Thrusting.java new file mode 100644 index 00000000..ae881aeb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Thrusting.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Thrusting indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Thrusting implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Thrusting() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_THRUSTING_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Thrusting parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_THRUSTING_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_THRUSTING_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_THRUSTING_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_THRUSTING_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TickBar.java b/bindings/java/src/main/java/org/wickra/TickBar.java new file mode 100644 index 00000000..3134adc1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TickBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TickBar(double open, double high, double low, double close, double volume) {} diff --git a/bindings/java/src/main/java/org/wickra/TickBars.java b/bindings/java/src/main/java/org/wickra/TickBars.java new file mode 100644 index 00000000..83526f86 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TickBars.java @@ -0,0 +1,70 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TickBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TickBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TickBars(int ticks) { + if (ticks < 0) { + throw new IllegalArgumentException("ticks must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TICK_BARS_NEW.invokeExact((long) ticks); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TickBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TICK_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public TickBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L * cap); + long n = (long) NativeMethods.WICKRA_TICK_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new TickBar[0]; + } + TickBar[] result = new TickBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 40L; + result[i] = new TickBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L), + out.get(JAVA_DOUBLE, b + 24L), + out.get(JAVA_DOUBLE, b + 32L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TICK_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TickIndex.java b/bindings/java/src/main/java/org/wickra/TickIndex.java new file mode 100644 index 00000000..ee341179 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TickIndex.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TickIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TickIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TickIndex() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TICK_INDEX_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TickIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TICK_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_TICK_INDEX_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TICK_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tii.java b/bindings/java/src/main/java/org/wickra/Tii.java new file mode 100644 index 00000000..9094621b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tii.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tii indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tii implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tii(int smaPeriod, int devPeriod) { + if (smaPeriod < 0) { + throw new IllegalArgumentException("smaPeriod must be non-negative"); + } + if (devPeriod < 0) { + throw new IllegalArgumentException("devPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TII_NEW.invokeExact((long) smaPeriod, (long) devPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tii parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TII_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TII_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TII_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TII_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TimeBasedStop.java b/bindings/java/src/main/java/org/wickra/TimeBasedStop.java new file mode 100644 index 00000000..5e082d6a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TimeBasedStop.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TimeBasedStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TimeBasedStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TimeBasedStop(int maxBars) { + if (maxBars < 0) { + throw new IllegalArgumentException("maxBars must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TIME_BASED_STOP_NEW.invokeExact((long) maxBars); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TimeBasedStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TIME_BASED_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TIME_BASED_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TIME_BASED_STOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TIME_BASED_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TimeOfDayReturnProfile.java b/bindings/java/src/main/java/org/wickra/TimeOfDayReturnProfile.java new file mode 100644 index 00000000..8375de3b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TimeOfDayReturnProfile.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TimeOfDayReturnProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TimeOfDayReturnProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public TimeOfDayReturnProfile(int buckets, int utcOffsetMinutes) { + if (buckets < 0) { + throw new IllegalArgumentException("buckets must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TIME_OF_DAY_RETURN_PROFILE_NEW.invokeExact((long) buckets, utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TimeOfDayReturnProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TIME_OF_DAY_RETURN_PROFILE_FREE); + this.valuesCapacity = buckets; + } + + /** Push one observation; returns the profile values, or null during warmup. */ + public double[] update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_TIME_OF_DAY_RETURN_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return v; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TIME_OF_DAY_RETURN_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TowerTopBottom.java b/bindings/java/src/main/java/org/wickra/TowerTopBottom.java new file mode 100644 index 00000000..e15ec4ac --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TowerTopBottom.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TowerTopBottom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TowerTopBottom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TowerTopBottom() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TOWER_TOP_BOTTOM_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TowerTopBottom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TOWER_TOP_BOTTOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TOWER_TOP_BOTTOM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TOWER_TOP_BOTTOM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TOWER_TOP_BOTTOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TpoProfile.java b/bindings/java/src/main/java/org/wickra/TpoProfile.java new file mode 100644 index 00000000..e3e4f8c0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TpoProfile.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TpoProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TpoProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public TpoProfile(int period, int binCount) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (binCount < 0) { + throw new IllegalArgumentException("binCount must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TPO_PROFILE_NEW.invokeExact((long) period, (long) binCount); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TpoProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TPO_PROFILE_FREE); + this.valuesCapacity = binCount; + } + + /** Push one observation; returns the profile, or null during warmup. */ + public TpoProfileOutputScalars update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment scalars = a.allocate(16L); + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_TPO_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, scalars, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return new TpoProfileOutputScalars( + scalars.get(JAVA_DOUBLE, 0L), + scalars.get(JAVA_DOUBLE, 8L), + v); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TPO_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TpoProfileOutputScalars.java b/bindings/java/src/main/java/org/wickra/TpoProfileOutputScalars.java new file mode 100644 index 00000000..32e22dda --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TpoProfileOutputScalars.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TpoProfileOutputScalars(double priceLow, double priceHigh, double[] values) {} diff --git a/bindings/java/src/main/java/org/wickra/TradeImbalance.java b/bindings/java/src/main/java/org/wickra/TradeImbalance.java new file mode 100644 index 00000000..9b44463f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TradeImbalance.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TradeImbalance indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TradeImbalance implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TradeImbalance(int window) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRADE_IMBALANCE_NEW.invokeExact((long) window); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TradeImbalance parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRADE_IMBALANCE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRADE_IMBALANCE_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRADE_IMBALANCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TradeSignAutocorrelation.java b/bindings/java/src/main/java/org/wickra/TradeSignAutocorrelation.java new file mode 100644 index 00000000..29a31c00 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TradeSignAutocorrelation.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TradeSignAutocorrelation indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TradeSignAutocorrelation implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TradeSignAutocorrelation(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRADE_SIGN_AUTOCORRELATION_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TradeSignAutocorrelation parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRADE_SIGN_AUTOCORRELATION_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRADE_SIGN_AUTOCORRELATION_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRADE_SIGN_AUTOCORRELATION_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TradeVolumeIndex.java b/bindings/java/src/main/java/org/wickra/TradeVolumeIndex.java new file mode 100644 index 00000000..ccaff06d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TradeVolumeIndex.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TradeVolumeIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TradeVolumeIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TradeVolumeIndex(double minTick) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRADE_VOLUME_INDEX_NEW.invokeExact(minTick); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TradeVolumeIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRADE_VOLUME_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRADE_VOLUME_INDEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRADE_VOLUME_INDEX_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRADE_VOLUME_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TrendLabel.java b/bindings/java/src/main/java/org/wickra/TrendLabel.java new file mode 100644 index 00000000..918ee5e7 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TrendLabel.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TrendLabel indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TrendLabel implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TrendLabel(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TREND_LABEL_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TrendLabel parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TREND_LABEL_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TREND_LABEL_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TREND_LABEL_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TREND_LABEL_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TrendStrengthIndex.java b/bindings/java/src/main/java/org/wickra/TrendStrengthIndex.java new file mode 100644 index 00000000..000183c0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TrendStrengthIndex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TrendStrengthIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TrendStrengthIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TrendStrengthIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TREND_STRENGTH_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TrendStrengthIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TREND_STRENGTH_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TREND_STRENGTH_INDEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TREND_STRENGTH_INDEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TREND_STRENGTH_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Trendflex.java b/bindings/java/src/main/java/org/wickra/Trendflex.java new file mode 100644 index 00000000..e8bf62b8 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Trendflex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Trendflex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Trendflex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Trendflex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRENDFLEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Trendflex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRENDFLEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TRENDFLEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRENDFLEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRENDFLEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TreynorRatio.java b/bindings/java/src/main/java/org/wickra/TreynorRatio.java new file mode 100644 index 00000000..0bff32d5 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TreynorRatio.java @@ -0,0 +1,73 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TreynorRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TreynorRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TreynorRatio(int period, double riskFree) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TREYNOR_RATIO_NEW.invokeExact((long) period, riskFree); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TreynorRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TREYNOR_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_TREYNOR_RATIO_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TREYNOR_RATIO_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TREYNOR_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Triangle.java b/bindings/java/src/main/java/org/wickra/Triangle.java new file mode 100644 index 00000000..4d0b22e0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Triangle.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Triangle indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Triangle implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Triangle() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRIANGLE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Triangle parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRIANGLE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRIANGLE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRIANGLE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRIANGLE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Trima.java b/bindings/java/src/main/java/org/wickra/Trima.java new file mode 100644 index 00000000..77ffd17d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Trima.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Trima indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Trima implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Trima(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRIMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Trima parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRIMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TRIMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRIMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRIMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Trin.java b/bindings/java/src/main/java/org/wickra/Trin.java new file mode 100644 index 00000000..06c1bb82 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Trin.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Trin indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Trin implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Trin() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRIN_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Trin parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRIN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_TRIN_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRIN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TripleTopBottom.java b/bindings/java/src/main/java/org/wickra/TripleTopBottom.java new file mode 100644 index 00000000..11dca419 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TripleTopBottom.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TripleTopBottom indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TripleTopBottom implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TripleTopBottom() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRIPLE_TOP_BOTTOM_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TripleTopBottom parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRIPLE_TOP_BOTTOM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRIPLE_TOP_BOTTOM_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRIPLE_TOP_BOTTOM_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRIPLE_TOP_BOTTOM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tristar.java b/bindings/java/src/main/java/org/wickra/Tristar.java new file mode 100644 index 00000000..4db23086 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tristar.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tristar indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tristar implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tristar() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRISTAR_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tristar parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRISTAR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRISTAR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRISTAR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRISTAR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Trix.java b/bindings/java/src/main/java/org/wickra/Trix.java new file mode 100644 index 00000000..0cbbcafd --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Trix.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Trix indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Trix implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Trix(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRIX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Trix parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRIX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TRIX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRIX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRIX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TrueRange.java b/bindings/java/src/main/java/org/wickra/TrueRange.java new file mode 100644 index 00000000..1356ece0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TrueRange.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TrueRange indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TrueRange implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TrueRange() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TRUE_RANGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TrueRange parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TRUE_RANGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TRUE_RANGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TRUE_RANGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TRUE_RANGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tsf.java b/bindings/java/src/main/java/org/wickra/Tsf.java new file mode 100644 index 00000000..cbd6580c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tsf.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tsf indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tsf implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tsf(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TSF_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tsf parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TSF_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TSF_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TSF_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TSF_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TsfOscillator.java b/bindings/java/src/main/java/org/wickra/TsfOscillator.java new file mode 100644 index 00000000..9308fd6d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TsfOscillator.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TsfOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TsfOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TsfOscillator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TSF_OSCILLATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TsfOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TSF_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TSF_OSCILLATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TSF_OSCILLATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TSF_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tsi.java b/bindings/java/src/main/java/org/wickra/Tsi.java new file mode 100644 index 00000000..29f33911 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tsi.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tsi(int long_, int short_) { + if (long_ < 0) { + throw new IllegalArgumentException("long_ must be non-negative"); + } + if (short_ < 0) { + throw new IllegalArgumentException("short_ must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TSI_NEW.invokeExact((long) long_, (long) short_); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_TSI_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TSI_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tsv.java b/bindings/java/src/main/java/org/wickra/Tsv.java new file mode 100644 index 00000000..9d639d2a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tsv.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tsv indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tsv implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tsv(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TSV_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tsv parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TSV_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TSV_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TSV_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TSV_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TtmSqueeze.java b/bindings/java/src/main/java/org/wickra/TtmSqueeze.java new file mode 100644 index 00000000..e1475fdb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TtmSqueeze.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TtmSqueeze indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TtmSqueeze implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TtmSqueeze(int period, double bbMult, double kcMult) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TTM_SQUEEZE_NEW.invokeExact((long) period, bbMult, kcMult); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TtmSqueeze parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TTM_SQUEEZE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public TtmSqueezeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_TTM_SQUEEZE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new TtmSqueezeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TTM_SQUEEZE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TtmSqueezeOutput.java b/bindings/java/src/main/java/org/wickra/TtmSqueezeOutput.java new file mode 100644 index 00000000..245ae9b3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TtmSqueezeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record TtmSqueezeOutput(double squeeze, double momentum) {} diff --git a/bindings/java/src/main/java/org/wickra/TtmTrend.java b/bindings/java/src/main/java/org/wickra/TtmTrend.java new file mode 100644 index 00000000..6233eb03 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TtmTrend.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TtmTrend indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TtmTrend implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TtmTrend(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TTM_TREND_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TtmTrend parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TTM_TREND_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TTM_TREND_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TTM_TREND_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TTM_TREND_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TurnOfMonth.java b/bindings/java/src/main/java/org/wickra/TurnOfMonth.java new file mode 100644 index 00000000..a574843e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TurnOfMonth.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TurnOfMonth indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TurnOfMonth implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TurnOfMonth(int nFirst, int nLast, int utcOffsetMinutes) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TURN_OF_MONTH_NEW.invokeExact(nFirst, nLast, utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TurnOfMonth parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TURN_OF_MONTH_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TURN_OF_MONTH_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TURN_OF_MONTH_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TURN_OF_MONTH_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Tweezer.java b/bindings/java/src/main/java/org/wickra/Tweezer.java new file mode 100644 index 00000000..f7ec03fc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Tweezer.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Tweezer indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Tweezer implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Tweezer() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TWEEZER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Tweezer parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TWEEZER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TWEEZER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TWEEZER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TWEEZER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TwiggsMoneyFlow.java b/bindings/java/src/main/java/org/wickra/TwiggsMoneyFlow.java new file mode 100644 index 00000000..568e3741 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TwiggsMoneyFlow.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TwiggsMoneyFlow indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TwiggsMoneyFlow implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TwiggsMoneyFlow(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TWIGGS_MONEY_FLOW_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TwiggsMoneyFlow parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TWIGGS_MONEY_FLOW_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TWIGGS_MONEY_FLOW_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TWIGGS_MONEY_FLOW_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TWIGGS_MONEY_FLOW_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TwoCrows.java b/bindings/java/src/main/java/org/wickra/TwoCrows.java new file mode 100644 index 00000000..75538530 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TwoCrows.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TwoCrows indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TwoCrows implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TwoCrows() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TWO_CROWS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TwoCrows parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TWO_CROWS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TWO_CROWS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TWO_CROWS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TWO_CROWS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/TypicalPrice.java b/bindings/java/src/main/java/org/wickra/TypicalPrice.java new file mode 100644 index 00000000..e5b62758 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/TypicalPrice.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming TypicalPrice indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class TypicalPrice implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public TypicalPrice() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_TYPICAL_PRICE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid TypicalPrice parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_TYPICAL_PRICE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_TYPICAL_PRICE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_TYPICAL_PRICE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_TYPICAL_PRICE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UlcerIndex.java b/bindings/java/src/main/java/org/wickra/UlcerIndex.java new file mode 100644 index 00000000..d84a0877 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UlcerIndex.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UlcerIndex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UlcerIndex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UlcerIndex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ULCER_INDEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UlcerIndex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ULCER_INDEX_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ULCER_INDEX_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ULCER_INDEX_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ULCER_INDEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UltimateOscillator.java b/bindings/java/src/main/java/org/wickra/UltimateOscillator.java new file mode 100644 index 00000000..5b526318 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UltimateOscillator.java @@ -0,0 +1,95 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UltimateOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UltimateOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UltimateOscillator(int short_, int mid, int long_) { + if (short_ < 0) { + throw new IllegalArgumentException("short_ must be non-negative"); + } + if (mid < 0) { + throw new IllegalArgumentException("mid must be non-negative"); + } + if (long_ < 0) { + throw new IllegalArgumentException("long_ must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ULTIMATE_OSCILLATOR_NEW.invokeExact((long) short_, (long) mid, (long) long_); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UltimateOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ULTIMATE_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_ULTIMATE_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ULTIMATE_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ULTIMATE_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UniqueThreeRiver.java b/bindings/java/src/main/java/org/wickra/UniqueThreeRiver.java new file mode 100644 index 00000000..547601ab --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UniqueThreeRiver.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UniqueThreeRiver indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UniqueThreeRiver implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UniqueThreeRiver() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UNIQUE_THREE_RIVER_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UniqueThreeRiver parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UNIQUE_THREE_RIVER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_UNIQUE_THREE_RIVER_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_UNIQUE_THREE_RIVER_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UNIQUE_THREE_RIVER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UniversalOscillator.java b/bindings/java/src/main/java/org/wickra/UniversalOscillator.java new file mode 100644 index 00000000..22233034 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UniversalOscillator.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UniversalOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UniversalOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UniversalOscillator(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UNIVERSAL_OSCILLATOR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UniversalOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UNIVERSAL_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_UNIVERSAL_OSCILLATOR_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_UNIVERSAL_OSCILLATOR_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UNIVERSAL_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UpDownVolumeRatio.java b/bindings/java/src/main/java/org/wickra/UpDownVolumeRatio.java new file mode 100644 index 00000000..0ff5c585 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UpDownVolumeRatio.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UpDownVolumeRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UpDownVolumeRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UpDownVolumeRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UP_DOWN_VOLUME_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UpDownVolumeRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UP_DOWN_VOLUME_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double[] change, double[] volume, double[] newHigh, double[] newLow, double[] aboveMa, double[] onBuySignal, long timestamp) { + if (volume.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newHigh.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (newLow.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (aboveMa.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + if (onBuySignal.length != change.length) { + throw new IllegalArgumentException("input arrays in the same group must have equal length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment changeSeg = a.allocateFrom(JAVA_DOUBLE, change); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment newHighSeg = a.allocateFrom(JAVA_DOUBLE, newHigh); + MemorySegment newLowSeg = a.allocateFrom(JAVA_DOUBLE, newLow); + MemorySegment aboveMaSeg = a.allocateFrom(JAVA_DOUBLE, aboveMa); + MemorySegment onBuySignalSeg = a.allocateFrom(JAVA_DOUBLE, onBuySignal); + return (double) NativeMethods.WICKRA_UP_DOWN_VOLUME_RATIO_UPDATE.invokeExact(handle, changeSeg, volumeSeg, newHighSeg, newLowSeg, aboveMaSeg, onBuySignalSeg, (long) change.length, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UP_DOWN_VOLUME_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UpsideGapThreeMethods.java b/bindings/java/src/main/java/org/wickra/UpsideGapThreeMethods.java new file mode 100644 index 00000000..c67f3e09 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UpsideGapThreeMethods.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UpsideGapThreeMethods indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UpsideGapThreeMethods implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UpsideGapThreeMethods() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UPSIDE_GAP_THREE_METHODS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UpsideGapThreeMethods parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UPSIDE_GAP_THREE_METHODS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_UPSIDE_GAP_THREE_METHODS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_UPSIDE_GAP_THREE_METHODS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UPSIDE_GAP_THREE_METHODS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UpsideGapTwoCrows.java b/bindings/java/src/main/java/org/wickra/UpsideGapTwoCrows.java new file mode 100644 index 00000000..d217399e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UpsideGapTwoCrows.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UpsideGapTwoCrows indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UpsideGapTwoCrows implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UpsideGapTwoCrows() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UPSIDE_GAP_TWO_CROWS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UpsideGapTwoCrows parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UPSIDE_GAP_TWO_CROWS_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_UPSIDE_GAP_TWO_CROWS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_UPSIDE_GAP_TWO_CROWS_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UPSIDE_GAP_TWO_CROWS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/UpsidePotentialRatio.java b/bindings/java/src/main/java/org/wickra/UpsidePotentialRatio.java new file mode 100644 index 00000000..ca2bd888 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/UpsidePotentialRatio.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming UpsidePotentialRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class UpsidePotentialRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public UpsidePotentialRatio(int period, double mar) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_UPSIDE_POTENTIAL_RATIO_NEW.invokeExact((long) period, mar); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid UpsidePotentialRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_UPSIDE_POTENTIAL_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_UPSIDE_POTENTIAL_RATIO_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_UPSIDE_POTENTIAL_RATIO_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_UPSIDE_POTENTIAL_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ValueArea.java b/bindings/java/src/main/java/org/wickra/ValueArea.java new file mode 100644 index 00000000..a7c39bd6 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ValueArea.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ValueArea indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ValueArea implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ValueArea(int period, int binCount, double valueAreaPct) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (binCount < 0) { + throw new IllegalArgumentException("binCount must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VALUE_AREA_NEW.invokeExact((long) period, (long) binCount, valueAreaPct); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ValueArea parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VALUE_AREA_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ValueAreaOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_VALUE_AREA_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ValueAreaOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VALUE_AREA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ValueAreaOutput.java b/bindings/java/src/main/java/org/wickra/ValueAreaOutput.java new file mode 100644 index 00000000..2cae9c6b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ValueAreaOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ValueAreaOutput(double poc, double vah, double val) {} diff --git a/bindings/java/src/main/java/org/wickra/ValueAtRisk.java b/bindings/java/src/main/java/org/wickra/ValueAtRisk.java new file mode 100644 index 00000000..2957396f --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ValueAtRisk.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ValueAtRisk indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ValueAtRisk implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ValueAtRisk(int period, double confidence) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VALUE_AT_RISK_NEW.invokeExact((long) period, confidence); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ValueAtRisk parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VALUE_AT_RISK_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_VALUE_AT_RISK_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VALUE_AT_RISK_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VALUE_AT_RISK_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Variance.java b/bindings/java/src/main/java/org/wickra/Variance.java new file mode 100644 index 00000000..96f445a0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Variance.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Variance indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Variance implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Variance(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VARIANCE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Variance parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VARIANCE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_VARIANCE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VARIANCE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VARIANCE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VarianceRatio.java b/bindings/java/src/main/java/org/wickra/VarianceRatio.java new file mode 100644 index 00000000..60e90771 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VarianceRatio.java @@ -0,0 +1,76 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VarianceRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VarianceRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VarianceRatio(int period, int q) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (q < 0) { + throw new IllegalArgumentException("q must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VARIANCE_RATIO_NEW.invokeExact((long) period, (long) q); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VarianceRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VARIANCE_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double x, double y) { + try { + return (double) NativeMethods.WICKRA_VARIANCE_RATIO_UPDATE.invokeExact(handle, x, y); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] x, double[] y) { + int n = x.length; + if (y.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment xSeg = a.allocateFrom(JAVA_DOUBLE, x); + MemorySegment ySeg = a.allocateFrom(JAVA_DOUBLE, y); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VARIANCE_RATIO_BATCH.invokeExact(handle, xSeg, ySeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VARIANCE_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VerticalHorizontalFilter.java b/bindings/java/src/main/java/org/wickra/VerticalHorizontalFilter.java new file mode 100644 index 00000000..1afabd65 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VerticalHorizontalFilter.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VerticalHorizontalFilter indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VerticalHorizontalFilter implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VerticalHorizontalFilter(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VERTICAL_HORIZONTAL_FILTER_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VerticalHorizontalFilter parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VERTICAL_HORIZONTAL_FILTER_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_VERTICAL_HORIZONTAL_FILTER_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VERTICAL_HORIZONTAL_FILTER_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VERTICAL_HORIZONTAL_FILTER_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Vidya.java b/bindings/java/src/main/java/org/wickra/Vidya.java new file mode 100644 index 00000000..eaeaa6cc --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vidya.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vidya indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vidya implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vidya(int period, int cmoPeriod) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (cmoPeriod < 0) { + throw new IllegalArgumentException("cmoPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VIDYA_NEW.invokeExact((long) period, (long) cmoPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vidya parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VIDYA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_VIDYA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VIDYA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VIDYA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolatilityCone.java b/bindings/java/src/main/java/org/wickra/VolatilityCone.java new file mode 100644 index 00000000..62456a8d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolatilityCone.java @@ -0,0 +1,67 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolatilityCone indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolatilityCone implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolatilityCone(int window, int lookback) { + if (window < 0) { + throw new IllegalArgumentException("window must be non-negative"); + } + if (lookback < 0) { + throw new IllegalArgumentException("lookback must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLATILITY_CONE_NEW.invokeExact((long) window, (long) lookback); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolatilityCone parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLATILITY_CONE_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public VolatilityConeOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_VOLATILITY_CONE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new VolatilityConeOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLATILITY_CONE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolatilityConeOutput.java b/bindings/java/src/main/java/org/wickra/VolatilityConeOutput.java new file mode 100644 index 00000000..db4b579d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolatilityConeOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VolatilityConeOutput(double current, double min, double median, double max, double percentile) {} diff --git a/bindings/java/src/main/java/org/wickra/VolatilityOfVolatility.java b/bindings/java/src/main/java/org/wickra/VolatilityOfVolatility.java new file mode 100644 index 00000000..a40da83c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolatilityOfVolatility.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolatilityOfVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolatilityOfVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolatilityOfVolatility(int volWindow, int vovWindow) { + if (volWindow < 0) { + throw new IllegalArgumentException("volWindow must be non-negative"); + } + if (vovWindow < 0) { + throw new IllegalArgumentException("vovWindow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLATILITY_OF_VOLATILITY_NEW.invokeExact((long) volWindow, (long) vovWindow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolatilityOfVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLATILITY_OF_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_VOLATILITY_OF_VOLATILITY_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLATILITY_OF_VOLATILITY_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLATILITY_OF_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolatilityRatio.java b/bindings/java/src/main/java/org/wickra/VolatilityRatio.java new file mode 100644 index 00000000..e0ac7be2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolatilityRatio.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolatilityRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolatilityRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolatilityRatio(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLATILITY_RATIO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolatilityRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLATILITY_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VOLATILITY_RATIO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLATILITY_RATIO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLATILITY_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VoltyStop.java b/bindings/java/src/main/java/org/wickra/VoltyStop.java new file mode 100644 index 00000000..1c7e7b62 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VoltyStop.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VoltyStop indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VoltyStop implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VoltyStop(int atrPeriod, double multiplier) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLTY_STOP_NEW.invokeExact((long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VoltyStop parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLTY_STOP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VOLTY_STOP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLTY_STOP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLTY_STOP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeBar.java b/bindings/java/src/main/java/org/wickra/VolumeBar.java new file mode 100644 index 00000000..87e24272 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeBar.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VolumeBar(double open, double high, double low, double close, double volume) {} diff --git a/bindings/java/src/main/java/org/wickra/VolumeBars.java b/bindings/java/src/main/java/org/wickra/VolumeBars.java new file mode 100644 index 00000000..8c99afb0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeBars.java @@ -0,0 +1,67 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeBars indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeBars implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumeBars(double volumePerBar) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_BARS_NEW.invokeExact(volumePerBar); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeBars parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_BARS_FREE); + } + + /** Push one observation; returns the bars completed by it (possibly empty). */ + public VolumeBar[] update(double open, double high, double low, double close, double volume, long timestamp) { + final long cap = 64L; + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L * cap); + long n = (long) NativeMethods.WICKRA_VOLUME_BARS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out, cap); + if (n <= 0) { + return new VolumeBar[0]; + } + VolumeBar[] result = new VolumeBar[(int) n]; + for (int i = 0; i < n; i++) { + long b = (long) i * 40L; + result[i] = new VolumeBar( + out.get(JAVA_DOUBLE, b + 0L), + out.get(JAVA_DOUBLE, b + 8L), + out.get(JAVA_DOUBLE, b + 16L), + out.get(JAVA_DOUBLE, b + 24L), + out.get(JAVA_DOUBLE, b + 32L)); + } + return result; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_BARS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeByTimeProfile.java b/bindings/java/src/main/java/org/wickra/VolumeByTimeProfile.java new file mode 100644 index 00000000..39677589 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeByTimeProfile.java @@ -0,0 +1,65 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeByTimeProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeByTimeProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public VolumeByTimeProfile(int buckets, int utcOffsetMinutes) { + if (buckets < 0) { + throw new IllegalArgumentException("buckets must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_BY_TIME_PROFILE_NEW.invokeExact((long) buckets, utcOffsetMinutes); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeByTimeProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_BY_TIME_PROFILE_FREE); + this.valuesCapacity = buckets; + } + + /** Push one observation; returns the profile values, or null during warmup. */ + public double[] update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_VOLUME_BY_TIME_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return v; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_BY_TIME_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeOscillator.java b/bindings/java/src/main/java/org/wickra/VolumeOscillator.java new file mode 100644 index 00000000..6699b84b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeOscillator.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeOscillator indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeOscillator implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumeOscillator(int fast, int slow) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_OSCILLATOR_NEW.invokeExact((long) fast, (long) slow); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeOscillator parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_OSCILLATOR_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VOLUME_OSCILLATOR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLUME_OSCILLATOR_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_OSCILLATOR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumePriceTrend.java b/bindings/java/src/main/java/org/wickra/VolumePriceTrend.java new file mode 100644 index 00000000..ac3a2ac9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumePriceTrend.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumePriceTrend indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumePriceTrend implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumePriceTrend() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_PRICE_TREND_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumePriceTrend parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_PRICE_TREND_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VOLUME_PRICE_TREND_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLUME_PRICE_TREND_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_PRICE_TREND_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeProfile.java b/bindings/java/src/main/java/org/wickra/VolumeProfile.java new file mode 100644 index 00000000..a49263b9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeProfile.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeProfile indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeProfile implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + private final int valuesCapacity; + + public VolumeProfile(int period, int binCount) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (binCount < 0) { + throw new IllegalArgumentException("binCount must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_PROFILE_NEW.invokeExact((long) period, (long) binCount); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeProfile parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_PROFILE_FREE); + this.valuesCapacity = binCount; + } + + /** Push one observation; returns the profile, or null during warmup. */ + public VolumeProfileOutputScalars update(double open, double high, double low, double close, double volume, long timestamp) { + long cap = valuesCapacity; + try (Arena a = Arena.ofConfined()) { + MemorySegment scalars = a.allocate(16L); + MemorySegment values = a.allocate(JAVA_DOUBLE.byteSize() * cap); + long len = (long) NativeMethods.WICKRA_VOLUME_PROFILE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, scalars, values, cap); + if (len < 0) { + return null; + } + int count = (int) Math.min(len, cap); + double[] v = new double[count]; + MemorySegment.copy(values, JAVA_DOUBLE, 0L, v, 0, count); + return new VolumeProfileOutputScalars( + scalars.get(JAVA_DOUBLE, 0L), + scalars.get(JAVA_DOUBLE, 8L), + v); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_PROFILE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeProfileOutputScalars.java b/bindings/java/src/main/java/org/wickra/VolumeProfileOutputScalars.java new file mode 100644 index 00000000..6a374c56 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeProfileOutputScalars.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VolumeProfileOutputScalars(double priceLow, double priceHigh, double[] values) {} diff --git a/bindings/java/src/main/java/org/wickra/VolumeRsi.java b/bindings/java/src/main/java/org/wickra/VolumeRsi.java new file mode 100644 index 00000000..192832d9 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeRsi.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeRsi indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeRsi implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumeRsi(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_RSI_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeRsi parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_RSI_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VOLUME_RSI_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VOLUME_RSI_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_RSI_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeWeightedMacd.java b/bindings/java/src/main/java/org/wickra/VolumeWeightedMacd.java new file mode 100644 index 00000000..9cc5f172 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeWeightedMacd.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeWeightedMacd indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeWeightedMacd implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumeWeightedMacd(int fast, int slow, int signal) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_WEIGHTED_MACD_NEW.invokeExact((long) fast, (long) slow, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeWeightedMacd parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_WEIGHTED_MACD_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public VolumeWeightedMacdOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_VOLUME_WEIGHTED_MACD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new VolumeWeightedMacdOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_WEIGHTED_MACD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeWeightedMacdOutput.java b/bindings/java/src/main/java/org/wickra/VolumeWeightedMacdOutput.java new file mode 100644 index 00000000..1196e183 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeWeightedMacdOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VolumeWeightedMacdOutput(double macd, double signal, double histogram) {} diff --git a/bindings/java/src/main/java/org/wickra/VolumeWeightedSr.java b/bindings/java/src/main/java/org/wickra/VolumeWeightedSr.java new file mode 100644 index 00000000..4fa32598 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeWeightedSr.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VolumeWeightedSr indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VolumeWeightedSr implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VolumeWeightedSr(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VOLUME_WEIGHTED_SR_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VolumeWeightedSr parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VOLUME_WEIGHTED_SR_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public VolumeWeightedSrOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_VOLUME_WEIGHTED_SR_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new VolumeWeightedSrOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VOLUME_WEIGHTED_SR_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VolumeWeightedSrOutput.java b/bindings/java/src/main/java/org/wickra/VolumeWeightedSrOutput.java new file mode 100644 index 00000000..d732836b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VolumeWeightedSrOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VolumeWeightedSrOutput(double support, double resistance) {} diff --git a/bindings/java/src/main/java/org/wickra/Vortex.java b/bindings/java/src/main/java/org/wickra/Vortex.java new file mode 100644 index 00000000..884b2a58 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vortex.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vortex indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vortex implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vortex(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VORTEX_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vortex parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VORTEX_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public VortexOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_VORTEX_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new VortexOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VORTEX_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VortexOutput.java b/bindings/java/src/main/java/org/wickra/VortexOutput.java new file mode 100644 index 00000000..374e0761 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VortexOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VortexOutput(double plus, double minus) {} diff --git a/bindings/java/src/main/java/org/wickra/Vpin.java b/bindings/java/src/main/java/org/wickra/Vpin.java new file mode 100644 index 00000000..e144bbb2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vpin.java @@ -0,0 +1,54 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vpin indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vpin implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vpin(double bucketVolume, int numBuckets) { + if (numBuckets < 0) { + throw new IllegalArgumentException("numBuckets must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VPIN_NEW.invokeExact(bucketVolume, (long) numBuckets); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vpin parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VPIN_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double price, double size, boolean isBuy, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VPIN_UPDATE.invokeExact(handle, price, size, (byte) (isBuy ? 1 : 0), timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VPIN_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Vwap.java b/bindings/java/src/main/java/org/wickra/Vwap.java new file mode 100644 index 00000000..406ebb2e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vwap.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vwap indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vwap implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vwap() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VWAP_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vwap parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VWAP_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VWAP_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VWAP_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VWAP_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VwapStdDevBands.java b/bindings/java/src/main/java/org/wickra/VwapStdDevBands.java new file mode 100644 index 00000000..052f7f11 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VwapStdDevBands.java @@ -0,0 +1,60 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming VwapStdDevBands indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class VwapStdDevBands implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public VwapStdDevBands(double multiplier) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VWAP_STD_DEV_BANDS_NEW.invokeExact(multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid VwapStdDevBands parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VWAP_STD_DEV_BANDS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public VwapStdDevBandsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(32L); + byte ok = (byte) NativeMethods.WICKRA_VWAP_STD_DEV_BANDS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new VwapStdDevBandsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VWAP_STD_DEV_BANDS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/VwapStdDevBandsOutput.java b/bindings/java/src/main/java/org/wickra/VwapStdDevBandsOutput.java new file mode 100644 index 00000000..a24ad688 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/VwapStdDevBandsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record VwapStdDevBandsOutput(double upper, double middle, double lower, double stddev) {} diff --git a/bindings/java/src/main/java/org/wickra/Vwma.java b/bindings/java/src/main/java/org/wickra/Vwma.java new file mode 100644 index 00000000..3bc764a3 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vwma.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vwma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vwma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vwma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VWMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vwma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VWMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VWMA_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VWMA_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VWMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Vzo.java b/bindings/java/src/main/java/org/wickra/Vzo.java new file mode 100644 index 00000000..21d71a8e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Vzo.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Vzo indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Vzo implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Vzo(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_VZO_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Vzo parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_VZO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_VZO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_VZO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_VZO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Wad.java b/bindings/java/src/main/java/org/wickra/Wad.java new file mode 100644 index 00000000..b6e73843 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Wad.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Wad indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Wad implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Wad() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WAD_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Wad parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WAD_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_WAD_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WAD_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WAD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WavePm.java b/bindings/java/src/main/java/org/wickra/WavePm.java new file mode 100644 index 00000000..d8c3832a --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WavePm.java @@ -0,0 +1,72 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WavePm indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WavePm implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WavePm(int length, int smoothing) { + if (length < 0) { + throw new IllegalArgumentException("length must be non-negative"); + } + if (smoothing < 0) { + throw new IllegalArgumentException("smoothing must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WAVE_PM_NEW.invokeExact((long) length, (long) smoothing); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WavePm parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WAVE_PM_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_WAVE_PM_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WAVE_PM_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WAVE_PM_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WaveTrend.java b/bindings/java/src/main/java/org/wickra/WaveTrend.java new file mode 100644 index 00000000..196feec2 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WaveTrend.java @@ -0,0 +1,67 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WaveTrend indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WaveTrend implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WaveTrend(int channelPeriod, int averagePeriod, int signalPeriod) { + if (channelPeriod < 0) { + throw new IllegalArgumentException("channelPeriod must be non-negative"); + } + if (averagePeriod < 0) { + throw new IllegalArgumentException("averagePeriod must be non-negative"); + } + if (signalPeriod < 0) { + throw new IllegalArgumentException("signalPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WAVE_TREND_NEW.invokeExact((long) channelPeriod, (long) averagePeriod, (long) signalPeriod); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WaveTrend parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WAVE_TREND_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public WaveTrendOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_WAVE_TREND_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new WaveTrendOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WAVE_TREND_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WaveTrendOutput.java b/bindings/java/src/main/java/org/wickra/WaveTrendOutput.java new file mode 100644 index 00000000..17972def --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WaveTrendOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record WaveTrendOutput(double wt1, double wt2) {} diff --git a/bindings/java/src/main/java/org/wickra/Wedge.java b/bindings/java/src/main/java/org/wickra/Wedge.java new file mode 100644 index 00000000..00f08635 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Wedge.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Wedge indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Wedge implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Wedge() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WEDGE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Wedge parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WEDGE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_WEDGE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WEDGE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WEDGE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WeightedClose.java b/bindings/java/src/main/java/org/wickra/WeightedClose.java new file mode 100644 index 00000000..52d461e0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WeightedClose.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WeightedClose indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WeightedClose implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WeightedClose() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WEIGHTED_CLOSE_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WeightedClose parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WEIGHTED_CLOSE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_WEIGHTED_CLOSE_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WEIGHTED_CLOSE_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WEIGHTED_CLOSE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WickRatio.java b/bindings/java/src/main/java/org/wickra/WickRatio.java new file mode 100644 index 00000000..cee0599d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WickRatio.java @@ -0,0 +1,86 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WickRatio indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WickRatio implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WickRatio() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WICK_RATIO_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WickRatio parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WICK_RATIO_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_WICK_RATIO_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WICK_RATIO_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WICK_RATIO_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WilliamsFractals.java b/bindings/java/src/main/java/org/wickra/WilliamsFractals.java new file mode 100644 index 00000000..fe7efa1b --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WilliamsFractals.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WilliamsFractals indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WilliamsFractals implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WilliamsFractals() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WILLIAMS_FRACTALS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WilliamsFractals parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WILLIAMS_FRACTALS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public WilliamsFractalsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_WILLIAMS_FRACTALS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new WilliamsFractalsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WILLIAMS_FRACTALS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WilliamsFractalsOutput.java b/bindings/java/src/main/java/org/wickra/WilliamsFractalsOutput.java new file mode 100644 index 00000000..f5bba468 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WilliamsFractalsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record WilliamsFractalsOutput(double up, double down) {} diff --git a/bindings/java/src/main/java/org/wickra/WilliamsR.java b/bindings/java/src/main/java/org/wickra/WilliamsR.java new file mode 100644 index 00000000..949354fb --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WilliamsR.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WilliamsR indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WilliamsR implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WilliamsR(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WILLIAMS_R_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WilliamsR parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WILLIAMS_R_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_WILLIAMS_R_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WILLIAMS_R_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WILLIAMS_R_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WinRate.java b/bindings/java/src/main/java/org/wickra/WinRate.java new file mode 100644 index 00000000..1ca4d699 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WinRate.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WinRate indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WinRate implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WinRate(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WIN_RATE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WinRate parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WIN_RATE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_WIN_RATE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WIN_RATE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WIN_RATE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/Wma.java b/bindings/java/src/main/java/org/wickra/Wma.java new file mode 100644 index 00000000..53f76844 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Wma.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Wma indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Wma implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Wma(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Wma parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_WMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_WMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WoodiePivots.java b/bindings/java/src/main/java/org/wickra/WoodiePivots.java new file mode 100644 index 00000000..5714b0fa --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WoodiePivots.java @@ -0,0 +1,61 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming WoodiePivots indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class WoodiePivots implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public WoodiePivots() { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_WOODIE_PIVOTS_NEW.invokeExact(); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid WoodiePivots parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_WOODIE_PIVOTS_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public WoodiePivotsOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(40L); + byte ok = (byte) NativeMethods.WICKRA_WOODIE_PIVOTS_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new WoodiePivotsOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L), + out.get(JAVA_DOUBLE, 24L), + out.get(JAVA_DOUBLE, 32L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_WOODIE_PIVOTS_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/WoodiePivotsOutput.java b/bindings/java/src/main/java/org/wickra/WoodiePivotsOutput.java new file mode 100644 index 00000000..d68d9681 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/WoodiePivotsOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record WoodiePivotsOutput(double pp, double r1, double r2, double s1, double s2) {} diff --git a/bindings/java/src/main/java/org/wickra/YangZhangVolatility.java b/bindings/java/src/main/java/org/wickra/YangZhangVolatility.java new file mode 100644 index 00000000..4587dd0e --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/YangZhangVolatility.java @@ -0,0 +1,92 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming YangZhangVolatility indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class YangZhangVolatility implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public YangZhangVolatility(int period, int tradingPeriods) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + if (tradingPeriods < 0) { + throw new IllegalArgumentException("tradingPeriods must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_YANG_ZHANG_VOLATILITY_NEW.invokeExact((long) period, (long) tradingPeriods); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid YangZhangVolatility parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_YANG_ZHANG_VOLATILITY_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_YANG_ZHANG_VOLATILITY_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_YANG_ZHANG_VOLATILITY_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_YANG_ZHANG_VOLATILITY_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/YoyoExit.java b/bindings/java/src/main/java/org/wickra/YoyoExit.java new file mode 100644 index 00000000..2642e27c --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/YoyoExit.java @@ -0,0 +1,89 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming YoyoExit indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class YoyoExit implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public YoyoExit(int atrPeriod, double multiplier) { + if (atrPeriod < 0) { + throw new IllegalArgumentException("atrPeriod must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_YOYO_EXIT_NEW.invokeExact((long) atrPeriod, multiplier); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid YoyoExit parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_YOYO_EXIT_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double open, double high, double low, double close, double volume, long timestamp) { + try { + return (double) NativeMethods.WICKRA_YOYO_EXIT_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] open, double[] high, double[] low, double[] close, double[] volume, double[] timestamp) { + int n = open.length; + if (high.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (low.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (close.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (volume.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + if (timestamp.length != n) { + throw new IllegalArgumentException("all input arrays must have the same length"); + } + try (Arena a = Arena.ofConfined()) { + MemorySegment openSeg = a.allocateFrom(JAVA_DOUBLE, open); + MemorySegment highSeg = a.allocateFrom(JAVA_DOUBLE, high); + MemorySegment lowSeg = a.allocateFrom(JAVA_DOUBLE, low); + MemorySegment closeSeg = a.allocateFrom(JAVA_DOUBLE, close); + MemorySegment volumeSeg = a.allocateFrom(JAVA_DOUBLE, volume); + MemorySegment timestampSeg = a.allocateFrom(JAVA_DOUBLE, timestamp); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_YOYO_EXIT_BATCH.invokeExact(handle, openSeg, highSeg, lowSeg, closeSeg, volumeSeg, timestampSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_YOYO_EXIT_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ZScore.java b/bindings/java/src/main/java/org/wickra/ZScore.java new file mode 100644 index 00000000..d9464b64 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ZScore.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ZScore indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ZScore implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ZScore(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_Z_SCORE_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ZScore parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_Z_SCORE_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_Z_SCORE_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_Z_SCORE_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_Z_SCORE_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ZeroLagMacd.java b/bindings/java/src/main/java/org/wickra/ZeroLagMacd.java new file mode 100644 index 00000000..04a98291 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ZeroLagMacd.java @@ -0,0 +1,68 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ZeroLagMacd indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ZeroLagMacd implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ZeroLagMacd(int fast, int slow, int signal) { + if (fast < 0) { + throw new IllegalArgumentException("fast must be non-negative"); + } + if (slow < 0) { + throw new IllegalArgumentException("slow must be non-negative"); + } + if (signal < 0) { + throw new IllegalArgumentException("signal must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ZERO_LAG_MACD_NEW.invokeExact((long) fast, (long) slow, (long) signal); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ZeroLagMacd parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ZERO_LAG_MACD_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ZeroLagMacdOutput update(double value) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(24L); + byte ok = (byte) NativeMethods.WICKRA_ZERO_LAG_MACD_UPDATE.invokeExact(handle, value, out); + if (ok == 0) { + return null; + } + return new ZeroLagMacdOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L), + out.get(JAVA_DOUBLE, 16L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ZERO_LAG_MACD_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ZeroLagMacdOutput.java b/bindings/java/src/main/java/org/wickra/ZeroLagMacdOutput.java new file mode 100644 index 00000000..d9848e65 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ZeroLagMacdOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ZeroLagMacdOutput(double macd, double signal, double histogram) {} diff --git a/bindings/java/src/main/java/org/wickra/ZigZag.java b/bindings/java/src/main/java/org/wickra/ZigZag.java new file mode 100644 index 00000000..e2c6545d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ZigZag.java @@ -0,0 +1,58 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming ZigZag indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class ZigZag implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public ZigZag(double threshold) { + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ZIG_ZAG_NEW.invokeExact(threshold); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid ZigZag parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ZIG_ZAG_FREE); + } + + /** Push one observation; returns the result, or null during warmup. */ + public ZigZagOutput update(double open, double high, double low, double close, double volume, long timestamp) { + try (Arena a = Arena.ofConfined()) { + MemorySegment out = a.allocate(16L); + byte ok = (byte) NativeMethods.WICKRA_ZIG_ZAG_UPDATE.invokeExact(handle, open, high, low, close, volume, timestamp, out); + if (ok == 0) { + return null; + } + return new ZigZagOutput( + out.get(JAVA_DOUBLE, 0L), + out.get(JAVA_DOUBLE, 8L)); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ZIG_ZAG_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/ZigZagOutput.java b/bindings/java/src/main/java/org/wickra/ZigZagOutput.java new file mode 100644 index 00000000..912d9cd1 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/ZigZagOutput.java @@ -0,0 +1,5 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +/** Output record produced by the matching indicator. */ +public record ZigZagOutput(double swing, double direction) {} diff --git a/bindings/java/src/main/java/org/wickra/Zlema.java b/bindings/java/src/main/java/org/wickra/Zlema.java new file mode 100644 index 00000000..22a5d6fd --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/Zlema.java @@ -0,0 +1,69 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra; + +import org.wickra.internal.NativeMethods; +import org.wickra.internal.WickraNative; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.ref.Cleaner; +import static java.lang.foreign.ValueLayout.*; + +/** Streaming Zlema indicator over the Wickra C ABI. Not thread-safe; close when done. */ +public final class Zlema implements AutoCloseable { + private final MemorySegment handle; + private final Cleaner.Cleanable cleanable; + + public Zlema(int period) { + if (period < 0) { + throw new IllegalArgumentException("period must be non-negative"); + } + MemorySegment h; + try { + h = (MemorySegment) NativeMethods.WICKRA_ZLEMA_NEW.invokeExact((long) period); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + if (h.address() == 0L) { + throw new IllegalArgumentException("invalid Zlema parameters"); + } + this.handle = h; + this.cleanable = WickraNative.register(this, h, NativeMethods.WICKRA_ZLEMA_FREE); + } + + /** Push one observation; returns the indicator value (NaN during warmup). */ + public double update(double value) { + try { + return (double) NativeMethods.WICKRA_ZLEMA_UPDATE.invokeExact(handle, value); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Vectorized update over a whole series; NaN at warmup positions. */ + public double[] batch(double[] input) { + int n = input.length; + try (Arena a = Arena.ofConfined()) { + MemorySegment inputSeg = a.allocateFrom(JAVA_DOUBLE, input); + MemorySegment outSeg = a.allocate(JAVA_DOUBLE.byteSize() * n); + NativeMethods.WICKRA_ZLEMA_BATCH.invokeExact(handle, inputSeg, outSeg, (long) n); + double[] out = new double[n]; + MemorySegment.copy(outSeg, JAVA_DOUBLE, 0L, out, 0, n); + return out; + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + /** Reset to the just-constructed state. */ + public void reset() { + try { + NativeMethods.WICKRA_ZLEMA_RESET.invokeExact(handle); + } catch (Throwable t) { + throw WickraNative.rethrow(t); + } + } + + @Override public void close() { + cleanable.clean(); + } +} diff --git a/bindings/java/src/main/java/org/wickra/internal/NativeMethods.java b/bindings/java/src/main/java/org/wickra/internal/NativeMethods.java new file mode 100644 index 00000000..bc0cf02d --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/internal/NativeMethods.java @@ -0,0 +1,4928 @@ +// Generated from bindings/c/include/wickra.h. Do not edit by hand. +package org.wickra.internal; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.invoke.MethodHandle; +import static java.lang.foreign.ValueLayout.*; + +/** Downcall handles for every Wickra C ABI function. Internal API. */ +public final class NativeMethods { + private NativeMethods() {} + + private static MethodHandle h(String name, FunctionDescriptor d) { + return WickraNative.downcall(name, d); + } + + public static MethodHandle WICKRA_ADAPTIVE_CYCLE_NEW; + public static MethodHandle WICKRA_ADAPTIVE_CYCLE_UPDATE; + public static MethodHandle WICKRA_ADAPTIVE_CYCLE_BATCH; + public static MethodHandle WICKRA_ADAPTIVE_CYCLE_RESET; + public static MethodHandle WICKRA_ADAPTIVE_CYCLE_FREE; + public static MethodHandle WICKRA_ADAPTIVE_LAGUERRE_FILTER_NEW; + public static MethodHandle WICKRA_ADAPTIVE_LAGUERRE_FILTER_UPDATE; + public static MethodHandle WICKRA_ADAPTIVE_LAGUERRE_FILTER_BATCH; + public static MethodHandle WICKRA_ADAPTIVE_LAGUERRE_FILTER_RESET; + public static MethodHandle WICKRA_ADAPTIVE_LAGUERRE_FILTER_FREE; + public static MethodHandle WICKRA_ADAPTIVE_RSI_NEW; + public static MethodHandle WICKRA_ADAPTIVE_RSI_UPDATE; + public static MethodHandle WICKRA_ADAPTIVE_RSI_BATCH; + public static MethodHandle WICKRA_ADAPTIVE_RSI_RESET; + public static MethodHandle WICKRA_ADAPTIVE_RSI_FREE; + public static MethodHandle WICKRA_ALMA_NEW; + public static MethodHandle WICKRA_ALMA_UPDATE; + public static MethodHandle WICKRA_ALMA_BATCH; + public static MethodHandle WICKRA_ALMA_RESET; + public static MethodHandle WICKRA_ALMA_FREE; + public static MethodHandle WICKRA_ANCHORED_RSI_NEW; + public static MethodHandle WICKRA_ANCHORED_RSI_UPDATE; + public static MethodHandle WICKRA_ANCHORED_RSI_BATCH; + public static MethodHandle WICKRA_ANCHORED_RSI_RESET; + public static MethodHandle WICKRA_ANCHORED_RSI_FREE; + public static MethodHandle WICKRA_APO_NEW; + public static MethodHandle WICKRA_APO_UPDATE; + public static MethodHandle WICKRA_APO_BATCH; + public static MethodHandle WICKRA_APO_RESET; + public static MethodHandle WICKRA_APO_FREE; + public static MethodHandle WICKRA_AUTOCORRELATION_NEW; + public static MethodHandle WICKRA_AUTOCORRELATION_UPDATE; + public static MethodHandle WICKRA_AUTOCORRELATION_BATCH; + public static MethodHandle WICKRA_AUTOCORRELATION_RESET; + public static MethodHandle WICKRA_AUTOCORRELATION_FREE; + public static MethodHandle WICKRA_AUTOCORRELATION_PERIODOGRAM_NEW; + public static MethodHandle WICKRA_AUTOCORRELATION_PERIODOGRAM_UPDATE; + public static MethodHandle WICKRA_AUTOCORRELATION_PERIODOGRAM_BATCH; + public static MethodHandle WICKRA_AUTOCORRELATION_PERIODOGRAM_RESET; + public static MethodHandle WICKRA_AUTOCORRELATION_PERIODOGRAM_FREE; + public static MethodHandle WICKRA_AVERAGE_DRAWDOWN_NEW; + public static MethodHandle WICKRA_AVERAGE_DRAWDOWN_UPDATE; + public static MethodHandle WICKRA_AVERAGE_DRAWDOWN_BATCH; + public static MethodHandle WICKRA_AVERAGE_DRAWDOWN_RESET; + public static MethodHandle WICKRA_AVERAGE_DRAWDOWN_FREE; + public static MethodHandle WICKRA_BANDPASS_FILTER_NEW; + public static MethodHandle WICKRA_BANDPASS_FILTER_UPDATE; + public static MethodHandle WICKRA_BANDPASS_FILTER_BATCH; + public static MethodHandle WICKRA_BANDPASS_FILTER_RESET; + public static MethodHandle WICKRA_BANDPASS_FILTER_FREE; + public static MethodHandle WICKRA_BIPOWER_VARIATION_NEW; + public static MethodHandle WICKRA_BIPOWER_VARIATION_UPDATE; + public static MethodHandle WICKRA_BIPOWER_VARIATION_BATCH; + public static MethodHandle WICKRA_BIPOWER_VARIATION_RESET; + public static MethodHandle WICKRA_BIPOWER_VARIATION_FREE; + public static MethodHandle WICKRA_BOLLINGER_BANDWIDTH_NEW; + public static MethodHandle WICKRA_BOLLINGER_BANDWIDTH_UPDATE; + public static MethodHandle WICKRA_BOLLINGER_BANDWIDTH_BATCH; + public static MethodHandle WICKRA_BOLLINGER_BANDWIDTH_RESET; + public static MethodHandle WICKRA_BOLLINGER_BANDWIDTH_FREE; + public static MethodHandle WICKRA_BURKE_RATIO_NEW; + public static MethodHandle WICKRA_BURKE_RATIO_UPDATE; + public static MethodHandle WICKRA_BURKE_RATIO_BATCH; + public static MethodHandle WICKRA_BURKE_RATIO_RESET; + public static MethodHandle WICKRA_BURKE_RATIO_FREE; + public static MethodHandle WICKRA_CALMAR_RATIO_NEW; + public static MethodHandle WICKRA_CALMAR_RATIO_UPDATE; + public static MethodHandle WICKRA_CALMAR_RATIO_BATCH; + public static MethodHandle WICKRA_CALMAR_RATIO_RESET; + public static MethodHandle WICKRA_CALMAR_RATIO_FREE; + public static MethodHandle WICKRA_CENTER_OF_GRAVITY_NEW; + public static MethodHandle WICKRA_CENTER_OF_GRAVITY_UPDATE; + public static MethodHandle WICKRA_CENTER_OF_GRAVITY_BATCH; + public static MethodHandle WICKRA_CENTER_OF_GRAVITY_RESET; + public static MethodHandle WICKRA_CENTER_OF_GRAVITY_FREE; + public static MethodHandle WICKRA_CFO_NEW; + public static MethodHandle WICKRA_CFO_UPDATE; + public static MethodHandle WICKRA_CFO_BATCH; + public static MethodHandle WICKRA_CFO_RESET; + public static MethodHandle WICKRA_CFO_FREE; + public static MethodHandle WICKRA_CMO_NEW; + public static MethodHandle WICKRA_CMO_UPDATE; + public static MethodHandle WICKRA_CMO_BATCH; + public static MethodHandle WICKRA_CMO_RESET; + public static MethodHandle WICKRA_CMO_FREE; + public static MethodHandle WICKRA_COEFFICIENT_OF_VARIATION_NEW; + public static MethodHandle WICKRA_COEFFICIENT_OF_VARIATION_UPDATE; + public static MethodHandle WICKRA_COEFFICIENT_OF_VARIATION_BATCH; + public static MethodHandle WICKRA_COEFFICIENT_OF_VARIATION_RESET; + public static MethodHandle WICKRA_COEFFICIENT_OF_VARIATION_FREE; + public static MethodHandle WICKRA_COMMON_SENSE_RATIO_NEW; + public static MethodHandle WICKRA_COMMON_SENSE_RATIO_UPDATE; + public static MethodHandle WICKRA_COMMON_SENSE_RATIO_BATCH; + public static MethodHandle WICKRA_COMMON_SENSE_RATIO_RESET; + public static MethodHandle WICKRA_COMMON_SENSE_RATIO_FREE; + public static MethodHandle WICKRA_CONDITIONAL_VALUE_AT_RISK_NEW; + public static MethodHandle WICKRA_CONDITIONAL_VALUE_AT_RISK_UPDATE; + public static MethodHandle WICKRA_CONDITIONAL_VALUE_AT_RISK_BATCH; + public static MethodHandle WICKRA_CONDITIONAL_VALUE_AT_RISK_RESET; + public static MethodHandle WICKRA_CONDITIONAL_VALUE_AT_RISK_FREE; + public static MethodHandle WICKRA_CONNORS_RSI_NEW; + public static MethodHandle WICKRA_CONNORS_RSI_UPDATE; + public static MethodHandle WICKRA_CONNORS_RSI_BATCH; + public static MethodHandle WICKRA_CONNORS_RSI_RESET; + public static MethodHandle WICKRA_CONNORS_RSI_FREE; + public static MethodHandle WICKRA_COPPOCK_NEW; + public static MethodHandle WICKRA_COPPOCK_UPDATE; + public static MethodHandle WICKRA_COPPOCK_BATCH; + public static MethodHandle WICKRA_COPPOCK_RESET; + public static MethodHandle WICKRA_COPPOCK_FREE; + public static MethodHandle WICKRA_CORRELATION_TREND_INDICATOR_NEW; + public static MethodHandle WICKRA_CORRELATION_TREND_INDICATOR_UPDATE; + public static MethodHandle WICKRA_CORRELATION_TREND_INDICATOR_BATCH; + public static MethodHandle WICKRA_CORRELATION_TREND_INDICATOR_RESET; + public static MethodHandle WICKRA_CORRELATION_TREND_INDICATOR_FREE; + public static MethodHandle WICKRA_CYBERNETIC_CYCLE_NEW; + public static MethodHandle WICKRA_CYBERNETIC_CYCLE_UPDATE; + public static MethodHandle WICKRA_CYBERNETIC_CYCLE_BATCH; + public static MethodHandle WICKRA_CYBERNETIC_CYCLE_RESET; + public static MethodHandle WICKRA_CYBERNETIC_CYCLE_FREE; + public static MethodHandle WICKRA_DECYCLER_NEW; + public static MethodHandle WICKRA_DECYCLER_UPDATE; + public static MethodHandle WICKRA_DECYCLER_BATCH; + public static MethodHandle WICKRA_DECYCLER_RESET; + public static MethodHandle WICKRA_DECYCLER_FREE; + public static MethodHandle WICKRA_DECYCLER_OSCILLATOR_NEW; + public static MethodHandle WICKRA_DECYCLER_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_DECYCLER_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_DECYCLER_OSCILLATOR_RESET; + public static MethodHandle WICKRA_DECYCLER_OSCILLATOR_FREE; + public static MethodHandle WICKRA_DEMA_NEW; + public static MethodHandle WICKRA_DEMA_UPDATE; + public static MethodHandle WICKRA_DEMA_BATCH; + public static MethodHandle WICKRA_DEMA_RESET; + public static MethodHandle WICKRA_DEMA_FREE; + public static MethodHandle WICKRA_DERIVATIVE_OSCILLATOR_NEW; + public static MethodHandle WICKRA_DERIVATIVE_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_DERIVATIVE_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_DERIVATIVE_OSCILLATOR_RESET; + public static MethodHandle WICKRA_DERIVATIVE_OSCILLATOR_FREE; + public static MethodHandle WICKRA_DETRENDED_STD_DEV_NEW; + public static MethodHandle WICKRA_DETRENDED_STD_DEV_UPDATE; + public static MethodHandle WICKRA_DETRENDED_STD_DEV_BATCH; + public static MethodHandle WICKRA_DETRENDED_STD_DEV_RESET; + public static MethodHandle WICKRA_DETRENDED_STD_DEV_FREE; + public static MethodHandle WICKRA_DISPARITY_INDEX_NEW; + public static MethodHandle WICKRA_DISPARITY_INDEX_UPDATE; + public static MethodHandle WICKRA_DISPARITY_INDEX_BATCH; + public static MethodHandle WICKRA_DISPARITY_INDEX_RESET; + public static MethodHandle WICKRA_DISPARITY_INDEX_FREE; + public static MethodHandle WICKRA_DPO_NEW; + public static MethodHandle WICKRA_DPO_UPDATE; + public static MethodHandle WICKRA_DPO_BATCH; + public static MethodHandle WICKRA_DPO_RESET; + public static MethodHandle WICKRA_DPO_FREE; + public static MethodHandle WICKRA_DRAWDOWN_DURATION_NEW; + public static MethodHandle WICKRA_DRAWDOWN_DURATION_UPDATE; + public static MethodHandle WICKRA_DRAWDOWN_DURATION_BATCH; + public static MethodHandle WICKRA_DRAWDOWN_DURATION_RESET; + public static MethodHandle WICKRA_DRAWDOWN_DURATION_FREE; + public static MethodHandle WICKRA_DYNAMIC_MOMENTUM_INDEX_NEW; + public static MethodHandle WICKRA_DYNAMIC_MOMENTUM_INDEX_UPDATE; + public static MethodHandle WICKRA_DYNAMIC_MOMENTUM_INDEX_BATCH; + public static MethodHandle WICKRA_DYNAMIC_MOMENTUM_INDEX_RESET; + public static MethodHandle WICKRA_DYNAMIC_MOMENTUM_INDEX_FREE; + public static MethodHandle WICKRA_EHLERS_STOCHASTIC_NEW; + public static MethodHandle WICKRA_EHLERS_STOCHASTIC_UPDATE; + public static MethodHandle WICKRA_EHLERS_STOCHASTIC_BATCH; + public static MethodHandle WICKRA_EHLERS_STOCHASTIC_RESET; + public static MethodHandle WICKRA_EHLERS_STOCHASTIC_FREE; + public static MethodHandle WICKRA_EHMA_NEW; + public static MethodHandle WICKRA_EHMA_UPDATE; + public static MethodHandle WICKRA_EHMA_BATCH; + public static MethodHandle WICKRA_EHMA_RESET; + public static MethodHandle WICKRA_EHMA_FREE; + public static MethodHandle WICKRA_ELDER_IMPULSE_NEW; + public static MethodHandle WICKRA_ELDER_IMPULSE_UPDATE; + public static MethodHandle WICKRA_ELDER_IMPULSE_BATCH; + public static MethodHandle WICKRA_ELDER_IMPULSE_RESET; + public static MethodHandle WICKRA_ELDER_IMPULSE_FREE; + public static MethodHandle WICKRA_EMA_NEW; + public static MethodHandle WICKRA_EMA_UPDATE; + public static MethodHandle WICKRA_EMA_BATCH; + public static MethodHandle WICKRA_EMA_RESET; + public static MethodHandle WICKRA_EMA_FREE; + public static MethodHandle WICKRA_EMPIRICAL_MODE_DECOMPOSITION_NEW; + public static MethodHandle WICKRA_EMPIRICAL_MODE_DECOMPOSITION_UPDATE; + public static MethodHandle WICKRA_EMPIRICAL_MODE_DECOMPOSITION_BATCH; + public static MethodHandle WICKRA_EMPIRICAL_MODE_DECOMPOSITION_RESET; + public static MethodHandle WICKRA_EMPIRICAL_MODE_DECOMPOSITION_FREE; + public static MethodHandle WICKRA_EVEN_BETTER_SINEWAVE_NEW; + public static MethodHandle WICKRA_EVEN_BETTER_SINEWAVE_UPDATE; + public static MethodHandle WICKRA_EVEN_BETTER_SINEWAVE_BATCH; + public static MethodHandle WICKRA_EVEN_BETTER_SINEWAVE_RESET; + public static MethodHandle WICKRA_EVEN_BETTER_SINEWAVE_FREE; + public static MethodHandle WICKRA_EWMA_VOLATILITY_NEW; + public static MethodHandle WICKRA_EWMA_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_EWMA_VOLATILITY_BATCH; + public static MethodHandle WICKRA_EWMA_VOLATILITY_RESET; + public static MethodHandle WICKRA_EWMA_VOLATILITY_FREE; + public static MethodHandle WICKRA_EXPECTANCY_NEW; + public static MethodHandle WICKRA_EXPECTANCY_UPDATE; + public static MethodHandle WICKRA_EXPECTANCY_BATCH; + public static MethodHandle WICKRA_EXPECTANCY_RESET; + public static MethodHandle WICKRA_EXPECTANCY_FREE; + public static MethodHandle WICKRA_FAMA_NEW; + public static MethodHandle WICKRA_FAMA_UPDATE; + public static MethodHandle WICKRA_FAMA_BATCH; + public static MethodHandle WICKRA_FAMA_RESET; + public static MethodHandle WICKRA_FAMA_FREE; + public static MethodHandle WICKRA_FISHER_RSI_NEW; + public static MethodHandle WICKRA_FISHER_RSI_UPDATE; + public static MethodHandle WICKRA_FISHER_RSI_BATCH; + public static MethodHandle WICKRA_FISHER_RSI_RESET; + public static MethodHandle WICKRA_FISHER_RSI_FREE; + public static MethodHandle WICKRA_FISHER_TRANSFORM_NEW; + public static MethodHandle WICKRA_FISHER_TRANSFORM_UPDATE; + public static MethodHandle WICKRA_FISHER_TRANSFORM_BATCH; + public static MethodHandle WICKRA_FISHER_TRANSFORM_RESET; + public static MethodHandle WICKRA_FISHER_TRANSFORM_FREE; + public static MethodHandle WICKRA_FRAMA_NEW; + public static MethodHandle WICKRA_FRAMA_UPDATE; + public static MethodHandle WICKRA_FRAMA_BATCH; + public static MethodHandle WICKRA_FRAMA_RESET; + public static MethodHandle WICKRA_FRAMA_FREE; + public static MethodHandle WICKRA_GAIN_LOSS_RATIO_NEW; + public static MethodHandle WICKRA_GAIN_LOSS_RATIO_UPDATE; + public static MethodHandle WICKRA_GAIN_LOSS_RATIO_BATCH; + public static MethodHandle WICKRA_GAIN_LOSS_RATIO_RESET; + public static MethodHandle WICKRA_GAIN_LOSS_RATIO_FREE; + public static MethodHandle WICKRA_GAIN_TO_PAIN_RATIO_NEW; + public static MethodHandle WICKRA_GAIN_TO_PAIN_RATIO_UPDATE; + public static MethodHandle WICKRA_GAIN_TO_PAIN_RATIO_BATCH; + public static MethodHandle WICKRA_GAIN_TO_PAIN_RATIO_RESET; + public static MethodHandle WICKRA_GAIN_TO_PAIN_RATIO_FREE; + public static MethodHandle WICKRA_GARCH11_NEW; + public static MethodHandle WICKRA_GARCH11_UPDATE; + public static MethodHandle WICKRA_GARCH11_BATCH; + public static MethodHandle WICKRA_GARCH11_RESET; + public static MethodHandle WICKRA_GARCH11_FREE; + public static MethodHandle WICKRA_GENERALIZED_DEMA_NEW; + public static MethodHandle WICKRA_GENERALIZED_DEMA_UPDATE; + public static MethodHandle WICKRA_GENERALIZED_DEMA_BATCH; + public static MethodHandle WICKRA_GENERALIZED_DEMA_RESET; + public static MethodHandle WICKRA_GENERALIZED_DEMA_FREE; + public static MethodHandle WICKRA_GEOMETRIC_MA_NEW; + public static MethodHandle WICKRA_GEOMETRIC_MA_UPDATE; + public static MethodHandle WICKRA_GEOMETRIC_MA_BATCH; + public static MethodHandle WICKRA_GEOMETRIC_MA_RESET; + public static MethodHandle WICKRA_GEOMETRIC_MA_FREE; + public static MethodHandle WICKRA_HIGHPASS_FILTER_NEW; + public static MethodHandle WICKRA_HIGHPASS_FILTER_UPDATE; + public static MethodHandle WICKRA_HIGHPASS_FILTER_BATCH; + public static MethodHandle WICKRA_HIGHPASS_FILTER_RESET; + public static MethodHandle WICKRA_HIGHPASS_FILTER_FREE; + public static MethodHandle WICKRA_HILBERT_DOMINANT_CYCLE_NEW; + public static MethodHandle WICKRA_HILBERT_DOMINANT_CYCLE_UPDATE; + public static MethodHandle WICKRA_HILBERT_DOMINANT_CYCLE_BATCH; + public static MethodHandle WICKRA_HILBERT_DOMINANT_CYCLE_RESET; + public static MethodHandle WICKRA_HILBERT_DOMINANT_CYCLE_FREE; + public static MethodHandle WICKRA_HISTORICAL_VOLATILITY_NEW; + public static MethodHandle WICKRA_HISTORICAL_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_HISTORICAL_VOLATILITY_BATCH; + public static MethodHandle WICKRA_HISTORICAL_VOLATILITY_RESET; + public static MethodHandle WICKRA_HISTORICAL_VOLATILITY_FREE; + public static MethodHandle WICKRA_HMA_NEW; + public static MethodHandle WICKRA_HMA_UPDATE; + public static MethodHandle WICKRA_HMA_BATCH; + public static MethodHandle WICKRA_HMA_RESET; + public static MethodHandle WICKRA_HMA_FREE; + public static MethodHandle WICKRA_HOLT_WINTERS_NEW; + public static MethodHandle WICKRA_HOLT_WINTERS_UPDATE; + public static MethodHandle WICKRA_HOLT_WINTERS_BATCH; + public static MethodHandle WICKRA_HOLT_WINTERS_RESET; + public static MethodHandle WICKRA_HOLT_WINTERS_FREE; + public static MethodHandle WICKRA_HT_DC_PHASE_NEW; + public static MethodHandle WICKRA_HT_DC_PHASE_UPDATE; + public static MethodHandle WICKRA_HT_DC_PHASE_BATCH; + public static MethodHandle WICKRA_HT_DC_PHASE_RESET; + public static MethodHandle WICKRA_HT_DC_PHASE_FREE; + public static MethodHandle WICKRA_HT_TREND_MODE_NEW; + public static MethodHandle WICKRA_HT_TREND_MODE_UPDATE; + public static MethodHandle WICKRA_HT_TREND_MODE_BATCH; + public static MethodHandle WICKRA_HT_TREND_MODE_RESET; + public static MethodHandle WICKRA_HT_TREND_MODE_FREE; + public static MethodHandle WICKRA_HURST_EXPONENT_NEW; + public static MethodHandle WICKRA_HURST_EXPONENT_UPDATE; + public static MethodHandle WICKRA_HURST_EXPONENT_BATCH; + public static MethodHandle WICKRA_HURST_EXPONENT_RESET; + public static MethodHandle WICKRA_HURST_EXPONENT_FREE; + public static MethodHandle WICKRA_INSTANTANEOUS_TRENDLINE_NEW; + public static MethodHandle WICKRA_INSTANTANEOUS_TRENDLINE_UPDATE; + public static MethodHandle WICKRA_INSTANTANEOUS_TRENDLINE_BATCH; + public static MethodHandle WICKRA_INSTANTANEOUS_TRENDLINE_RESET; + public static MethodHandle WICKRA_INSTANTANEOUS_TRENDLINE_FREE; + public static MethodHandle WICKRA_INVERSE_FISHER_TRANSFORM_NEW; + public static MethodHandle WICKRA_INVERSE_FISHER_TRANSFORM_UPDATE; + public static MethodHandle WICKRA_INVERSE_FISHER_TRANSFORM_BATCH; + public static MethodHandle WICKRA_INVERSE_FISHER_TRANSFORM_RESET; + public static MethodHandle WICKRA_INVERSE_FISHER_TRANSFORM_FREE; + public static MethodHandle WICKRA_JARQUE_BERA_NEW; + public static MethodHandle WICKRA_JARQUE_BERA_UPDATE; + public static MethodHandle WICKRA_JARQUE_BERA_BATCH; + public static MethodHandle WICKRA_JARQUE_BERA_RESET; + public static MethodHandle WICKRA_JARQUE_BERA_FREE; + public static MethodHandle WICKRA_JMA_NEW; + public static MethodHandle WICKRA_JMA_UPDATE; + public static MethodHandle WICKRA_JMA_BATCH; + public static MethodHandle WICKRA_JMA_RESET; + public static MethodHandle WICKRA_JMA_FREE; + public static MethodHandle WICKRA_JUMP_INDICATOR_NEW; + public static MethodHandle WICKRA_JUMP_INDICATOR_UPDATE; + public static MethodHandle WICKRA_JUMP_INDICATOR_BATCH; + public static MethodHandle WICKRA_JUMP_INDICATOR_RESET; + public static MethodHandle WICKRA_JUMP_INDICATOR_FREE; + public static MethodHandle WICKRA_K_RATIO_NEW; + public static MethodHandle WICKRA_K_RATIO_UPDATE; + public static MethodHandle WICKRA_K_RATIO_BATCH; + public static MethodHandle WICKRA_K_RATIO_RESET; + public static MethodHandle WICKRA_K_RATIO_FREE; + public static MethodHandle WICKRA_KAMA_NEW; + public static MethodHandle WICKRA_KAMA_UPDATE; + public static MethodHandle WICKRA_KAMA_BATCH; + public static MethodHandle WICKRA_KAMA_RESET; + public static MethodHandle WICKRA_KAMA_FREE; + public static MethodHandle WICKRA_KELLY_CRITERION_NEW; + public static MethodHandle WICKRA_KELLY_CRITERION_UPDATE; + public static MethodHandle WICKRA_KELLY_CRITERION_BATCH; + public static MethodHandle WICKRA_KELLY_CRITERION_RESET; + public static MethodHandle WICKRA_KELLY_CRITERION_FREE; + public static MethodHandle WICKRA_KURTOSIS_NEW; + public static MethodHandle WICKRA_KURTOSIS_UPDATE; + public static MethodHandle WICKRA_KURTOSIS_BATCH; + public static MethodHandle WICKRA_KURTOSIS_RESET; + public static MethodHandle WICKRA_KURTOSIS_FREE; + public static MethodHandle WICKRA_LAGUERRE_RSI_NEW; + public static MethodHandle WICKRA_LAGUERRE_RSI_UPDATE; + public static MethodHandle WICKRA_LAGUERRE_RSI_BATCH; + public static MethodHandle WICKRA_LAGUERRE_RSI_RESET; + public static MethodHandle WICKRA_LAGUERRE_RSI_FREE; + public static MethodHandle WICKRA_LINEAR_REGRESSION_NEW; + public static MethodHandle WICKRA_LINEAR_REGRESSION_UPDATE; + public static MethodHandle WICKRA_LINEAR_REGRESSION_BATCH; + public static MethodHandle WICKRA_LINEAR_REGRESSION_RESET; + public static MethodHandle WICKRA_LINEAR_REGRESSION_FREE; + public static MethodHandle WICKRA_LIN_REG_ANGLE_NEW; + public static MethodHandle WICKRA_LIN_REG_ANGLE_UPDATE; + public static MethodHandle WICKRA_LIN_REG_ANGLE_BATCH; + public static MethodHandle WICKRA_LIN_REG_ANGLE_RESET; + public static MethodHandle WICKRA_LIN_REG_ANGLE_FREE; + public static MethodHandle WICKRA_LIN_REG_INTERCEPT_NEW; + public static MethodHandle WICKRA_LIN_REG_INTERCEPT_UPDATE; + public static MethodHandle WICKRA_LIN_REG_INTERCEPT_BATCH; + public static MethodHandle WICKRA_LIN_REG_INTERCEPT_RESET; + public static MethodHandle WICKRA_LIN_REG_INTERCEPT_FREE; + public static MethodHandle WICKRA_LIN_REG_SLOPE_NEW; + public static MethodHandle WICKRA_LIN_REG_SLOPE_UPDATE; + public static MethodHandle WICKRA_LIN_REG_SLOPE_BATCH; + public static MethodHandle WICKRA_LIN_REG_SLOPE_RESET; + public static MethodHandle WICKRA_LIN_REG_SLOPE_FREE; + public static MethodHandle WICKRA_LOG_RETURN_NEW; + public static MethodHandle WICKRA_LOG_RETURN_UPDATE; + public static MethodHandle WICKRA_LOG_RETURN_BATCH; + public static MethodHandle WICKRA_LOG_RETURN_RESET; + public static MethodHandle WICKRA_LOG_RETURN_FREE; + public static MethodHandle WICKRA_M2_MEASURE_NEW; + public static MethodHandle WICKRA_M2_MEASURE_UPDATE; + public static MethodHandle WICKRA_M2_MEASURE_BATCH; + public static MethodHandle WICKRA_M2_MEASURE_RESET; + public static MethodHandle WICKRA_M2_MEASURE_FREE; + public static MethodHandle WICKRA_MACD_HISTOGRAM_NEW; + public static MethodHandle WICKRA_MACD_HISTOGRAM_UPDATE; + public static MethodHandle WICKRA_MACD_HISTOGRAM_BATCH; + public static MethodHandle WICKRA_MACD_HISTOGRAM_RESET; + public static MethodHandle WICKRA_MACD_HISTOGRAM_FREE; + public static MethodHandle WICKRA_MARTIN_RATIO_NEW; + public static MethodHandle WICKRA_MARTIN_RATIO_UPDATE; + public static MethodHandle WICKRA_MARTIN_RATIO_BATCH; + public static MethodHandle WICKRA_MARTIN_RATIO_RESET; + public static MethodHandle WICKRA_MARTIN_RATIO_FREE; + public static MethodHandle WICKRA_MAX_DRAWDOWN_NEW; + public static MethodHandle WICKRA_MAX_DRAWDOWN_UPDATE; + public static MethodHandle WICKRA_MAX_DRAWDOWN_BATCH; + public static MethodHandle WICKRA_MAX_DRAWDOWN_RESET; + public static MethodHandle WICKRA_MAX_DRAWDOWN_FREE; + public static MethodHandle WICKRA_MC_GINLEY_DYNAMIC_NEW; + public static MethodHandle WICKRA_MC_GINLEY_DYNAMIC_UPDATE; + public static MethodHandle WICKRA_MC_GINLEY_DYNAMIC_BATCH; + public static MethodHandle WICKRA_MC_GINLEY_DYNAMIC_RESET; + public static MethodHandle WICKRA_MC_GINLEY_DYNAMIC_FREE; + public static MethodHandle WICKRA_MEDIAN_ABSOLUTE_DEVIATION_NEW; + public static MethodHandle WICKRA_MEDIAN_ABSOLUTE_DEVIATION_UPDATE; + public static MethodHandle WICKRA_MEDIAN_ABSOLUTE_DEVIATION_BATCH; + public static MethodHandle WICKRA_MEDIAN_ABSOLUTE_DEVIATION_RESET; + public static MethodHandle WICKRA_MEDIAN_ABSOLUTE_DEVIATION_FREE; + public static MethodHandle WICKRA_MEDIAN_MA_NEW; + public static MethodHandle WICKRA_MEDIAN_MA_UPDATE; + public static MethodHandle WICKRA_MEDIAN_MA_BATCH; + public static MethodHandle WICKRA_MEDIAN_MA_RESET; + public static MethodHandle WICKRA_MEDIAN_MA_FREE; + public static MethodHandle WICKRA_MID_POINT_NEW; + public static MethodHandle WICKRA_MID_POINT_UPDATE; + public static MethodHandle WICKRA_MID_POINT_BATCH; + public static MethodHandle WICKRA_MID_POINT_RESET; + public static MethodHandle WICKRA_MID_POINT_FREE; + public static MethodHandle WICKRA_MOM_NEW; + public static MethodHandle WICKRA_MOM_UPDATE; + public static MethodHandle WICKRA_MOM_BATCH; + public static MethodHandle WICKRA_MOM_RESET; + public static MethodHandle WICKRA_MOM_FREE; + public static MethodHandle WICKRA_OMEGA_RATIO_NEW; + public static MethodHandle WICKRA_OMEGA_RATIO_UPDATE; + public static MethodHandle WICKRA_OMEGA_RATIO_BATCH; + public static MethodHandle WICKRA_OMEGA_RATIO_RESET; + public static MethodHandle WICKRA_OMEGA_RATIO_FREE; + public static MethodHandle WICKRA_PAIN_INDEX_NEW; + public static MethodHandle WICKRA_PAIN_INDEX_UPDATE; + public static MethodHandle WICKRA_PAIN_INDEX_BATCH; + public static MethodHandle WICKRA_PAIN_INDEX_RESET; + public static MethodHandle WICKRA_PAIN_INDEX_FREE; + public static MethodHandle WICKRA_PERCENT_B_NEW; + public static MethodHandle WICKRA_PERCENT_B_UPDATE; + public static MethodHandle WICKRA_PERCENT_B_BATCH; + public static MethodHandle WICKRA_PERCENT_B_RESET; + public static MethodHandle WICKRA_PERCENT_B_FREE; + public static MethodHandle WICKRA_PERCENTAGE_TRAILING_STOP_NEW; + public static MethodHandle WICKRA_PERCENTAGE_TRAILING_STOP_UPDATE; + public static MethodHandle WICKRA_PERCENTAGE_TRAILING_STOP_BATCH; + public static MethodHandle WICKRA_PERCENTAGE_TRAILING_STOP_RESET; + public static MethodHandle WICKRA_PERCENTAGE_TRAILING_STOP_FREE; + public static MethodHandle WICKRA_PMO_NEW; + public static MethodHandle WICKRA_PMO_UPDATE; + public static MethodHandle WICKRA_PMO_BATCH; + public static MethodHandle WICKRA_PMO_RESET; + public static MethodHandle WICKRA_PMO_FREE; + public static MethodHandle WICKRA_POLARIZED_FRACTAL_EFFICIENCY_NEW; + public static MethodHandle WICKRA_POLARIZED_FRACTAL_EFFICIENCY_UPDATE; + public static MethodHandle WICKRA_POLARIZED_FRACTAL_EFFICIENCY_BATCH; + public static MethodHandle WICKRA_POLARIZED_FRACTAL_EFFICIENCY_RESET; + public static MethodHandle WICKRA_POLARIZED_FRACTAL_EFFICIENCY_FREE; + public static MethodHandle WICKRA_PPO_NEW; + public static MethodHandle WICKRA_PPO_UPDATE; + public static MethodHandle WICKRA_PPO_BATCH; + public static MethodHandle WICKRA_PPO_RESET; + public static MethodHandle WICKRA_PPO_FREE; + public static MethodHandle WICKRA_PPO_HISTOGRAM_NEW; + public static MethodHandle WICKRA_PPO_HISTOGRAM_UPDATE; + public static MethodHandle WICKRA_PPO_HISTOGRAM_BATCH; + public static MethodHandle WICKRA_PPO_HISTOGRAM_RESET; + public static MethodHandle WICKRA_PPO_HISTOGRAM_FREE; + public static MethodHandle WICKRA_PROFIT_FACTOR_NEW; + public static MethodHandle WICKRA_PROFIT_FACTOR_UPDATE; + public static MethodHandle WICKRA_PROFIT_FACTOR_BATCH; + public static MethodHandle WICKRA_PROFIT_FACTOR_RESET; + public static MethodHandle WICKRA_PROFIT_FACTOR_FREE; + public static MethodHandle WICKRA_R_SQUARED_NEW; + public static MethodHandle WICKRA_R_SQUARED_UPDATE; + public static MethodHandle WICKRA_R_SQUARED_BATCH; + public static MethodHandle WICKRA_R_SQUARED_RESET; + public static MethodHandle WICKRA_R_SQUARED_FREE; + public static MethodHandle WICKRA_REALIZED_VOLATILITY_NEW; + public static MethodHandle WICKRA_REALIZED_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_REALIZED_VOLATILITY_BATCH; + public static MethodHandle WICKRA_REALIZED_VOLATILITY_RESET; + public static MethodHandle WICKRA_REALIZED_VOLATILITY_FREE; + public static MethodHandle WICKRA_RECOVERY_FACTOR_NEW; + public static MethodHandle WICKRA_RECOVERY_FACTOR_UPDATE; + public static MethodHandle WICKRA_RECOVERY_FACTOR_BATCH; + public static MethodHandle WICKRA_RECOVERY_FACTOR_RESET; + public static MethodHandle WICKRA_RECOVERY_FACTOR_FREE; + public static MethodHandle WICKRA_REFLEX_NEW; + public static MethodHandle WICKRA_REFLEX_UPDATE; + public static MethodHandle WICKRA_REFLEX_BATCH; + public static MethodHandle WICKRA_REFLEX_RESET; + public static MethodHandle WICKRA_REFLEX_FREE; + public static MethodHandle WICKRA_REGIME_LABEL_NEW; + public static MethodHandle WICKRA_REGIME_LABEL_UPDATE; + public static MethodHandle WICKRA_REGIME_LABEL_BATCH; + public static MethodHandle WICKRA_REGIME_LABEL_RESET; + public static MethodHandle WICKRA_REGIME_LABEL_FREE; + public static MethodHandle WICKRA_RENKO_TRAILING_STOP_NEW; + public static MethodHandle WICKRA_RENKO_TRAILING_STOP_UPDATE; + public static MethodHandle WICKRA_RENKO_TRAILING_STOP_BATCH; + public static MethodHandle WICKRA_RENKO_TRAILING_STOP_RESET; + public static MethodHandle WICKRA_RENKO_TRAILING_STOP_FREE; + public static MethodHandle WICKRA_RMI_NEW; + public static MethodHandle WICKRA_RMI_UPDATE; + public static MethodHandle WICKRA_RMI_BATCH; + public static MethodHandle WICKRA_RMI_RESET; + public static MethodHandle WICKRA_RMI_FREE; + public static MethodHandle WICKRA_ROC_NEW; + public static MethodHandle WICKRA_ROC_UPDATE; + public static MethodHandle WICKRA_ROC_BATCH; + public static MethodHandle WICKRA_ROC_RESET; + public static MethodHandle WICKRA_ROC_FREE; + public static MethodHandle WICKRA_ROCP_NEW; + public static MethodHandle WICKRA_ROCP_UPDATE; + public static MethodHandle WICKRA_ROCP_BATCH; + public static MethodHandle WICKRA_ROCP_RESET; + public static MethodHandle WICKRA_ROCP_FREE; + public static MethodHandle WICKRA_ROCR_NEW; + public static MethodHandle WICKRA_ROCR_UPDATE; + public static MethodHandle WICKRA_ROCR_BATCH; + public static MethodHandle WICKRA_ROCR_RESET; + public static MethodHandle WICKRA_ROCR_FREE; + public static MethodHandle WICKRA_ROCR100_NEW; + public static MethodHandle WICKRA_ROCR100_UPDATE; + public static MethodHandle WICKRA_ROCR100_BATCH; + public static MethodHandle WICKRA_ROCR100_RESET; + public static MethodHandle WICKRA_ROCR100_FREE; + public static MethodHandle WICKRA_ROLLING_IQR_NEW; + public static MethodHandle WICKRA_ROLLING_IQR_UPDATE; + public static MethodHandle WICKRA_ROLLING_IQR_BATCH; + public static MethodHandle WICKRA_ROLLING_IQR_RESET; + public static MethodHandle WICKRA_ROLLING_IQR_FREE; + public static MethodHandle WICKRA_ROLLING_MIN_MAX_SCALER_NEW; + public static MethodHandle WICKRA_ROLLING_MIN_MAX_SCALER_UPDATE; + public static MethodHandle WICKRA_ROLLING_MIN_MAX_SCALER_BATCH; + public static MethodHandle WICKRA_ROLLING_MIN_MAX_SCALER_RESET; + public static MethodHandle WICKRA_ROLLING_MIN_MAX_SCALER_FREE; + public static MethodHandle WICKRA_ROLLING_PERCENTILE_RANK_NEW; + public static MethodHandle WICKRA_ROLLING_PERCENTILE_RANK_UPDATE; + public static MethodHandle WICKRA_ROLLING_PERCENTILE_RANK_BATCH; + public static MethodHandle WICKRA_ROLLING_PERCENTILE_RANK_RESET; + public static MethodHandle WICKRA_ROLLING_PERCENTILE_RANK_FREE; + public static MethodHandle WICKRA_ROLLING_QUANTILE_NEW; + public static MethodHandle WICKRA_ROLLING_QUANTILE_UPDATE; + public static MethodHandle WICKRA_ROLLING_QUANTILE_BATCH; + public static MethodHandle WICKRA_ROLLING_QUANTILE_RESET; + public static MethodHandle WICKRA_ROLLING_QUANTILE_FREE; + public static MethodHandle WICKRA_ROOFING_FILTER_NEW; + public static MethodHandle WICKRA_ROOFING_FILTER_UPDATE; + public static MethodHandle WICKRA_ROOFING_FILTER_BATCH; + public static MethodHandle WICKRA_ROOFING_FILTER_RESET; + public static MethodHandle WICKRA_ROOFING_FILTER_FREE; + public static MethodHandle WICKRA_RSI_NEW; + public static MethodHandle WICKRA_RSI_UPDATE; + public static MethodHandle WICKRA_RSI_BATCH; + public static MethodHandle WICKRA_RSI_RESET; + public static MethodHandle WICKRA_RSI_FREE; + public static MethodHandle WICKRA_RSX_NEW; + public static MethodHandle WICKRA_RSX_UPDATE; + public static MethodHandle WICKRA_RSX_BATCH; + public static MethodHandle WICKRA_RSX_RESET; + public static MethodHandle WICKRA_RSX_FREE; + public static MethodHandle WICKRA_RVI_VOLATILITY_NEW; + public static MethodHandle WICKRA_RVI_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_RVI_VOLATILITY_BATCH; + public static MethodHandle WICKRA_RVI_VOLATILITY_RESET; + public static MethodHandle WICKRA_RVI_VOLATILITY_FREE; + public static MethodHandle WICKRA_SAMPLE_ENTROPY_NEW; + public static MethodHandle WICKRA_SAMPLE_ENTROPY_UPDATE; + public static MethodHandle WICKRA_SAMPLE_ENTROPY_BATCH; + public static MethodHandle WICKRA_SAMPLE_ENTROPY_RESET; + public static MethodHandle WICKRA_SAMPLE_ENTROPY_FREE; + public static MethodHandle WICKRA_SHANNON_ENTROPY_NEW; + public static MethodHandle WICKRA_SHANNON_ENTROPY_UPDATE; + public static MethodHandle WICKRA_SHANNON_ENTROPY_BATCH; + public static MethodHandle WICKRA_SHANNON_ENTROPY_RESET; + public static MethodHandle WICKRA_SHANNON_ENTROPY_FREE; + public static MethodHandle WICKRA_SHARPE_RATIO_NEW; + public static MethodHandle WICKRA_SHARPE_RATIO_UPDATE; + public static MethodHandle WICKRA_SHARPE_RATIO_BATCH; + public static MethodHandle WICKRA_SHARPE_RATIO_RESET; + public static MethodHandle WICKRA_SHARPE_RATIO_FREE; + public static MethodHandle WICKRA_SINE_WAVE_NEW; + public static MethodHandle WICKRA_SINE_WAVE_UPDATE; + public static MethodHandle WICKRA_SINE_WAVE_BATCH; + public static MethodHandle WICKRA_SINE_WAVE_RESET; + public static MethodHandle WICKRA_SINE_WAVE_FREE; + public static MethodHandle WICKRA_SINE_WEIGHTED_MA_NEW; + public static MethodHandle WICKRA_SINE_WEIGHTED_MA_UPDATE; + public static MethodHandle WICKRA_SINE_WEIGHTED_MA_BATCH; + public static MethodHandle WICKRA_SINE_WEIGHTED_MA_RESET; + public static MethodHandle WICKRA_SINE_WEIGHTED_MA_FREE; + public static MethodHandle WICKRA_SKEWNESS_NEW; + public static MethodHandle WICKRA_SKEWNESS_UPDATE; + public static MethodHandle WICKRA_SKEWNESS_BATCH; + public static MethodHandle WICKRA_SKEWNESS_RESET; + public static MethodHandle WICKRA_SKEWNESS_FREE; + public static MethodHandle WICKRA_SMA_NEW; + public static MethodHandle WICKRA_SMA_UPDATE; + public static MethodHandle WICKRA_SMA_BATCH; + public static MethodHandle WICKRA_SMA_RESET; + public static MethodHandle WICKRA_SMA_FREE; + public static MethodHandle WICKRA_SMMA_NEW; + public static MethodHandle WICKRA_SMMA_UPDATE; + public static MethodHandle WICKRA_SMMA_BATCH; + public static MethodHandle WICKRA_SMMA_RESET; + public static MethodHandle WICKRA_SMMA_FREE; + public static MethodHandle WICKRA_SORTINO_RATIO_NEW; + public static MethodHandle WICKRA_SORTINO_RATIO_UPDATE; + public static MethodHandle WICKRA_SORTINO_RATIO_BATCH; + public static MethodHandle WICKRA_SORTINO_RATIO_RESET; + public static MethodHandle WICKRA_SORTINO_RATIO_FREE; + public static MethodHandle WICKRA_STANDARD_ERROR_NEW; + public static MethodHandle WICKRA_STANDARD_ERROR_UPDATE; + public static MethodHandle WICKRA_STANDARD_ERROR_BATCH; + public static MethodHandle WICKRA_STANDARD_ERROR_RESET; + public static MethodHandle WICKRA_STANDARD_ERROR_FREE; + public static MethodHandle WICKRA_STC_NEW; + public static MethodHandle WICKRA_STC_UPDATE; + public static MethodHandle WICKRA_STC_BATCH; + public static MethodHandle WICKRA_STC_RESET; + public static MethodHandle WICKRA_STC_FREE; + public static MethodHandle WICKRA_STD_DEV_NEW; + public static MethodHandle WICKRA_STD_DEV_UPDATE; + public static MethodHandle WICKRA_STD_DEV_BATCH; + public static MethodHandle WICKRA_STD_DEV_RESET; + public static MethodHandle WICKRA_STD_DEV_FREE; + public static MethodHandle WICKRA_STEP_TRAILING_STOP_NEW; + public static MethodHandle WICKRA_STEP_TRAILING_STOP_UPDATE; + public static MethodHandle WICKRA_STEP_TRAILING_STOP_BATCH; + public static MethodHandle WICKRA_STEP_TRAILING_STOP_RESET; + public static MethodHandle WICKRA_STEP_TRAILING_STOP_FREE; + public static MethodHandle WICKRA_STERLING_RATIO_NEW; + public static MethodHandle WICKRA_STERLING_RATIO_UPDATE; + public static MethodHandle WICKRA_STERLING_RATIO_BATCH; + public static MethodHandle WICKRA_STERLING_RATIO_RESET; + public static MethodHandle WICKRA_STERLING_RATIO_FREE; + public static MethodHandle WICKRA_STOCH_RSI_NEW; + public static MethodHandle WICKRA_STOCH_RSI_UPDATE; + public static MethodHandle WICKRA_STOCH_RSI_BATCH; + public static MethodHandle WICKRA_STOCH_RSI_RESET; + public static MethodHandle WICKRA_STOCH_RSI_FREE; + public static MethodHandle WICKRA_SUPER_SMOOTHER_NEW; + public static MethodHandle WICKRA_SUPER_SMOOTHER_UPDATE; + public static MethodHandle WICKRA_SUPER_SMOOTHER_BATCH; + public static MethodHandle WICKRA_SUPER_SMOOTHER_RESET; + public static MethodHandle WICKRA_SUPER_SMOOTHER_FREE; + public static MethodHandle WICKRA_T3_NEW; + public static MethodHandle WICKRA_T3_UPDATE; + public static MethodHandle WICKRA_T3_BATCH; + public static MethodHandle WICKRA_T3_RESET; + public static MethodHandle WICKRA_T3_FREE; + public static MethodHandle WICKRA_TAIL_RATIO_NEW; + public static MethodHandle WICKRA_TAIL_RATIO_UPDATE; + public static MethodHandle WICKRA_TAIL_RATIO_BATCH; + public static MethodHandle WICKRA_TAIL_RATIO_RESET; + public static MethodHandle WICKRA_TAIL_RATIO_FREE; + public static MethodHandle WICKRA_TEMA_NEW; + public static MethodHandle WICKRA_TEMA_UPDATE; + public static MethodHandle WICKRA_TEMA_BATCH; + public static MethodHandle WICKRA_TEMA_RESET; + public static MethodHandle WICKRA_TEMA_FREE; + public static MethodHandle WICKRA_TII_NEW; + public static MethodHandle WICKRA_TII_UPDATE; + public static MethodHandle WICKRA_TII_BATCH; + public static MethodHandle WICKRA_TII_RESET; + public static MethodHandle WICKRA_TII_FREE; + public static MethodHandle WICKRA_TREND_LABEL_NEW; + public static MethodHandle WICKRA_TREND_LABEL_UPDATE; + public static MethodHandle WICKRA_TREND_LABEL_BATCH; + public static MethodHandle WICKRA_TREND_LABEL_RESET; + public static MethodHandle WICKRA_TREND_LABEL_FREE; + public static MethodHandle WICKRA_TREND_STRENGTH_INDEX_NEW; + public static MethodHandle WICKRA_TREND_STRENGTH_INDEX_UPDATE; + public static MethodHandle WICKRA_TREND_STRENGTH_INDEX_BATCH; + public static MethodHandle WICKRA_TREND_STRENGTH_INDEX_RESET; + public static MethodHandle WICKRA_TREND_STRENGTH_INDEX_FREE; + public static MethodHandle WICKRA_TRENDFLEX_NEW; + public static MethodHandle WICKRA_TRENDFLEX_UPDATE; + public static MethodHandle WICKRA_TRENDFLEX_BATCH; + public static MethodHandle WICKRA_TRENDFLEX_RESET; + public static MethodHandle WICKRA_TRENDFLEX_FREE; + public static MethodHandle WICKRA_TRIMA_NEW; + public static MethodHandle WICKRA_TRIMA_UPDATE; + public static MethodHandle WICKRA_TRIMA_BATCH; + public static MethodHandle WICKRA_TRIMA_RESET; + public static MethodHandle WICKRA_TRIMA_FREE; + public static MethodHandle WICKRA_TRIX_NEW; + public static MethodHandle WICKRA_TRIX_UPDATE; + public static MethodHandle WICKRA_TRIX_BATCH; + public static MethodHandle WICKRA_TRIX_RESET; + public static MethodHandle WICKRA_TRIX_FREE; + public static MethodHandle WICKRA_TSF_NEW; + public static MethodHandle WICKRA_TSF_UPDATE; + public static MethodHandle WICKRA_TSF_BATCH; + public static MethodHandle WICKRA_TSF_RESET; + public static MethodHandle WICKRA_TSF_FREE; + public static MethodHandle WICKRA_TSF_OSCILLATOR_NEW; + public static MethodHandle WICKRA_TSF_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_TSF_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_TSF_OSCILLATOR_RESET; + public static MethodHandle WICKRA_TSF_OSCILLATOR_FREE; + public static MethodHandle WICKRA_TSI_NEW; + public static MethodHandle WICKRA_TSI_UPDATE; + public static MethodHandle WICKRA_TSI_BATCH; + public static MethodHandle WICKRA_TSI_RESET; + public static MethodHandle WICKRA_TSI_FREE; + public static MethodHandle WICKRA_ULCER_INDEX_NEW; + public static MethodHandle WICKRA_ULCER_INDEX_UPDATE; + public static MethodHandle WICKRA_ULCER_INDEX_BATCH; + public static MethodHandle WICKRA_ULCER_INDEX_RESET; + public static MethodHandle WICKRA_ULCER_INDEX_FREE; + public static MethodHandle WICKRA_UNIVERSAL_OSCILLATOR_NEW; + public static MethodHandle WICKRA_UNIVERSAL_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_UNIVERSAL_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_UNIVERSAL_OSCILLATOR_RESET; + public static MethodHandle WICKRA_UNIVERSAL_OSCILLATOR_FREE; + public static MethodHandle WICKRA_UPSIDE_POTENTIAL_RATIO_NEW; + public static MethodHandle WICKRA_UPSIDE_POTENTIAL_RATIO_UPDATE; + public static MethodHandle WICKRA_UPSIDE_POTENTIAL_RATIO_BATCH; + public static MethodHandle WICKRA_UPSIDE_POTENTIAL_RATIO_RESET; + public static MethodHandle WICKRA_UPSIDE_POTENTIAL_RATIO_FREE; + public static MethodHandle WICKRA_VALUE_AT_RISK_NEW; + public static MethodHandle WICKRA_VALUE_AT_RISK_UPDATE; + public static MethodHandle WICKRA_VALUE_AT_RISK_BATCH; + public static MethodHandle WICKRA_VALUE_AT_RISK_RESET; + public static MethodHandle WICKRA_VALUE_AT_RISK_FREE; + public static MethodHandle WICKRA_VARIANCE_NEW; + public static MethodHandle WICKRA_VARIANCE_UPDATE; + public static MethodHandle WICKRA_VARIANCE_BATCH; + public static MethodHandle WICKRA_VARIANCE_RESET; + public static MethodHandle WICKRA_VARIANCE_FREE; + public static MethodHandle WICKRA_VERTICAL_HORIZONTAL_FILTER_NEW; + public static MethodHandle WICKRA_VERTICAL_HORIZONTAL_FILTER_UPDATE; + public static MethodHandle WICKRA_VERTICAL_HORIZONTAL_FILTER_BATCH; + public static MethodHandle WICKRA_VERTICAL_HORIZONTAL_FILTER_RESET; + public static MethodHandle WICKRA_VERTICAL_HORIZONTAL_FILTER_FREE; + public static MethodHandle WICKRA_VIDYA_NEW; + public static MethodHandle WICKRA_VIDYA_UPDATE; + public static MethodHandle WICKRA_VIDYA_BATCH; + public static MethodHandle WICKRA_VIDYA_RESET; + public static MethodHandle WICKRA_VIDYA_FREE; + public static MethodHandle WICKRA_VOLATILITY_OF_VOLATILITY_NEW; + public static MethodHandle WICKRA_VOLATILITY_OF_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_VOLATILITY_OF_VOLATILITY_BATCH; + public static MethodHandle WICKRA_VOLATILITY_OF_VOLATILITY_RESET; + public static MethodHandle WICKRA_VOLATILITY_OF_VOLATILITY_FREE; + public static MethodHandle WICKRA_WAVE_PM_NEW; + public static MethodHandle WICKRA_WAVE_PM_UPDATE; + public static MethodHandle WICKRA_WAVE_PM_BATCH; + public static MethodHandle WICKRA_WAVE_PM_RESET; + public static MethodHandle WICKRA_WAVE_PM_FREE; + public static MethodHandle WICKRA_WIN_RATE_NEW; + public static MethodHandle WICKRA_WIN_RATE_UPDATE; + public static MethodHandle WICKRA_WIN_RATE_BATCH; + public static MethodHandle WICKRA_WIN_RATE_RESET; + public static MethodHandle WICKRA_WIN_RATE_FREE; + public static MethodHandle WICKRA_WMA_NEW; + public static MethodHandle WICKRA_WMA_UPDATE; + public static MethodHandle WICKRA_WMA_BATCH; + public static MethodHandle WICKRA_WMA_RESET; + public static MethodHandle WICKRA_WMA_FREE; + public static MethodHandle WICKRA_Z_SCORE_NEW; + public static MethodHandle WICKRA_Z_SCORE_UPDATE; + public static MethodHandle WICKRA_Z_SCORE_BATCH; + public static MethodHandle WICKRA_Z_SCORE_RESET; + public static MethodHandle WICKRA_Z_SCORE_FREE; + public static MethodHandle WICKRA_ZLEMA_NEW; + public static MethodHandle WICKRA_ZLEMA_UPDATE; + public static MethodHandle WICKRA_ZLEMA_BATCH; + public static MethodHandle WICKRA_ZLEMA_RESET; + public static MethodHandle WICKRA_ZLEMA_FREE; + public static MethodHandle WICKRA_ALPHA_NEW; + public static MethodHandle WICKRA_ALPHA_UPDATE; + public static MethodHandle WICKRA_ALPHA_BATCH; + public static MethodHandle WICKRA_ALPHA_RESET; + public static MethodHandle WICKRA_ALPHA_FREE; + public static MethodHandle WICKRA_BETA_NEW; + public static MethodHandle WICKRA_BETA_UPDATE; + public static MethodHandle WICKRA_BETA_BATCH; + public static MethodHandle WICKRA_BETA_RESET; + public static MethodHandle WICKRA_BETA_FREE; + public static MethodHandle WICKRA_BETA_NEUTRAL_SPREAD_NEW; + public static MethodHandle WICKRA_BETA_NEUTRAL_SPREAD_UPDATE; + public static MethodHandle WICKRA_BETA_NEUTRAL_SPREAD_BATCH; + public static MethodHandle WICKRA_BETA_NEUTRAL_SPREAD_RESET; + public static MethodHandle WICKRA_BETA_NEUTRAL_SPREAD_FREE; + public static MethodHandle WICKRA_DISTANCE_SSD_NEW; + public static MethodHandle WICKRA_DISTANCE_SSD_UPDATE; + public static MethodHandle WICKRA_DISTANCE_SSD_BATCH; + public static MethodHandle WICKRA_DISTANCE_SSD_RESET; + public static MethodHandle WICKRA_DISTANCE_SSD_FREE; + public static MethodHandle WICKRA_GRANGER_CAUSALITY_NEW; + public static MethodHandle WICKRA_GRANGER_CAUSALITY_UPDATE; + public static MethodHandle WICKRA_GRANGER_CAUSALITY_BATCH; + public static MethodHandle WICKRA_GRANGER_CAUSALITY_RESET; + public static MethodHandle WICKRA_GRANGER_CAUSALITY_FREE; + public static MethodHandle WICKRA_HASBROUCK_INFORMATION_SHARE_NEW; + public static MethodHandle WICKRA_HASBROUCK_INFORMATION_SHARE_UPDATE; + public static MethodHandle WICKRA_HASBROUCK_INFORMATION_SHARE_BATCH; + public static MethodHandle WICKRA_HASBROUCK_INFORMATION_SHARE_RESET; + public static MethodHandle WICKRA_HASBROUCK_INFORMATION_SHARE_FREE; + public static MethodHandle WICKRA_INFORMATION_RATIO_NEW; + public static MethodHandle WICKRA_INFORMATION_RATIO_UPDATE; + public static MethodHandle WICKRA_INFORMATION_RATIO_BATCH; + public static MethodHandle WICKRA_INFORMATION_RATIO_RESET; + public static MethodHandle WICKRA_INFORMATION_RATIO_FREE; + public static MethodHandle WICKRA_KENDALL_TAU_NEW; + public static MethodHandle WICKRA_KENDALL_TAU_UPDATE; + public static MethodHandle WICKRA_KENDALL_TAU_BATCH; + public static MethodHandle WICKRA_KENDALL_TAU_RESET; + public static MethodHandle WICKRA_KENDALL_TAU_FREE; + public static MethodHandle WICKRA_OU_HALF_LIFE_NEW; + public static MethodHandle WICKRA_OU_HALF_LIFE_UPDATE; + public static MethodHandle WICKRA_OU_HALF_LIFE_BATCH; + public static MethodHandle WICKRA_OU_HALF_LIFE_RESET; + public static MethodHandle WICKRA_OU_HALF_LIFE_FREE; + public static MethodHandle WICKRA_PAIR_SPREAD_Z_SCORE_NEW; + public static MethodHandle WICKRA_PAIR_SPREAD_Z_SCORE_UPDATE; + public static MethodHandle WICKRA_PAIR_SPREAD_Z_SCORE_BATCH; + public static MethodHandle WICKRA_PAIR_SPREAD_Z_SCORE_RESET; + public static MethodHandle WICKRA_PAIR_SPREAD_Z_SCORE_FREE; + public static MethodHandle WICKRA_PAIRWISE_BETA_NEW; + public static MethodHandle WICKRA_PAIRWISE_BETA_UPDATE; + public static MethodHandle WICKRA_PAIRWISE_BETA_BATCH; + public static MethodHandle WICKRA_PAIRWISE_BETA_RESET; + public static MethodHandle WICKRA_PAIRWISE_BETA_FREE; + public static MethodHandle WICKRA_PEARSON_CORRELATION_NEW; + public static MethodHandle WICKRA_PEARSON_CORRELATION_UPDATE; + public static MethodHandle WICKRA_PEARSON_CORRELATION_BATCH; + public static MethodHandle WICKRA_PEARSON_CORRELATION_RESET; + public static MethodHandle WICKRA_PEARSON_CORRELATION_FREE; + public static MethodHandle WICKRA_ROLLING_CORRELATION_NEW; + public static MethodHandle WICKRA_ROLLING_CORRELATION_UPDATE; + public static MethodHandle WICKRA_ROLLING_CORRELATION_BATCH; + public static MethodHandle WICKRA_ROLLING_CORRELATION_RESET; + public static MethodHandle WICKRA_ROLLING_CORRELATION_FREE; + public static MethodHandle WICKRA_ROLLING_COVARIANCE_NEW; + public static MethodHandle WICKRA_ROLLING_COVARIANCE_UPDATE; + public static MethodHandle WICKRA_ROLLING_COVARIANCE_BATCH; + public static MethodHandle WICKRA_ROLLING_COVARIANCE_RESET; + public static MethodHandle WICKRA_ROLLING_COVARIANCE_FREE; + public static MethodHandle WICKRA_SPEARMAN_CORRELATION_NEW; + public static MethodHandle WICKRA_SPEARMAN_CORRELATION_UPDATE; + public static MethodHandle WICKRA_SPEARMAN_CORRELATION_BATCH; + public static MethodHandle WICKRA_SPEARMAN_CORRELATION_RESET; + public static MethodHandle WICKRA_SPEARMAN_CORRELATION_FREE; + public static MethodHandle WICKRA_SPREAD_AR1_COEFFICIENT_NEW; + public static MethodHandle WICKRA_SPREAD_AR1_COEFFICIENT_UPDATE; + public static MethodHandle WICKRA_SPREAD_AR1_COEFFICIENT_BATCH; + public static MethodHandle WICKRA_SPREAD_AR1_COEFFICIENT_RESET; + public static MethodHandle WICKRA_SPREAD_AR1_COEFFICIENT_FREE; + public static MethodHandle WICKRA_SPREAD_HURST_NEW; + public static MethodHandle WICKRA_SPREAD_HURST_UPDATE; + public static MethodHandle WICKRA_SPREAD_HURST_BATCH; + public static MethodHandle WICKRA_SPREAD_HURST_RESET; + public static MethodHandle WICKRA_SPREAD_HURST_FREE; + public static MethodHandle WICKRA_TREYNOR_RATIO_NEW; + public static MethodHandle WICKRA_TREYNOR_RATIO_UPDATE; + public static MethodHandle WICKRA_TREYNOR_RATIO_BATCH; + public static MethodHandle WICKRA_TREYNOR_RATIO_RESET; + public static MethodHandle WICKRA_TREYNOR_RATIO_FREE; + public static MethodHandle WICKRA_VARIANCE_RATIO_NEW; + public static MethodHandle WICKRA_VARIANCE_RATIO_UPDATE; + public static MethodHandle WICKRA_VARIANCE_RATIO_BATCH; + public static MethodHandle WICKRA_VARIANCE_RATIO_RESET; + public static MethodHandle WICKRA_VARIANCE_RATIO_FREE; + public static MethodHandle WICKRA_ABANDONED_BABY_NEW; + public static MethodHandle WICKRA_ABANDONED_BABY_UPDATE; + public static MethodHandle WICKRA_ABANDONED_BABY_BATCH; + public static MethodHandle WICKRA_ABANDONED_BABY_RESET; + public static MethodHandle WICKRA_ABANDONED_BABY_FREE; + public static MethodHandle WICKRA_ABCD_NEW; + public static MethodHandle WICKRA_ABCD_UPDATE; + public static MethodHandle WICKRA_ABCD_BATCH; + public static MethodHandle WICKRA_ABCD_RESET; + public static MethodHandle WICKRA_ABCD_FREE; + public static MethodHandle WICKRA_ACCELERATOR_OSCILLATOR_NEW; + public static MethodHandle WICKRA_ACCELERATOR_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_ACCELERATOR_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_ACCELERATOR_OSCILLATOR_RESET; + public static MethodHandle WICKRA_ACCELERATOR_OSCILLATOR_FREE; + public static MethodHandle WICKRA_AD_OSCILLATOR_NEW; + public static MethodHandle WICKRA_AD_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_AD_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_AD_OSCILLATOR_RESET; + public static MethodHandle WICKRA_AD_OSCILLATOR_FREE; + public static MethodHandle WICKRA_ADAPTIVE_CCI_NEW; + public static MethodHandle WICKRA_ADAPTIVE_CCI_UPDATE; + public static MethodHandle WICKRA_ADAPTIVE_CCI_BATCH; + public static MethodHandle WICKRA_ADAPTIVE_CCI_RESET; + public static MethodHandle WICKRA_ADAPTIVE_CCI_FREE; + public static MethodHandle WICKRA_ADL_NEW; + public static MethodHandle WICKRA_ADL_UPDATE; + public static MethodHandle WICKRA_ADL_BATCH; + public static MethodHandle WICKRA_ADL_RESET; + public static MethodHandle WICKRA_ADL_FREE; + public static MethodHandle WICKRA_ADVANCE_BLOCK_NEW; + public static MethodHandle WICKRA_ADVANCE_BLOCK_UPDATE; + public static MethodHandle WICKRA_ADVANCE_BLOCK_BATCH; + public static MethodHandle WICKRA_ADVANCE_BLOCK_RESET; + public static MethodHandle WICKRA_ADVANCE_BLOCK_FREE; + public static MethodHandle WICKRA_ADXR_NEW; + public static MethodHandle WICKRA_ADXR_UPDATE; + public static MethodHandle WICKRA_ADXR_BATCH; + public static MethodHandle WICKRA_ADXR_RESET; + public static MethodHandle WICKRA_ADXR_FREE; + public static MethodHandle WICKRA_ANCHORED_VWAP_NEW; + public static MethodHandle WICKRA_ANCHORED_VWAP_UPDATE; + public static MethodHandle WICKRA_ANCHORED_VWAP_BATCH; + public static MethodHandle WICKRA_ANCHORED_VWAP_RESET; + public static MethodHandle WICKRA_ANCHORED_VWAP_FREE; + public static MethodHandle WICKRA_AROON_OSCILLATOR_NEW; + public static MethodHandle WICKRA_AROON_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_AROON_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_AROON_OSCILLATOR_RESET; + public static MethodHandle WICKRA_AROON_OSCILLATOR_FREE; + public static MethodHandle WICKRA_ATR_NEW; + public static MethodHandle WICKRA_ATR_UPDATE; + public static MethodHandle WICKRA_ATR_BATCH; + public static MethodHandle WICKRA_ATR_RESET; + public static MethodHandle WICKRA_ATR_FREE; + public static MethodHandle WICKRA_ATR_TRAILING_STOP_NEW; + public static MethodHandle WICKRA_ATR_TRAILING_STOP_UPDATE; + public static MethodHandle WICKRA_ATR_TRAILING_STOP_BATCH; + public static MethodHandle WICKRA_ATR_TRAILING_STOP_RESET; + public static MethodHandle WICKRA_ATR_TRAILING_STOP_FREE; + public static MethodHandle WICKRA_AVERAGE_DAILY_RANGE_NEW; + public static MethodHandle WICKRA_AVERAGE_DAILY_RANGE_UPDATE; + public static MethodHandle WICKRA_AVERAGE_DAILY_RANGE_BATCH; + public static MethodHandle WICKRA_AVERAGE_DAILY_RANGE_RESET; + public static MethodHandle WICKRA_AVERAGE_DAILY_RANGE_FREE; + public static MethodHandle WICKRA_AVG_PRICE_NEW; + public static MethodHandle WICKRA_AVG_PRICE_UPDATE; + public static MethodHandle WICKRA_AVG_PRICE_BATCH; + public static MethodHandle WICKRA_AVG_PRICE_RESET; + public static MethodHandle WICKRA_AVG_PRICE_FREE; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_NEW; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_RESET; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_FREE; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_NEW; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_UPDATE; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_BATCH; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_RESET; + public static MethodHandle WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_FREE; + public static MethodHandle WICKRA_BALANCE_OF_POWER_NEW; + public static MethodHandle WICKRA_BALANCE_OF_POWER_UPDATE; + public static MethodHandle WICKRA_BALANCE_OF_POWER_BATCH; + public static MethodHandle WICKRA_BALANCE_OF_POWER_RESET; + public static MethodHandle WICKRA_BALANCE_OF_POWER_FREE; + public static MethodHandle WICKRA_BAT_NEW; + public static MethodHandle WICKRA_BAT_UPDATE; + public static MethodHandle WICKRA_BAT_BATCH; + public static MethodHandle WICKRA_BAT_RESET; + public static MethodHandle WICKRA_BAT_FREE; + public static MethodHandle WICKRA_BELT_HOLD_NEW; + public static MethodHandle WICKRA_BELT_HOLD_UPDATE; + public static MethodHandle WICKRA_BELT_HOLD_BATCH; + public static MethodHandle WICKRA_BELT_HOLD_RESET; + public static MethodHandle WICKRA_BELT_HOLD_FREE; + public static MethodHandle WICKRA_BETTER_VOLUME_NEW; + public static MethodHandle WICKRA_BETTER_VOLUME_UPDATE; + public static MethodHandle WICKRA_BETTER_VOLUME_BATCH; + public static MethodHandle WICKRA_BETTER_VOLUME_RESET; + public static MethodHandle WICKRA_BETTER_VOLUME_FREE; + public static MethodHandle WICKRA_BODY_SIZE_PCT_NEW; + public static MethodHandle WICKRA_BODY_SIZE_PCT_UPDATE; + public static MethodHandle WICKRA_BODY_SIZE_PCT_BATCH; + public static MethodHandle WICKRA_BODY_SIZE_PCT_RESET; + public static MethodHandle WICKRA_BODY_SIZE_PCT_FREE; + public static MethodHandle WICKRA_BREAKAWAY_NEW; + public static MethodHandle WICKRA_BREAKAWAY_UPDATE; + public static MethodHandle WICKRA_BREAKAWAY_BATCH; + public static MethodHandle WICKRA_BREAKAWAY_RESET; + public static MethodHandle WICKRA_BREAKAWAY_FREE; + public static MethodHandle WICKRA_BUTTERFLY_NEW; + public static MethodHandle WICKRA_BUTTERFLY_UPDATE; + public static MethodHandle WICKRA_BUTTERFLY_BATCH; + public static MethodHandle WICKRA_BUTTERFLY_RESET; + public static MethodHandle WICKRA_BUTTERFLY_FREE; + public static MethodHandle WICKRA_CCI_NEW; + public static MethodHandle WICKRA_CCI_UPDATE; + public static MethodHandle WICKRA_CCI_BATCH; + public static MethodHandle WICKRA_CCI_RESET; + public static MethodHandle WICKRA_CCI_FREE; + public static MethodHandle WICKRA_CHAIKIN_OSCILLATOR_NEW; + public static MethodHandle WICKRA_CHAIKIN_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_CHAIKIN_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_CHAIKIN_OSCILLATOR_RESET; + public static MethodHandle WICKRA_CHAIKIN_OSCILLATOR_FREE; + public static MethodHandle WICKRA_CHAIKIN_VOLATILITY_NEW; + public static MethodHandle WICKRA_CHAIKIN_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_CHAIKIN_VOLATILITY_BATCH; + public static MethodHandle WICKRA_CHAIKIN_VOLATILITY_RESET; + public static MethodHandle WICKRA_CHAIKIN_VOLATILITY_FREE; + public static MethodHandle WICKRA_CHOPPINESS_INDEX_NEW; + public static MethodHandle WICKRA_CHOPPINESS_INDEX_UPDATE; + public static MethodHandle WICKRA_CHOPPINESS_INDEX_BATCH; + public static MethodHandle WICKRA_CHOPPINESS_INDEX_RESET; + public static MethodHandle WICKRA_CHOPPINESS_INDEX_FREE; + public static MethodHandle WICKRA_CLOSE_VS_OPEN_NEW; + public static MethodHandle WICKRA_CLOSE_VS_OPEN_UPDATE; + public static MethodHandle WICKRA_CLOSE_VS_OPEN_BATCH; + public static MethodHandle WICKRA_CLOSE_VS_OPEN_RESET; + public static MethodHandle WICKRA_CLOSE_VS_OPEN_FREE; + public static MethodHandle WICKRA_CLOSING_MARUBOZU_NEW; + public static MethodHandle WICKRA_CLOSING_MARUBOZU_UPDATE; + public static MethodHandle WICKRA_CLOSING_MARUBOZU_BATCH; + public static MethodHandle WICKRA_CLOSING_MARUBOZU_RESET; + public static MethodHandle WICKRA_CLOSING_MARUBOZU_FREE; + public static MethodHandle WICKRA_CHAIKIN_MONEY_FLOW_NEW; + public static MethodHandle WICKRA_CHAIKIN_MONEY_FLOW_UPDATE; + public static MethodHandle WICKRA_CHAIKIN_MONEY_FLOW_BATCH; + public static MethodHandle WICKRA_CHAIKIN_MONEY_FLOW_RESET; + public static MethodHandle WICKRA_CHAIKIN_MONEY_FLOW_FREE; + public static MethodHandle WICKRA_CONCEALING_BABY_SWALLOW_NEW; + public static MethodHandle WICKRA_CONCEALING_BABY_SWALLOW_UPDATE; + public static MethodHandle WICKRA_CONCEALING_BABY_SWALLOW_BATCH; + public static MethodHandle WICKRA_CONCEALING_BABY_SWALLOW_RESET; + public static MethodHandle WICKRA_CONCEALING_BABY_SWALLOW_FREE; + public static MethodHandle WICKRA_COUNTERATTACK_NEW; + public static MethodHandle WICKRA_COUNTERATTACK_UPDATE; + public static MethodHandle WICKRA_COUNTERATTACK_BATCH; + public static MethodHandle WICKRA_COUNTERATTACK_RESET; + public static MethodHandle WICKRA_COUNTERATTACK_FREE; + public static MethodHandle WICKRA_CRAB_NEW; + public static MethodHandle WICKRA_CRAB_UPDATE; + public static MethodHandle WICKRA_CRAB_BATCH; + public static MethodHandle WICKRA_CRAB_RESET; + public static MethodHandle WICKRA_CRAB_FREE; + public static MethodHandle WICKRA_CUP_AND_HANDLE_NEW; + public static MethodHandle WICKRA_CUP_AND_HANDLE_UPDATE; + public static MethodHandle WICKRA_CUP_AND_HANDLE_BATCH; + public static MethodHandle WICKRA_CUP_AND_HANDLE_RESET; + public static MethodHandle WICKRA_CUP_AND_HANDLE_FREE; + public static MethodHandle WICKRA_CYPHER_NEW; + public static MethodHandle WICKRA_CYPHER_UPDATE; + public static MethodHandle WICKRA_CYPHER_BATCH; + public static MethodHandle WICKRA_CYPHER_RESET; + public static MethodHandle WICKRA_CYPHER_FREE; + public static MethodHandle WICKRA_DEMAND_INDEX_NEW; + public static MethodHandle WICKRA_DEMAND_INDEX_UPDATE; + public static MethodHandle WICKRA_DEMAND_INDEX_BATCH; + public static MethodHandle WICKRA_DEMAND_INDEX_RESET; + public static MethodHandle WICKRA_DEMAND_INDEX_FREE; + public static MethodHandle WICKRA_DOJI_NEW; + public static MethodHandle WICKRA_DOJI_UPDATE; + public static MethodHandle WICKRA_DOJI_BATCH; + public static MethodHandle WICKRA_DOJI_RESET; + public static MethodHandle WICKRA_DOJI_FREE; + public static MethodHandle WICKRA_DOJI_STAR_NEW; + public static MethodHandle WICKRA_DOJI_STAR_UPDATE; + public static MethodHandle WICKRA_DOJI_STAR_BATCH; + public static MethodHandle WICKRA_DOJI_STAR_RESET; + public static MethodHandle WICKRA_DOJI_STAR_FREE; + public static MethodHandle WICKRA_DOUBLE_TOP_BOTTOM_NEW; + public static MethodHandle WICKRA_DOUBLE_TOP_BOTTOM_UPDATE; + public static MethodHandle WICKRA_DOUBLE_TOP_BOTTOM_BATCH; + public static MethodHandle WICKRA_DOUBLE_TOP_BOTTOM_RESET; + public static MethodHandle WICKRA_DOUBLE_TOP_BOTTOM_FREE; + public static MethodHandle WICKRA_DOWNSIDE_GAP_THREE_METHODS_NEW; + public static MethodHandle WICKRA_DOWNSIDE_GAP_THREE_METHODS_UPDATE; + public static MethodHandle WICKRA_DOWNSIDE_GAP_THREE_METHODS_BATCH; + public static MethodHandle WICKRA_DOWNSIDE_GAP_THREE_METHODS_RESET; + public static MethodHandle WICKRA_DOWNSIDE_GAP_THREE_METHODS_FREE; + public static MethodHandle WICKRA_DRAGONFLY_DOJI_NEW; + public static MethodHandle WICKRA_DRAGONFLY_DOJI_UPDATE; + public static MethodHandle WICKRA_DRAGONFLY_DOJI_BATCH; + public static MethodHandle WICKRA_DRAGONFLY_DOJI_RESET; + public static MethodHandle WICKRA_DRAGONFLY_DOJI_FREE; + public static MethodHandle WICKRA_DUMPLING_TOP_NEW; + public static MethodHandle WICKRA_DUMPLING_TOP_UPDATE; + public static MethodHandle WICKRA_DUMPLING_TOP_BATCH; + public static MethodHandle WICKRA_DUMPLING_TOP_RESET; + public static MethodHandle WICKRA_DUMPLING_TOP_FREE; + public static MethodHandle WICKRA_DX_NEW; + public static MethodHandle WICKRA_DX_UPDATE; + public static MethodHandle WICKRA_DX_BATCH; + public static MethodHandle WICKRA_DX_RESET; + public static MethodHandle WICKRA_DX_FREE; + public static MethodHandle WICKRA_EASE_OF_MOVEMENT_NEW; + public static MethodHandle WICKRA_EASE_OF_MOVEMENT_UPDATE; + public static MethodHandle WICKRA_EASE_OF_MOVEMENT_BATCH; + public static MethodHandle WICKRA_EASE_OF_MOVEMENT_RESET; + public static MethodHandle WICKRA_EASE_OF_MOVEMENT_FREE; + public static MethodHandle WICKRA_ENGULFING_NEW; + public static MethodHandle WICKRA_ENGULFING_UPDATE; + public static MethodHandle WICKRA_ENGULFING_BATCH; + public static MethodHandle WICKRA_ENGULFING_RESET; + public static MethodHandle WICKRA_ENGULFING_FREE; + public static MethodHandle WICKRA_EVENING_DOJI_STAR_NEW; + public static MethodHandle WICKRA_EVENING_DOJI_STAR_UPDATE; + public static MethodHandle WICKRA_EVENING_DOJI_STAR_BATCH; + public static MethodHandle WICKRA_EVENING_DOJI_STAR_RESET; + public static MethodHandle WICKRA_EVENING_DOJI_STAR_FREE; + public static MethodHandle WICKRA_EVWMA_NEW; + public static MethodHandle WICKRA_EVWMA_UPDATE; + public static MethodHandle WICKRA_EVWMA_BATCH; + public static MethodHandle WICKRA_EVWMA_RESET; + public static MethodHandle WICKRA_EVWMA_FREE; + public static MethodHandle WICKRA_FALLING_THREE_METHODS_NEW; + public static MethodHandle WICKRA_FALLING_THREE_METHODS_UPDATE; + public static MethodHandle WICKRA_FALLING_THREE_METHODS_BATCH; + public static MethodHandle WICKRA_FALLING_THREE_METHODS_RESET; + public static MethodHandle WICKRA_FALLING_THREE_METHODS_FREE; + public static MethodHandle WICKRA_FLAG_PENNANT_NEW; + public static MethodHandle WICKRA_FLAG_PENNANT_UPDATE; + public static MethodHandle WICKRA_FLAG_PENNANT_BATCH; + public static MethodHandle WICKRA_FLAG_PENNANT_RESET; + public static MethodHandle WICKRA_FLAG_PENNANT_FREE; + public static MethodHandle WICKRA_FORCE_INDEX_NEW; + public static MethodHandle WICKRA_FORCE_INDEX_UPDATE; + public static MethodHandle WICKRA_FORCE_INDEX_BATCH; + public static MethodHandle WICKRA_FORCE_INDEX_RESET; + public static MethodHandle WICKRA_FORCE_INDEX_FREE; + public static MethodHandle WICKRA_FRY_PAN_BOTTOM_NEW; + public static MethodHandle WICKRA_FRY_PAN_BOTTOM_UPDATE; + public static MethodHandle WICKRA_FRY_PAN_BOTTOM_BATCH; + public static MethodHandle WICKRA_FRY_PAN_BOTTOM_RESET; + public static MethodHandle WICKRA_FRY_PAN_BOTTOM_FREE; + public static MethodHandle WICKRA_GAP_SIDE_BY_SIDE_WHITE_NEW; + public static MethodHandle WICKRA_GAP_SIDE_BY_SIDE_WHITE_UPDATE; + public static MethodHandle WICKRA_GAP_SIDE_BY_SIDE_WHITE_BATCH; + public static MethodHandle WICKRA_GAP_SIDE_BY_SIDE_WHITE_RESET; + public static MethodHandle WICKRA_GAP_SIDE_BY_SIDE_WHITE_FREE; + public static MethodHandle WICKRA_GARMAN_KLASS_VOLATILITY_NEW; + public static MethodHandle WICKRA_GARMAN_KLASS_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_GARMAN_KLASS_VOLATILITY_BATCH; + public static MethodHandle WICKRA_GARMAN_KLASS_VOLATILITY_RESET; + public static MethodHandle WICKRA_GARMAN_KLASS_VOLATILITY_FREE; + public static MethodHandle WICKRA_GARTLEY_NEW; + public static MethodHandle WICKRA_GARTLEY_UPDATE; + public static MethodHandle WICKRA_GARTLEY_BATCH; + public static MethodHandle WICKRA_GARTLEY_RESET; + public static MethodHandle WICKRA_GARTLEY_FREE; + public static MethodHandle WICKRA_GRAVESTONE_DOJI_NEW; + public static MethodHandle WICKRA_GRAVESTONE_DOJI_UPDATE; + public static MethodHandle WICKRA_GRAVESTONE_DOJI_BATCH; + public static MethodHandle WICKRA_GRAVESTONE_DOJI_RESET; + public static MethodHandle WICKRA_GRAVESTONE_DOJI_FREE; + public static MethodHandle WICKRA_HAMMER_NEW; + public static MethodHandle WICKRA_HAMMER_UPDATE; + public static MethodHandle WICKRA_HAMMER_BATCH; + public static MethodHandle WICKRA_HAMMER_RESET; + public static MethodHandle WICKRA_HAMMER_FREE; + public static MethodHandle WICKRA_HANGING_MAN_NEW; + public static MethodHandle WICKRA_HANGING_MAN_UPDATE; + public static MethodHandle WICKRA_HANGING_MAN_BATCH; + public static MethodHandle WICKRA_HANGING_MAN_RESET; + public static MethodHandle WICKRA_HANGING_MAN_FREE; + public static MethodHandle WICKRA_HARAMI_NEW; + public static MethodHandle WICKRA_HARAMI_UPDATE; + public static MethodHandle WICKRA_HARAMI_BATCH; + public static MethodHandle WICKRA_HARAMI_RESET; + public static MethodHandle WICKRA_HARAMI_FREE; + public static MethodHandle WICKRA_HARAMI_CROSS_NEW; + public static MethodHandle WICKRA_HARAMI_CROSS_UPDATE; + public static MethodHandle WICKRA_HARAMI_CROSS_BATCH; + public static MethodHandle WICKRA_HARAMI_CROSS_RESET; + public static MethodHandle WICKRA_HARAMI_CROSS_FREE; + public static MethodHandle WICKRA_HEAD_AND_SHOULDERS_NEW; + public static MethodHandle WICKRA_HEAD_AND_SHOULDERS_UPDATE; + public static MethodHandle WICKRA_HEAD_AND_SHOULDERS_BATCH; + public static MethodHandle WICKRA_HEAD_AND_SHOULDERS_RESET; + public static MethodHandle WICKRA_HEAD_AND_SHOULDERS_FREE; + public static MethodHandle WICKRA_HEIKIN_ASHI_OSCILLATOR_NEW; + public static MethodHandle WICKRA_HEIKIN_ASHI_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_HEIKIN_ASHI_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_HEIKIN_ASHI_OSCILLATOR_RESET; + public static MethodHandle WICKRA_HEIKIN_ASHI_OSCILLATOR_FREE; + public static MethodHandle WICKRA_HIGH_LOW_RANGE_NEW; + public static MethodHandle WICKRA_HIGH_LOW_RANGE_UPDATE; + public static MethodHandle WICKRA_HIGH_LOW_RANGE_BATCH; + public static MethodHandle WICKRA_HIGH_LOW_RANGE_RESET; + public static MethodHandle WICKRA_HIGH_LOW_RANGE_FREE; + public static MethodHandle WICKRA_HIGH_WAVE_NEW; + public static MethodHandle WICKRA_HIGH_WAVE_UPDATE; + public static MethodHandle WICKRA_HIGH_WAVE_BATCH; + public static MethodHandle WICKRA_HIGH_WAVE_RESET; + public static MethodHandle WICKRA_HIGH_WAVE_FREE; + public static MethodHandle WICKRA_HIKKAKE_NEW; + public static MethodHandle WICKRA_HIKKAKE_UPDATE; + public static MethodHandle WICKRA_HIKKAKE_BATCH; + public static MethodHandle WICKRA_HIKKAKE_RESET; + public static MethodHandle WICKRA_HIKKAKE_FREE; + public static MethodHandle WICKRA_HIKKAKE_MODIFIED_NEW; + public static MethodHandle WICKRA_HIKKAKE_MODIFIED_UPDATE; + public static MethodHandle WICKRA_HIKKAKE_MODIFIED_BATCH; + public static MethodHandle WICKRA_HIKKAKE_MODIFIED_RESET; + public static MethodHandle WICKRA_HIKKAKE_MODIFIED_FREE; + public static MethodHandle WICKRA_HI_LO_ACTIVATOR_NEW; + public static MethodHandle WICKRA_HI_LO_ACTIVATOR_UPDATE; + public static MethodHandle WICKRA_HI_LO_ACTIVATOR_BATCH; + public static MethodHandle WICKRA_HI_LO_ACTIVATOR_RESET; + public static MethodHandle WICKRA_HI_LO_ACTIVATOR_FREE; + public static MethodHandle WICKRA_HOMING_PIGEON_NEW; + public static MethodHandle WICKRA_HOMING_PIGEON_UPDATE; + public static MethodHandle WICKRA_HOMING_PIGEON_BATCH; + public static MethodHandle WICKRA_HOMING_PIGEON_RESET; + public static MethodHandle WICKRA_HOMING_PIGEON_FREE; + public static MethodHandle WICKRA_IDENTICAL_THREE_CROWS_NEW; + public static MethodHandle WICKRA_IDENTICAL_THREE_CROWS_UPDATE; + public static MethodHandle WICKRA_IDENTICAL_THREE_CROWS_BATCH; + public static MethodHandle WICKRA_IDENTICAL_THREE_CROWS_RESET; + public static MethodHandle WICKRA_IDENTICAL_THREE_CROWS_FREE; + public static MethodHandle WICKRA_IN_NECK_NEW; + public static MethodHandle WICKRA_IN_NECK_UPDATE; + public static MethodHandle WICKRA_IN_NECK_BATCH; + public static MethodHandle WICKRA_IN_NECK_RESET; + public static MethodHandle WICKRA_IN_NECK_FREE; + public static MethodHandle WICKRA_INERTIA_NEW; + public static MethodHandle WICKRA_INERTIA_UPDATE; + public static MethodHandle WICKRA_INERTIA_BATCH; + public static MethodHandle WICKRA_INERTIA_RESET; + public static MethodHandle WICKRA_INERTIA_FREE; + public static MethodHandle WICKRA_INTRADAY_INTENSITY_NEW; + public static MethodHandle WICKRA_INTRADAY_INTENSITY_UPDATE; + public static MethodHandle WICKRA_INTRADAY_INTENSITY_BATCH; + public static MethodHandle WICKRA_INTRADAY_INTENSITY_RESET; + public static MethodHandle WICKRA_INTRADAY_INTENSITY_FREE; + public static MethodHandle WICKRA_INTRADAY_MOMENTUM_INDEX_NEW; + public static MethodHandle WICKRA_INTRADAY_MOMENTUM_INDEX_UPDATE; + public static MethodHandle WICKRA_INTRADAY_MOMENTUM_INDEX_BATCH; + public static MethodHandle WICKRA_INTRADAY_MOMENTUM_INDEX_RESET; + public static MethodHandle WICKRA_INTRADAY_MOMENTUM_INDEX_FREE; + public static MethodHandle WICKRA_INVERTED_HAMMER_NEW; + public static MethodHandle WICKRA_INVERTED_HAMMER_UPDATE; + public static MethodHandle WICKRA_INVERTED_HAMMER_BATCH; + public static MethodHandle WICKRA_INVERTED_HAMMER_RESET; + public static MethodHandle WICKRA_INVERTED_HAMMER_FREE; + public static MethodHandle WICKRA_KICKING_NEW; + public static MethodHandle WICKRA_KICKING_UPDATE; + public static MethodHandle WICKRA_KICKING_BATCH; + public static MethodHandle WICKRA_KICKING_RESET; + public static MethodHandle WICKRA_KICKING_FREE; + public static MethodHandle WICKRA_KICKING_BY_LENGTH_NEW; + public static MethodHandle WICKRA_KICKING_BY_LENGTH_UPDATE; + public static MethodHandle WICKRA_KICKING_BY_LENGTH_BATCH; + public static MethodHandle WICKRA_KICKING_BY_LENGTH_RESET; + public static MethodHandle WICKRA_KICKING_BY_LENGTH_FREE; + public static MethodHandle WICKRA_KVO_NEW; + public static MethodHandle WICKRA_KVO_UPDATE; + public static MethodHandle WICKRA_KVO_BATCH; + public static MethodHandle WICKRA_KVO_RESET; + public static MethodHandle WICKRA_KVO_FREE; + public static MethodHandle WICKRA_LADDER_BOTTOM_NEW; + public static MethodHandle WICKRA_LADDER_BOTTOM_UPDATE; + public static MethodHandle WICKRA_LADDER_BOTTOM_BATCH; + public static MethodHandle WICKRA_LADDER_BOTTOM_RESET; + public static MethodHandle WICKRA_LADDER_BOTTOM_FREE; + public static MethodHandle WICKRA_LONG_LEGGED_DOJI_NEW; + public static MethodHandle WICKRA_LONG_LEGGED_DOJI_UPDATE; + public static MethodHandle WICKRA_LONG_LEGGED_DOJI_BATCH; + public static MethodHandle WICKRA_LONG_LEGGED_DOJI_RESET; + public static MethodHandle WICKRA_LONG_LEGGED_DOJI_FREE; + public static MethodHandle WICKRA_LONG_LINE_NEW; + public static MethodHandle WICKRA_LONG_LINE_UPDATE; + public static MethodHandle WICKRA_LONG_LINE_BATCH; + public static MethodHandle WICKRA_LONG_LINE_RESET; + public static MethodHandle WICKRA_LONG_LINE_FREE; + public static MethodHandle WICKRA_MARKET_FACILITATION_INDEX_NEW; + public static MethodHandle WICKRA_MARKET_FACILITATION_INDEX_UPDATE; + public static MethodHandle WICKRA_MARKET_FACILITATION_INDEX_BATCH; + public static MethodHandle WICKRA_MARKET_FACILITATION_INDEX_RESET; + public static MethodHandle WICKRA_MARKET_FACILITATION_INDEX_FREE; + public static MethodHandle WICKRA_MARUBOZU_NEW; + public static MethodHandle WICKRA_MARUBOZU_UPDATE; + public static MethodHandle WICKRA_MARUBOZU_BATCH; + public static MethodHandle WICKRA_MARUBOZU_RESET; + public static MethodHandle WICKRA_MARUBOZU_FREE; + public static MethodHandle WICKRA_MASS_INDEX_NEW; + public static MethodHandle WICKRA_MASS_INDEX_UPDATE; + public static MethodHandle WICKRA_MASS_INDEX_BATCH; + public static MethodHandle WICKRA_MASS_INDEX_RESET; + public static MethodHandle WICKRA_MASS_INDEX_FREE; + public static MethodHandle WICKRA_MAT_HOLD_NEW; + public static MethodHandle WICKRA_MAT_HOLD_UPDATE; + public static MethodHandle WICKRA_MAT_HOLD_BATCH; + public static MethodHandle WICKRA_MAT_HOLD_RESET; + public static MethodHandle WICKRA_MAT_HOLD_FREE; + public static MethodHandle WICKRA_MATCHING_LOW_NEW; + public static MethodHandle WICKRA_MATCHING_LOW_UPDATE; + public static MethodHandle WICKRA_MATCHING_LOW_BATCH; + public static MethodHandle WICKRA_MATCHING_LOW_RESET; + public static MethodHandle WICKRA_MATCHING_LOW_FREE; + public static MethodHandle WICKRA_MEDIAN_PRICE_NEW; + public static MethodHandle WICKRA_MEDIAN_PRICE_UPDATE; + public static MethodHandle WICKRA_MEDIAN_PRICE_BATCH; + public static MethodHandle WICKRA_MEDIAN_PRICE_RESET; + public static MethodHandle WICKRA_MEDIAN_PRICE_FREE; + public static MethodHandle WICKRA_MFI_NEW; + public static MethodHandle WICKRA_MFI_UPDATE; + public static MethodHandle WICKRA_MFI_BATCH; + public static MethodHandle WICKRA_MFI_RESET; + public static MethodHandle WICKRA_MFI_FREE; + public static MethodHandle WICKRA_MID_PRICE_NEW; + public static MethodHandle WICKRA_MID_PRICE_UPDATE; + public static MethodHandle WICKRA_MID_PRICE_BATCH; + public static MethodHandle WICKRA_MID_PRICE_RESET; + public static MethodHandle WICKRA_MID_PRICE_FREE; + public static MethodHandle WICKRA_MINUS_DI_NEW; + public static MethodHandle WICKRA_MINUS_DI_UPDATE; + public static MethodHandle WICKRA_MINUS_DI_BATCH; + public static MethodHandle WICKRA_MINUS_DI_RESET; + public static MethodHandle WICKRA_MINUS_DI_FREE; + public static MethodHandle WICKRA_MINUS_DM_NEW; + public static MethodHandle WICKRA_MINUS_DM_UPDATE; + public static MethodHandle WICKRA_MINUS_DM_BATCH; + public static MethodHandle WICKRA_MINUS_DM_RESET; + public static MethodHandle WICKRA_MINUS_DM_FREE; + public static MethodHandle WICKRA_MORNING_DOJI_STAR_NEW; + public static MethodHandle WICKRA_MORNING_DOJI_STAR_UPDATE; + public static MethodHandle WICKRA_MORNING_DOJI_STAR_BATCH; + public static MethodHandle WICKRA_MORNING_DOJI_STAR_RESET; + public static MethodHandle WICKRA_MORNING_DOJI_STAR_FREE; + public static MethodHandle WICKRA_MORNING_EVENING_STAR_NEW; + public static MethodHandle WICKRA_MORNING_EVENING_STAR_UPDATE; + public static MethodHandle WICKRA_MORNING_EVENING_STAR_BATCH; + public static MethodHandle WICKRA_MORNING_EVENING_STAR_RESET; + public static MethodHandle WICKRA_MORNING_EVENING_STAR_FREE; + public static MethodHandle WICKRA_NAKED_POC_NEW; + public static MethodHandle WICKRA_NAKED_POC_UPDATE; + public static MethodHandle WICKRA_NAKED_POC_BATCH; + public static MethodHandle WICKRA_NAKED_POC_RESET; + public static MethodHandle WICKRA_NAKED_POC_FREE; + public static MethodHandle WICKRA_NATR_NEW; + public static MethodHandle WICKRA_NATR_UPDATE; + public static MethodHandle WICKRA_NATR_BATCH; + public static MethodHandle WICKRA_NATR_RESET; + public static MethodHandle WICKRA_NATR_FREE; + public static MethodHandle WICKRA_NEW_PRICE_LINES_NEW; + public static MethodHandle WICKRA_NEW_PRICE_LINES_UPDATE; + public static MethodHandle WICKRA_NEW_PRICE_LINES_BATCH; + public static MethodHandle WICKRA_NEW_PRICE_LINES_RESET; + public static MethodHandle WICKRA_NEW_PRICE_LINES_FREE; + public static MethodHandle WICKRA_NVI_NEW; + public static MethodHandle WICKRA_NVI_UPDATE; + public static MethodHandle WICKRA_NVI_BATCH; + public static MethodHandle WICKRA_NVI_RESET; + public static MethodHandle WICKRA_NVI_FREE; + public static MethodHandle WICKRA_OBV_NEW; + public static MethodHandle WICKRA_OBV_UPDATE; + public static MethodHandle WICKRA_OBV_BATCH; + public static MethodHandle WICKRA_OBV_RESET; + public static MethodHandle WICKRA_OBV_FREE; + public static MethodHandle WICKRA_ON_NECK_NEW; + public static MethodHandle WICKRA_ON_NECK_UPDATE; + public static MethodHandle WICKRA_ON_NECK_BATCH; + public static MethodHandle WICKRA_ON_NECK_RESET; + public static MethodHandle WICKRA_ON_NECK_FREE; + public static MethodHandle WICKRA_OPENING_MARUBOZU_NEW; + public static MethodHandle WICKRA_OPENING_MARUBOZU_UPDATE; + public static MethodHandle WICKRA_OPENING_MARUBOZU_BATCH; + public static MethodHandle WICKRA_OPENING_MARUBOZU_RESET; + public static MethodHandle WICKRA_OPENING_MARUBOZU_FREE; + public static MethodHandle WICKRA_OVERNIGHT_GAP_NEW; + public static MethodHandle WICKRA_OVERNIGHT_GAP_UPDATE; + public static MethodHandle WICKRA_OVERNIGHT_GAP_BATCH; + public static MethodHandle WICKRA_OVERNIGHT_GAP_RESET; + public static MethodHandle WICKRA_OVERNIGHT_GAP_FREE; + public static MethodHandle WICKRA_PARKINSON_VOLATILITY_NEW; + public static MethodHandle WICKRA_PARKINSON_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_PARKINSON_VOLATILITY_BATCH; + public static MethodHandle WICKRA_PARKINSON_VOLATILITY_RESET; + public static MethodHandle WICKRA_PARKINSON_VOLATILITY_FREE; + public static MethodHandle WICKRA_PGO_NEW; + public static MethodHandle WICKRA_PGO_UPDATE; + public static MethodHandle WICKRA_PGO_BATCH; + public static MethodHandle WICKRA_PGO_RESET; + public static MethodHandle WICKRA_PGO_FREE; + public static MethodHandle WICKRA_PIERCING_DARK_CLOUD_NEW; + public static MethodHandle WICKRA_PIERCING_DARK_CLOUD_UPDATE; + public static MethodHandle WICKRA_PIERCING_DARK_CLOUD_BATCH; + public static MethodHandle WICKRA_PIERCING_DARK_CLOUD_RESET; + public static MethodHandle WICKRA_PIERCING_DARK_CLOUD_FREE; + public static MethodHandle WICKRA_PIVOT_REVERSAL_NEW; + public static MethodHandle WICKRA_PIVOT_REVERSAL_UPDATE; + public static MethodHandle WICKRA_PIVOT_REVERSAL_BATCH; + public static MethodHandle WICKRA_PIVOT_REVERSAL_RESET; + public static MethodHandle WICKRA_PIVOT_REVERSAL_FREE; + public static MethodHandle WICKRA_PLUS_DI_NEW; + public static MethodHandle WICKRA_PLUS_DI_UPDATE; + public static MethodHandle WICKRA_PLUS_DI_BATCH; + public static MethodHandle WICKRA_PLUS_DI_RESET; + public static MethodHandle WICKRA_PLUS_DI_FREE; + public static MethodHandle WICKRA_PLUS_DM_NEW; + public static MethodHandle WICKRA_PLUS_DM_UPDATE; + public static MethodHandle WICKRA_PLUS_DM_BATCH; + public static MethodHandle WICKRA_PLUS_DM_RESET; + public static MethodHandle WICKRA_PLUS_DM_FREE; + public static MethodHandle WICKRA_PROFILE_SHAPE_NEW; + public static MethodHandle WICKRA_PROFILE_SHAPE_UPDATE; + public static MethodHandle WICKRA_PROFILE_SHAPE_BATCH; + public static MethodHandle WICKRA_PROFILE_SHAPE_RESET; + public static MethodHandle WICKRA_PROFILE_SHAPE_FREE; + public static MethodHandle WICKRA_PROJECTION_OSCILLATOR_NEW; + public static MethodHandle WICKRA_PROJECTION_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_PROJECTION_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_PROJECTION_OSCILLATOR_RESET; + public static MethodHandle WICKRA_PROJECTION_OSCILLATOR_FREE; + public static MethodHandle WICKRA_PSAR_NEW; + public static MethodHandle WICKRA_PSAR_UPDATE; + public static MethodHandle WICKRA_PSAR_BATCH; + public static MethodHandle WICKRA_PSAR_RESET; + public static MethodHandle WICKRA_PSAR_FREE; + public static MethodHandle WICKRA_PVI_NEW; + public static MethodHandle WICKRA_PVI_UPDATE; + public static MethodHandle WICKRA_PVI_BATCH; + public static MethodHandle WICKRA_PVI_RESET; + public static MethodHandle WICKRA_PVI_FREE; + public static MethodHandle WICKRA_QSTICK_NEW; + public static MethodHandle WICKRA_QSTICK_UPDATE; + public static MethodHandle WICKRA_QSTICK_BATCH; + public static MethodHandle WICKRA_QSTICK_RESET; + public static MethodHandle WICKRA_QSTICK_FREE; + public static MethodHandle WICKRA_RECTANGLE_RANGE_NEW; + public static MethodHandle WICKRA_RECTANGLE_RANGE_UPDATE; + public static MethodHandle WICKRA_RECTANGLE_RANGE_BATCH; + public static MethodHandle WICKRA_RECTANGLE_RANGE_RESET; + public static MethodHandle WICKRA_RECTANGLE_RANGE_FREE; + public static MethodHandle WICKRA_RICKSHAW_MAN_NEW; + public static MethodHandle WICKRA_RICKSHAW_MAN_UPDATE; + public static MethodHandle WICKRA_RICKSHAW_MAN_BATCH; + public static MethodHandle WICKRA_RICKSHAW_MAN_RESET; + public static MethodHandle WICKRA_RICKSHAW_MAN_FREE; + public static MethodHandle WICKRA_RISING_THREE_METHODS_NEW; + public static MethodHandle WICKRA_RISING_THREE_METHODS_UPDATE; + public static MethodHandle WICKRA_RISING_THREE_METHODS_BATCH; + public static MethodHandle WICKRA_RISING_THREE_METHODS_RESET; + public static MethodHandle WICKRA_RISING_THREE_METHODS_FREE; + public static MethodHandle WICKRA_ROGERS_SATCHELL_VOLATILITY_NEW; + public static MethodHandle WICKRA_ROGERS_SATCHELL_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_ROGERS_SATCHELL_VOLATILITY_BATCH; + public static MethodHandle WICKRA_ROGERS_SATCHELL_VOLATILITY_RESET; + public static MethodHandle WICKRA_ROGERS_SATCHELL_VOLATILITY_FREE; + public static MethodHandle WICKRA_RVI_NEW; + public static MethodHandle WICKRA_RVI_UPDATE; + public static MethodHandle WICKRA_RVI_BATCH; + public static MethodHandle WICKRA_RVI_RESET; + public static MethodHandle WICKRA_RVI_FREE; + public static MethodHandle WICKRA_SAR_EXT_NEW; + public static MethodHandle WICKRA_SAR_EXT_UPDATE; + public static MethodHandle WICKRA_SAR_EXT_BATCH; + public static MethodHandle WICKRA_SAR_EXT_RESET; + public static MethodHandle WICKRA_SAR_EXT_FREE; + public static MethodHandle WICKRA_SEASONAL_Z_SCORE_NEW; + public static MethodHandle WICKRA_SEASONAL_Z_SCORE_UPDATE; + public static MethodHandle WICKRA_SEASONAL_Z_SCORE_BATCH; + public static MethodHandle WICKRA_SEASONAL_Z_SCORE_RESET; + public static MethodHandle WICKRA_SEASONAL_Z_SCORE_FREE; + public static MethodHandle WICKRA_SEPARATING_LINES_NEW; + public static MethodHandle WICKRA_SEPARATING_LINES_UPDATE; + public static MethodHandle WICKRA_SEPARATING_LINES_BATCH; + public static MethodHandle WICKRA_SEPARATING_LINES_RESET; + public static MethodHandle WICKRA_SEPARATING_LINES_FREE; + public static MethodHandle WICKRA_SESSION_VWAP_NEW; + public static MethodHandle WICKRA_SESSION_VWAP_UPDATE; + public static MethodHandle WICKRA_SESSION_VWAP_BATCH; + public static MethodHandle WICKRA_SESSION_VWAP_RESET; + public static MethodHandle WICKRA_SESSION_VWAP_FREE; + public static MethodHandle WICKRA_SHARK_NEW; + public static MethodHandle WICKRA_SHARK_UPDATE; + public static MethodHandle WICKRA_SHARK_BATCH; + public static MethodHandle WICKRA_SHARK_RESET; + public static MethodHandle WICKRA_SHARK_FREE; + public static MethodHandle WICKRA_SHOOTING_STAR_NEW; + public static MethodHandle WICKRA_SHOOTING_STAR_UPDATE; + public static MethodHandle WICKRA_SHOOTING_STAR_BATCH; + public static MethodHandle WICKRA_SHOOTING_STAR_RESET; + public static MethodHandle WICKRA_SHOOTING_STAR_FREE; + public static MethodHandle WICKRA_SHORT_LINE_NEW; + public static MethodHandle WICKRA_SHORT_LINE_UPDATE; + public static MethodHandle WICKRA_SHORT_LINE_BATCH; + public static MethodHandle WICKRA_SHORT_LINE_RESET; + public static MethodHandle WICKRA_SHORT_LINE_FREE; + public static MethodHandle WICKRA_SINGLE_PRINTS_NEW; + public static MethodHandle WICKRA_SINGLE_PRINTS_UPDATE; + public static MethodHandle WICKRA_SINGLE_PRINTS_BATCH; + public static MethodHandle WICKRA_SINGLE_PRINTS_RESET; + public static MethodHandle WICKRA_SINGLE_PRINTS_FREE; + public static MethodHandle WICKRA_SMI_NEW; + public static MethodHandle WICKRA_SMI_UPDATE; + public static MethodHandle WICKRA_SMI_BATCH; + public static MethodHandle WICKRA_SMI_RESET; + public static MethodHandle WICKRA_SMI_FREE; + public static MethodHandle WICKRA_SPINNING_TOP_NEW; + public static MethodHandle WICKRA_SPINNING_TOP_UPDATE; + public static MethodHandle WICKRA_SPINNING_TOP_BATCH; + public static MethodHandle WICKRA_SPINNING_TOP_RESET; + public static MethodHandle WICKRA_SPINNING_TOP_FREE; + public static MethodHandle WICKRA_STALLED_PATTERN_NEW; + public static MethodHandle WICKRA_STALLED_PATTERN_UPDATE; + public static MethodHandle WICKRA_STALLED_PATTERN_BATCH; + public static MethodHandle WICKRA_STALLED_PATTERN_RESET; + public static MethodHandle WICKRA_STALLED_PATTERN_FREE; + public static MethodHandle WICKRA_STICK_SANDWICH_NEW; + public static MethodHandle WICKRA_STICK_SANDWICH_UPDATE; + public static MethodHandle WICKRA_STICK_SANDWICH_BATCH; + public static MethodHandle WICKRA_STICK_SANDWICH_RESET; + public static MethodHandle WICKRA_STICK_SANDWICH_FREE; + public static MethodHandle WICKRA_STOCHASTIC_CCI_NEW; + public static MethodHandle WICKRA_STOCHASTIC_CCI_UPDATE; + public static MethodHandle WICKRA_STOCHASTIC_CCI_BATCH; + public static MethodHandle WICKRA_STOCHASTIC_CCI_RESET; + public static MethodHandle WICKRA_STOCHASTIC_CCI_FREE; + public static MethodHandle WICKRA_TAKURI_NEW; + public static MethodHandle WICKRA_TAKURI_UPDATE; + public static MethodHandle WICKRA_TAKURI_BATCH; + public static MethodHandle WICKRA_TAKURI_RESET; + public static MethodHandle WICKRA_TAKURI_FREE; + public static MethodHandle WICKRA_TASUKI_GAP_NEW; + public static MethodHandle WICKRA_TASUKI_GAP_UPDATE; + public static MethodHandle WICKRA_TASUKI_GAP_BATCH; + public static MethodHandle WICKRA_TASUKI_GAP_RESET; + public static MethodHandle WICKRA_TASUKI_GAP_FREE; + public static MethodHandle WICKRA_TD_CAMOUFLAGE_NEW; + public static MethodHandle WICKRA_TD_CAMOUFLAGE_UPDATE; + public static MethodHandle WICKRA_TD_CAMOUFLAGE_BATCH; + public static MethodHandle WICKRA_TD_CAMOUFLAGE_RESET; + public static MethodHandle WICKRA_TD_CAMOUFLAGE_FREE; + public static MethodHandle WICKRA_TD_CLOP_NEW; + public static MethodHandle WICKRA_TD_CLOP_UPDATE; + public static MethodHandle WICKRA_TD_CLOP_BATCH; + public static MethodHandle WICKRA_TD_CLOP_RESET; + public static MethodHandle WICKRA_TD_CLOP_FREE; + public static MethodHandle WICKRA_TD_CLOPWIN_NEW; + public static MethodHandle WICKRA_TD_CLOPWIN_UPDATE; + public static MethodHandle WICKRA_TD_CLOPWIN_BATCH; + public static MethodHandle WICKRA_TD_CLOPWIN_RESET; + public static MethodHandle WICKRA_TD_CLOPWIN_FREE; + public static MethodHandle WICKRA_TD_COMBO_NEW; + public static MethodHandle WICKRA_TD_COMBO_UPDATE; + public static MethodHandle WICKRA_TD_COMBO_BATCH; + public static MethodHandle WICKRA_TD_COMBO_RESET; + public static MethodHandle WICKRA_TD_COMBO_FREE; + public static MethodHandle WICKRA_TD_COUNTDOWN_NEW; + public static MethodHandle WICKRA_TD_COUNTDOWN_UPDATE; + public static MethodHandle WICKRA_TD_COUNTDOWN_BATCH; + public static MethodHandle WICKRA_TD_COUNTDOWN_RESET; + public static MethodHandle WICKRA_TD_COUNTDOWN_FREE; + public static MethodHandle WICKRA_TD_DE_MARKER_NEW; + public static MethodHandle WICKRA_TD_DE_MARKER_UPDATE; + public static MethodHandle WICKRA_TD_DE_MARKER_BATCH; + public static MethodHandle WICKRA_TD_DE_MARKER_RESET; + public static MethodHandle WICKRA_TD_DE_MARKER_FREE; + public static MethodHandle WICKRA_TD_DIFFERENTIAL_NEW; + public static MethodHandle WICKRA_TD_DIFFERENTIAL_UPDATE; + public static MethodHandle WICKRA_TD_DIFFERENTIAL_BATCH; + public static MethodHandle WICKRA_TD_DIFFERENTIAL_RESET; + public static MethodHandle WICKRA_TD_DIFFERENTIAL_FREE; + public static MethodHandle WICKRA_TD_D_WAVE_NEW; + public static MethodHandle WICKRA_TD_D_WAVE_UPDATE; + public static MethodHandle WICKRA_TD_D_WAVE_BATCH; + public static MethodHandle WICKRA_TD_D_WAVE_RESET; + public static MethodHandle WICKRA_TD_D_WAVE_FREE; + public static MethodHandle WICKRA_TD_OPEN_NEW; + public static MethodHandle WICKRA_TD_OPEN_UPDATE; + public static MethodHandle WICKRA_TD_OPEN_BATCH; + public static MethodHandle WICKRA_TD_OPEN_RESET; + public static MethodHandle WICKRA_TD_OPEN_FREE; + public static MethodHandle WICKRA_TD_PRESSURE_NEW; + public static MethodHandle WICKRA_TD_PRESSURE_UPDATE; + public static MethodHandle WICKRA_TD_PRESSURE_BATCH; + public static MethodHandle WICKRA_TD_PRESSURE_RESET; + public static MethodHandle WICKRA_TD_PRESSURE_FREE; + public static MethodHandle WICKRA_TD_PROPULSION_NEW; + public static MethodHandle WICKRA_TD_PROPULSION_UPDATE; + public static MethodHandle WICKRA_TD_PROPULSION_BATCH; + public static MethodHandle WICKRA_TD_PROPULSION_RESET; + public static MethodHandle WICKRA_TD_PROPULSION_FREE; + public static MethodHandle WICKRA_TD_REI_NEW; + public static MethodHandle WICKRA_TD_REI_UPDATE; + public static MethodHandle WICKRA_TD_REI_BATCH; + public static MethodHandle WICKRA_TD_REI_RESET; + public static MethodHandle WICKRA_TD_REI_FREE; + public static MethodHandle WICKRA_TD_SETUP_NEW; + public static MethodHandle WICKRA_TD_SETUP_UPDATE; + public static MethodHandle WICKRA_TD_SETUP_BATCH; + public static MethodHandle WICKRA_TD_SETUP_RESET; + public static MethodHandle WICKRA_TD_SETUP_FREE; + public static MethodHandle WICKRA_TD_TRAP_NEW; + public static MethodHandle WICKRA_TD_TRAP_UPDATE; + public static MethodHandle WICKRA_TD_TRAP_BATCH; + public static MethodHandle WICKRA_TD_TRAP_RESET; + public static MethodHandle WICKRA_TD_TRAP_FREE; + public static MethodHandle WICKRA_THREE_DRIVES_NEW; + public static MethodHandle WICKRA_THREE_DRIVES_UPDATE; + public static MethodHandle WICKRA_THREE_DRIVES_BATCH; + public static MethodHandle WICKRA_THREE_DRIVES_RESET; + public static MethodHandle WICKRA_THREE_DRIVES_FREE; + public static MethodHandle WICKRA_THREE_INSIDE_NEW; + public static MethodHandle WICKRA_THREE_INSIDE_UPDATE; + public static MethodHandle WICKRA_THREE_INSIDE_BATCH; + public static MethodHandle WICKRA_THREE_INSIDE_RESET; + public static MethodHandle WICKRA_THREE_INSIDE_FREE; + public static MethodHandle WICKRA_THREE_LINE_BREAK_NEW; + public static MethodHandle WICKRA_THREE_LINE_BREAK_UPDATE; + public static MethodHandle WICKRA_THREE_LINE_BREAK_BATCH; + public static MethodHandle WICKRA_THREE_LINE_BREAK_RESET; + public static MethodHandle WICKRA_THREE_LINE_BREAK_FREE; + public static MethodHandle WICKRA_THREE_LINE_STRIKE_NEW; + public static MethodHandle WICKRA_THREE_LINE_STRIKE_UPDATE; + public static MethodHandle WICKRA_THREE_LINE_STRIKE_BATCH; + public static MethodHandle WICKRA_THREE_LINE_STRIKE_RESET; + public static MethodHandle WICKRA_THREE_LINE_STRIKE_FREE; + public static MethodHandle WICKRA_THREE_OUTSIDE_NEW; + public static MethodHandle WICKRA_THREE_OUTSIDE_UPDATE; + public static MethodHandle WICKRA_THREE_OUTSIDE_BATCH; + public static MethodHandle WICKRA_THREE_OUTSIDE_RESET; + public static MethodHandle WICKRA_THREE_OUTSIDE_FREE; + public static MethodHandle WICKRA_THREE_SOLDIERS_OR_CROWS_NEW; + public static MethodHandle WICKRA_THREE_SOLDIERS_OR_CROWS_UPDATE; + public static MethodHandle WICKRA_THREE_SOLDIERS_OR_CROWS_BATCH; + public static MethodHandle WICKRA_THREE_SOLDIERS_OR_CROWS_RESET; + public static MethodHandle WICKRA_THREE_SOLDIERS_OR_CROWS_FREE; + public static MethodHandle WICKRA_THREE_STARS_IN_SOUTH_NEW; + public static MethodHandle WICKRA_THREE_STARS_IN_SOUTH_UPDATE; + public static MethodHandle WICKRA_THREE_STARS_IN_SOUTH_BATCH; + public static MethodHandle WICKRA_THREE_STARS_IN_SOUTH_RESET; + public static MethodHandle WICKRA_THREE_STARS_IN_SOUTH_FREE; + public static MethodHandle WICKRA_THRUSTING_NEW; + public static MethodHandle WICKRA_THRUSTING_UPDATE; + public static MethodHandle WICKRA_THRUSTING_BATCH; + public static MethodHandle WICKRA_THRUSTING_RESET; + public static MethodHandle WICKRA_THRUSTING_FREE; + public static MethodHandle WICKRA_TIME_BASED_STOP_NEW; + public static MethodHandle WICKRA_TIME_BASED_STOP_UPDATE; + public static MethodHandle WICKRA_TIME_BASED_STOP_BATCH; + public static MethodHandle WICKRA_TIME_BASED_STOP_RESET; + public static MethodHandle WICKRA_TIME_BASED_STOP_FREE; + public static MethodHandle WICKRA_TOWER_TOP_BOTTOM_NEW; + public static MethodHandle WICKRA_TOWER_TOP_BOTTOM_UPDATE; + public static MethodHandle WICKRA_TOWER_TOP_BOTTOM_BATCH; + public static MethodHandle WICKRA_TOWER_TOP_BOTTOM_RESET; + public static MethodHandle WICKRA_TOWER_TOP_BOTTOM_FREE; + public static MethodHandle WICKRA_TRADE_VOLUME_INDEX_NEW; + public static MethodHandle WICKRA_TRADE_VOLUME_INDEX_UPDATE; + public static MethodHandle WICKRA_TRADE_VOLUME_INDEX_BATCH; + public static MethodHandle WICKRA_TRADE_VOLUME_INDEX_RESET; + public static MethodHandle WICKRA_TRADE_VOLUME_INDEX_FREE; + public static MethodHandle WICKRA_TRIANGLE_NEW; + public static MethodHandle WICKRA_TRIANGLE_UPDATE; + public static MethodHandle WICKRA_TRIANGLE_BATCH; + public static MethodHandle WICKRA_TRIANGLE_RESET; + public static MethodHandle WICKRA_TRIANGLE_FREE; + public static MethodHandle WICKRA_TRIPLE_TOP_BOTTOM_NEW; + public static MethodHandle WICKRA_TRIPLE_TOP_BOTTOM_UPDATE; + public static MethodHandle WICKRA_TRIPLE_TOP_BOTTOM_BATCH; + public static MethodHandle WICKRA_TRIPLE_TOP_BOTTOM_RESET; + public static MethodHandle WICKRA_TRIPLE_TOP_BOTTOM_FREE; + public static MethodHandle WICKRA_TRISTAR_NEW; + public static MethodHandle WICKRA_TRISTAR_UPDATE; + public static MethodHandle WICKRA_TRISTAR_BATCH; + public static MethodHandle WICKRA_TRISTAR_RESET; + public static MethodHandle WICKRA_TRISTAR_FREE; + public static MethodHandle WICKRA_TRUE_RANGE_NEW; + public static MethodHandle WICKRA_TRUE_RANGE_UPDATE; + public static MethodHandle WICKRA_TRUE_RANGE_BATCH; + public static MethodHandle WICKRA_TRUE_RANGE_RESET; + public static MethodHandle WICKRA_TRUE_RANGE_FREE; + public static MethodHandle WICKRA_TSV_NEW; + public static MethodHandle WICKRA_TSV_UPDATE; + public static MethodHandle WICKRA_TSV_BATCH; + public static MethodHandle WICKRA_TSV_RESET; + public static MethodHandle WICKRA_TSV_FREE; + public static MethodHandle WICKRA_TTM_TREND_NEW; + public static MethodHandle WICKRA_TTM_TREND_UPDATE; + public static MethodHandle WICKRA_TTM_TREND_BATCH; + public static MethodHandle WICKRA_TTM_TREND_RESET; + public static MethodHandle WICKRA_TTM_TREND_FREE; + public static MethodHandle WICKRA_TURN_OF_MONTH_NEW; + public static MethodHandle WICKRA_TURN_OF_MONTH_UPDATE; + public static MethodHandle WICKRA_TURN_OF_MONTH_BATCH; + public static MethodHandle WICKRA_TURN_OF_MONTH_RESET; + public static MethodHandle WICKRA_TURN_OF_MONTH_FREE; + public static MethodHandle WICKRA_TWEEZER_NEW; + public static MethodHandle WICKRA_TWEEZER_UPDATE; + public static MethodHandle WICKRA_TWEEZER_BATCH; + public static MethodHandle WICKRA_TWEEZER_RESET; + public static MethodHandle WICKRA_TWEEZER_FREE; + public static MethodHandle WICKRA_TWIGGS_MONEY_FLOW_NEW; + public static MethodHandle WICKRA_TWIGGS_MONEY_FLOW_UPDATE; + public static MethodHandle WICKRA_TWIGGS_MONEY_FLOW_BATCH; + public static MethodHandle WICKRA_TWIGGS_MONEY_FLOW_RESET; + public static MethodHandle WICKRA_TWIGGS_MONEY_FLOW_FREE; + public static MethodHandle WICKRA_TWO_CROWS_NEW; + public static MethodHandle WICKRA_TWO_CROWS_UPDATE; + public static MethodHandle WICKRA_TWO_CROWS_BATCH; + public static MethodHandle WICKRA_TWO_CROWS_RESET; + public static MethodHandle WICKRA_TWO_CROWS_FREE; + public static MethodHandle WICKRA_TYPICAL_PRICE_NEW; + public static MethodHandle WICKRA_TYPICAL_PRICE_UPDATE; + public static MethodHandle WICKRA_TYPICAL_PRICE_BATCH; + public static MethodHandle WICKRA_TYPICAL_PRICE_RESET; + public static MethodHandle WICKRA_TYPICAL_PRICE_FREE; + public static MethodHandle WICKRA_ULTIMATE_OSCILLATOR_NEW; + public static MethodHandle WICKRA_ULTIMATE_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_ULTIMATE_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_ULTIMATE_OSCILLATOR_RESET; + public static MethodHandle WICKRA_ULTIMATE_OSCILLATOR_FREE; + public static MethodHandle WICKRA_UNIQUE_THREE_RIVER_NEW; + public static MethodHandle WICKRA_UNIQUE_THREE_RIVER_UPDATE; + public static MethodHandle WICKRA_UNIQUE_THREE_RIVER_BATCH; + public static MethodHandle WICKRA_UNIQUE_THREE_RIVER_RESET; + public static MethodHandle WICKRA_UNIQUE_THREE_RIVER_FREE; + public static MethodHandle WICKRA_UPSIDE_GAP_THREE_METHODS_NEW; + public static MethodHandle WICKRA_UPSIDE_GAP_THREE_METHODS_UPDATE; + public static MethodHandle WICKRA_UPSIDE_GAP_THREE_METHODS_BATCH; + public static MethodHandle WICKRA_UPSIDE_GAP_THREE_METHODS_RESET; + public static MethodHandle WICKRA_UPSIDE_GAP_THREE_METHODS_FREE; + public static MethodHandle WICKRA_UPSIDE_GAP_TWO_CROWS_NEW; + public static MethodHandle WICKRA_UPSIDE_GAP_TWO_CROWS_UPDATE; + public static MethodHandle WICKRA_UPSIDE_GAP_TWO_CROWS_BATCH; + public static MethodHandle WICKRA_UPSIDE_GAP_TWO_CROWS_RESET; + public static MethodHandle WICKRA_UPSIDE_GAP_TWO_CROWS_FREE; + public static MethodHandle WICKRA_VOLATILITY_RATIO_NEW; + public static MethodHandle WICKRA_VOLATILITY_RATIO_UPDATE; + public static MethodHandle WICKRA_VOLATILITY_RATIO_BATCH; + public static MethodHandle WICKRA_VOLATILITY_RATIO_RESET; + public static MethodHandle WICKRA_VOLATILITY_RATIO_FREE; + public static MethodHandle WICKRA_VOLTY_STOP_NEW; + public static MethodHandle WICKRA_VOLTY_STOP_UPDATE; + public static MethodHandle WICKRA_VOLTY_STOP_BATCH; + public static MethodHandle WICKRA_VOLTY_STOP_RESET; + public static MethodHandle WICKRA_VOLTY_STOP_FREE; + public static MethodHandle WICKRA_VOLUME_OSCILLATOR_NEW; + public static MethodHandle WICKRA_VOLUME_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_VOLUME_OSCILLATOR_BATCH; + public static MethodHandle WICKRA_VOLUME_OSCILLATOR_RESET; + public static MethodHandle WICKRA_VOLUME_OSCILLATOR_FREE; + public static MethodHandle WICKRA_VOLUME_RSI_NEW; + public static MethodHandle WICKRA_VOLUME_RSI_UPDATE; + public static MethodHandle WICKRA_VOLUME_RSI_BATCH; + public static MethodHandle WICKRA_VOLUME_RSI_RESET; + public static MethodHandle WICKRA_VOLUME_RSI_FREE; + public static MethodHandle WICKRA_VOLUME_PRICE_TREND_NEW; + public static MethodHandle WICKRA_VOLUME_PRICE_TREND_UPDATE; + public static MethodHandle WICKRA_VOLUME_PRICE_TREND_BATCH; + public static MethodHandle WICKRA_VOLUME_PRICE_TREND_RESET; + public static MethodHandle WICKRA_VOLUME_PRICE_TREND_FREE; + public static MethodHandle WICKRA_VWAP_NEW; + public static MethodHandle WICKRA_VWAP_UPDATE; + public static MethodHandle WICKRA_VWAP_BATCH; + public static MethodHandle WICKRA_VWAP_RESET; + public static MethodHandle WICKRA_VWAP_FREE; + public static MethodHandle WICKRA_ROLLING_VWAP_NEW; + public static MethodHandle WICKRA_ROLLING_VWAP_UPDATE; + public static MethodHandle WICKRA_ROLLING_VWAP_BATCH; + public static MethodHandle WICKRA_ROLLING_VWAP_RESET; + public static MethodHandle WICKRA_ROLLING_VWAP_FREE; + public static MethodHandle WICKRA_VWMA_NEW; + public static MethodHandle WICKRA_VWMA_UPDATE; + public static MethodHandle WICKRA_VWMA_BATCH; + public static MethodHandle WICKRA_VWMA_RESET; + public static MethodHandle WICKRA_VWMA_FREE; + public static MethodHandle WICKRA_VZO_NEW; + public static MethodHandle WICKRA_VZO_UPDATE; + public static MethodHandle WICKRA_VZO_BATCH; + public static MethodHandle WICKRA_VZO_RESET; + public static MethodHandle WICKRA_VZO_FREE; + public static MethodHandle WICKRA_WAD_NEW; + public static MethodHandle WICKRA_WAD_UPDATE; + public static MethodHandle WICKRA_WAD_BATCH; + public static MethodHandle WICKRA_WAD_RESET; + public static MethodHandle WICKRA_WAD_FREE; + public static MethodHandle WICKRA_WEDGE_NEW; + public static MethodHandle WICKRA_WEDGE_UPDATE; + public static MethodHandle WICKRA_WEDGE_BATCH; + public static MethodHandle WICKRA_WEDGE_RESET; + public static MethodHandle WICKRA_WEDGE_FREE; + public static MethodHandle WICKRA_WEIGHTED_CLOSE_NEW; + public static MethodHandle WICKRA_WEIGHTED_CLOSE_UPDATE; + public static MethodHandle WICKRA_WEIGHTED_CLOSE_BATCH; + public static MethodHandle WICKRA_WEIGHTED_CLOSE_RESET; + public static MethodHandle WICKRA_WEIGHTED_CLOSE_FREE; + public static MethodHandle WICKRA_WICK_RATIO_NEW; + public static MethodHandle WICKRA_WICK_RATIO_UPDATE; + public static MethodHandle WICKRA_WICK_RATIO_BATCH; + public static MethodHandle WICKRA_WICK_RATIO_RESET; + public static MethodHandle WICKRA_WICK_RATIO_FREE; + public static MethodHandle WICKRA_WILLIAMS_R_NEW; + public static MethodHandle WICKRA_WILLIAMS_R_UPDATE; + public static MethodHandle WICKRA_WILLIAMS_R_BATCH; + public static MethodHandle WICKRA_WILLIAMS_R_RESET; + public static MethodHandle WICKRA_WILLIAMS_R_FREE; + public static MethodHandle WICKRA_YANG_ZHANG_VOLATILITY_NEW; + public static MethodHandle WICKRA_YANG_ZHANG_VOLATILITY_UPDATE; + public static MethodHandle WICKRA_YANG_ZHANG_VOLATILITY_BATCH; + public static MethodHandle WICKRA_YANG_ZHANG_VOLATILITY_RESET; + public static MethodHandle WICKRA_YANG_ZHANG_VOLATILITY_FREE; + public static MethodHandle WICKRA_YOYO_EXIT_NEW; + public static MethodHandle WICKRA_YOYO_EXIT_UPDATE; + public static MethodHandle WICKRA_YOYO_EXIT_BATCH; + public static MethodHandle WICKRA_YOYO_EXIT_RESET; + public static MethodHandle WICKRA_YOYO_EXIT_FREE; + public static MethodHandle WICKRA_AMIHUD_ILLIQUIDITY_NEW; + public static MethodHandle WICKRA_AMIHUD_ILLIQUIDITY_UPDATE; + public static MethodHandle WICKRA_AMIHUD_ILLIQUIDITY_RESET; + public static MethodHandle WICKRA_AMIHUD_ILLIQUIDITY_FREE; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_DELTA_NEW; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_DELTA_UPDATE; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_DELTA_RESET; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_DELTA_FREE; + public static MethodHandle WICKRA_PIN_NEW; + public static MethodHandle WICKRA_PIN_UPDATE; + public static MethodHandle WICKRA_PIN_RESET; + public static MethodHandle WICKRA_PIN_FREE; + public static MethodHandle WICKRA_ROLL_MEASURE_NEW; + public static MethodHandle WICKRA_ROLL_MEASURE_UPDATE; + public static MethodHandle WICKRA_ROLL_MEASURE_RESET; + public static MethodHandle WICKRA_ROLL_MEASURE_FREE; + public static MethodHandle WICKRA_SIGNED_VOLUME_NEW; + public static MethodHandle WICKRA_SIGNED_VOLUME_UPDATE; + public static MethodHandle WICKRA_SIGNED_VOLUME_RESET; + public static MethodHandle WICKRA_SIGNED_VOLUME_FREE; + public static MethodHandle WICKRA_TRADE_IMBALANCE_NEW; + public static MethodHandle WICKRA_TRADE_IMBALANCE_UPDATE; + public static MethodHandle WICKRA_TRADE_IMBALANCE_RESET; + public static MethodHandle WICKRA_TRADE_IMBALANCE_FREE; + public static MethodHandle WICKRA_TRADE_SIGN_AUTOCORRELATION_NEW; + public static MethodHandle WICKRA_TRADE_SIGN_AUTOCORRELATION_UPDATE; + public static MethodHandle WICKRA_TRADE_SIGN_AUTOCORRELATION_RESET; + public static MethodHandle WICKRA_TRADE_SIGN_AUTOCORRELATION_FREE; + public static MethodHandle WICKRA_VPIN_NEW; + public static MethodHandle WICKRA_VPIN_UPDATE; + public static MethodHandle WICKRA_VPIN_RESET; + public static MethodHandle WICKRA_VPIN_FREE; + public static MethodHandle WICKRA_EFFECTIVE_SPREAD_NEW; + public static MethodHandle WICKRA_EFFECTIVE_SPREAD_UPDATE; + public static MethodHandle WICKRA_EFFECTIVE_SPREAD_RESET; + public static MethodHandle WICKRA_EFFECTIVE_SPREAD_FREE; + public static MethodHandle WICKRA_KYLES_LAMBDA_NEW; + public static MethodHandle WICKRA_KYLES_LAMBDA_UPDATE; + public static MethodHandle WICKRA_KYLES_LAMBDA_RESET; + public static MethodHandle WICKRA_KYLES_LAMBDA_FREE; + public static MethodHandle WICKRA_REALIZED_SPREAD_NEW; + public static MethodHandle WICKRA_REALIZED_SPREAD_UPDATE; + public static MethodHandle WICKRA_REALIZED_SPREAD_RESET; + public static MethodHandle WICKRA_REALIZED_SPREAD_FREE; + public static MethodHandle WICKRA_CALENDAR_SPREAD_NEW; + public static MethodHandle WICKRA_CALENDAR_SPREAD_UPDATE; + public static MethodHandle WICKRA_CALENDAR_SPREAD_RESET; + public static MethodHandle WICKRA_CALENDAR_SPREAD_FREE; + public static MethodHandle WICKRA_ESTIMATED_LEVERAGE_RATIO_NEW; + public static MethodHandle WICKRA_ESTIMATED_LEVERAGE_RATIO_UPDATE; + public static MethodHandle WICKRA_ESTIMATED_LEVERAGE_RATIO_RESET; + public static MethodHandle WICKRA_ESTIMATED_LEVERAGE_RATIO_FREE; + public static MethodHandle WICKRA_FUNDING_BASIS_NEW; + public static MethodHandle WICKRA_FUNDING_BASIS_UPDATE; + public static MethodHandle WICKRA_FUNDING_BASIS_RESET; + public static MethodHandle WICKRA_FUNDING_BASIS_FREE; + public static MethodHandle WICKRA_FUNDING_IMPLIED_APR_NEW; + public static MethodHandle WICKRA_FUNDING_IMPLIED_APR_UPDATE; + public static MethodHandle WICKRA_FUNDING_IMPLIED_APR_RESET; + public static MethodHandle WICKRA_FUNDING_IMPLIED_APR_FREE; + public static MethodHandle WICKRA_FUNDING_RATE_NEW; + public static MethodHandle WICKRA_FUNDING_RATE_UPDATE; + public static MethodHandle WICKRA_FUNDING_RATE_RESET; + public static MethodHandle WICKRA_FUNDING_RATE_FREE; + public static MethodHandle WICKRA_FUNDING_RATE_MEAN_NEW; + public static MethodHandle WICKRA_FUNDING_RATE_MEAN_UPDATE; + public static MethodHandle WICKRA_FUNDING_RATE_MEAN_RESET; + public static MethodHandle WICKRA_FUNDING_RATE_MEAN_FREE; + public static MethodHandle WICKRA_FUNDING_RATE_Z_SCORE_NEW; + public static MethodHandle WICKRA_FUNDING_RATE_Z_SCORE_UPDATE; + public static MethodHandle WICKRA_FUNDING_RATE_Z_SCORE_RESET; + public static MethodHandle WICKRA_FUNDING_RATE_Z_SCORE_FREE; + public static MethodHandle WICKRA_LONG_SHORT_RATIO_NEW; + public static MethodHandle WICKRA_LONG_SHORT_RATIO_UPDATE; + public static MethodHandle WICKRA_LONG_SHORT_RATIO_RESET; + public static MethodHandle WICKRA_LONG_SHORT_RATIO_FREE; + public static MethodHandle WICKRA_OPEN_INTEREST_DELTA_NEW; + public static MethodHandle WICKRA_OPEN_INTEREST_DELTA_UPDATE; + public static MethodHandle WICKRA_OPEN_INTEREST_DELTA_RESET; + public static MethodHandle WICKRA_OPEN_INTEREST_DELTA_FREE; + public static MethodHandle WICKRA_OI_PRICE_DIVERGENCE_NEW; + public static MethodHandle WICKRA_OI_PRICE_DIVERGENCE_UPDATE; + public static MethodHandle WICKRA_OI_PRICE_DIVERGENCE_RESET; + public static MethodHandle WICKRA_OI_PRICE_DIVERGENCE_FREE; + public static MethodHandle WICKRA_OI_TO_VOLUME_RATIO_NEW; + public static MethodHandle WICKRA_OI_TO_VOLUME_RATIO_UPDATE; + public static MethodHandle WICKRA_OI_TO_VOLUME_RATIO_RESET; + public static MethodHandle WICKRA_OI_TO_VOLUME_RATIO_FREE; + public static MethodHandle WICKRA_OI_WEIGHTED_NEW; + public static MethodHandle WICKRA_OI_WEIGHTED_UPDATE; + public static MethodHandle WICKRA_OI_WEIGHTED_RESET; + public static MethodHandle WICKRA_OI_WEIGHTED_FREE; + public static MethodHandle WICKRA_OPEN_INTEREST_MOMENTUM_NEW; + public static MethodHandle WICKRA_OPEN_INTEREST_MOMENTUM_UPDATE; + public static MethodHandle WICKRA_OPEN_INTEREST_MOMENTUM_RESET; + public static MethodHandle WICKRA_OPEN_INTEREST_MOMENTUM_FREE; + public static MethodHandle WICKRA_PERPETUAL_PREMIUM_INDEX_NEW; + public static MethodHandle WICKRA_PERPETUAL_PREMIUM_INDEX_UPDATE; + public static MethodHandle WICKRA_PERPETUAL_PREMIUM_INDEX_RESET; + public static MethodHandle WICKRA_PERPETUAL_PREMIUM_INDEX_FREE; + public static MethodHandle WICKRA_TAKER_BUY_SELL_RATIO_NEW; + public static MethodHandle WICKRA_TAKER_BUY_SELL_RATIO_UPDATE; + public static MethodHandle WICKRA_TAKER_BUY_SELL_RATIO_RESET; + public static MethodHandle WICKRA_TAKER_BUY_SELL_RATIO_FREE; + public static MethodHandle WICKRA_TERM_STRUCTURE_BASIS_NEW; + public static MethodHandle WICKRA_TERM_STRUCTURE_BASIS_UPDATE; + public static MethodHandle WICKRA_TERM_STRUCTURE_BASIS_RESET; + public static MethodHandle WICKRA_TERM_STRUCTURE_BASIS_FREE; + public static MethodHandle WICKRA_DEPTH_SLOPE_NEW; + public static MethodHandle WICKRA_DEPTH_SLOPE_UPDATE; + public static MethodHandle WICKRA_DEPTH_SLOPE_RESET; + public static MethodHandle WICKRA_DEPTH_SLOPE_FREE; + public static MethodHandle WICKRA_MICROPRICE_NEW; + public static MethodHandle WICKRA_MICROPRICE_UPDATE; + public static MethodHandle WICKRA_MICROPRICE_RESET; + public static MethodHandle WICKRA_MICROPRICE_FREE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_FULL_NEW; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_FULL_UPDATE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_FULL_RESET; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_FULL_FREE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP1_NEW; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP1_UPDATE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP1_RESET; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP1_FREE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_NEW; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_UPDATE; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_RESET; + public static MethodHandle WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_FREE; + public static MethodHandle WICKRA_ORDER_FLOW_IMBALANCE_NEW; + public static MethodHandle WICKRA_ORDER_FLOW_IMBALANCE_UPDATE; + public static MethodHandle WICKRA_ORDER_FLOW_IMBALANCE_RESET; + public static MethodHandle WICKRA_ORDER_FLOW_IMBALANCE_FREE; + public static MethodHandle WICKRA_QUOTED_SPREAD_NEW; + public static MethodHandle WICKRA_QUOTED_SPREAD_UPDATE; + public static MethodHandle WICKRA_QUOTED_SPREAD_RESET; + public static MethodHandle WICKRA_QUOTED_SPREAD_FREE; + public static MethodHandle WICKRA_ABSOLUTE_BREADTH_INDEX_NEW; + public static MethodHandle WICKRA_ABSOLUTE_BREADTH_INDEX_UPDATE; + public static MethodHandle WICKRA_ABSOLUTE_BREADTH_INDEX_RESET; + public static MethodHandle WICKRA_ABSOLUTE_BREADTH_INDEX_FREE; + public static MethodHandle WICKRA_AD_VOLUME_LINE_NEW; + public static MethodHandle WICKRA_AD_VOLUME_LINE_UPDATE; + public static MethodHandle WICKRA_AD_VOLUME_LINE_RESET; + public static MethodHandle WICKRA_AD_VOLUME_LINE_FREE; + public static MethodHandle WICKRA_ADVANCE_DECLINE_NEW; + public static MethodHandle WICKRA_ADVANCE_DECLINE_UPDATE; + public static MethodHandle WICKRA_ADVANCE_DECLINE_RESET; + public static MethodHandle WICKRA_ADVANCE_DECLINE_FREE; + public static MethodHandle WICKRA_ADVANCE_DECLINE_RATIO_NEW; + public static MethodHandle WICKRA_ADVANCE_DECLINE_RATIO_UPDATE; + public static MethodHandle WICKRA_ADVANCE_DECLINE_RATIO_RESET; + public static MethodHandle WICKRA_ADVANCE_DECLINE_RATIO_FREE; + public static MethodHandle WICKRA_BREADTH_THRUST_NEW; + public static MethodHandle WICKRA_BREADTH_THRUST_UPDATE; + public static MethodHandle WICKRA_BREADTH_THRUST_RESET; + public static MethodHandle WICKRA_BREADTH_THRUST_FREE; + public static MethodHandle WICKRA_BULLISH_PERCENT_INDEX_NEW; + public static MethodHandle WICKRA_BULLISH_PERCENT_INDEX_UPDATE; + public static MethodHandle WICKRA_BULLISH_PERCENT_INDEX_RESET; + public static MethodHandle WICKRA_BULLISH_PERCENT_INDEX_FREE; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_INDEX_NEW; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_INDEX_UPDATE; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_INDEX_RESET; + public static MethodHandle WICKRA_CUMULATIVE_VOLUME_INDEX_FREE; + public static MethodHandle WICKRA_HIGH_LOW_INDEX_NEW; + public static MethodHandle WICKRA_HIGH_LOW_INDEX_UPDATE; + public static MethodHandle WICKRA_HIGH_LOW_INDEX_RESET; + public static MethodHandle WICKRA_HIGH_LOW_INDEX_FREE; + public static MethodHandle WICKRA_MC_CLELLAN_OSCILLATOR_NEW; + public static MethodHandle WICKRA_MC_CLELLAN_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_MC_CLELLAN_OSCILLATOR_RESET; + public static MethodHandle WICKRA_MC_CLELLAN_OSCILLATOR_FREE; + public static MethodHandle WICKRA_MC_CLELLAN_SUMMATION_INDEX_NEW; + public static MethodHandle WICKRA_MC_CLELLAN_SUMMATION_INDEX_UPDATE; + public static MethodHandle WICKRA_MC_CLELLAN_SUMMATION_INDEX_RESET; + public static MethodHandle WICKRA_MC_CLELLAN_SUMMATION_INDEX_FREE; + public static MethodHandle WICKRA_NEW_HIGHS_NEW_LOWS_NEW; + public static MethodHandle WICKRA_NEW_HIGHS_NEW_LOWS_UPDATE; + public static MethodHandle WICKRA_NEW_HIGHS_NEW_LOWS_RESET; + public static MethodHandle WICKRA_NEW_HIGHS_NEW_LOWS_FREE; + public static MethodHandle WICKRA_PERCENT_ABOVE_MA_NEW; + public static MethodHandle WICKRA_PERCENT_ABOVE_MA_UPDATE; + public static MethodHandle WICKRA_PERCENT_ABOVE_MA_RESET; + public static MethodHandle WICKRA_PERCENT_ABOVE_MA_FREE; + public static MethodHandle WICKRA_TICK_INDEX_NEW; + public static MethodHandle WICKRA_TICK_INDEX_UPDATE; + public static MethodHandle WICKRA_TICK_INDEX_RESET; + public static MethodHandle WICKRA_TICK_INDEX_FREE; + public static MethodHandle WICKRA_TRIN_NEW; + public static MethodHandle WICKRA_TRIN_UPDATE; + public static MethodHandle WICKRA_TRIN_RESET; + public static MethodHandle WICKRA_TRIN_FREE; + public static MethodHandle WICKRA_UP_DOWN_VOLUME_RATIO_NEW; + public static MethodHandle WICKRA_UP_DOWN_VOLUME_RATIO_UPDATE; + public static MethodHandle WICKRA_UP_DOWN_VOLUME_RATIO_RESET; + public static MethodHandle WICKRA_UP_DOWN_VOLUME_RATIO_FREE; + public static MethodHandle WICKRA_ACCELERATION_BANDS_NEW; + public static MethodHandle WICKRA_ACCELERATION_BANDS_UPDATE; + public static MethodHandle WICKRA_ACCELERATION_BANDS_RESET; + public static MethodHandle WICKRA_ACCELERATION_BANDS_FREE; + public static MethodHandle WICKRA_ADX_NEW; + public static MethodHandle WICKRA_ADX_UPDATE; + public static MethodHandle WICKRA_ADX_RESET; + public static MethodHandle WICKRA_ADX_FREE; + public static MethodHandle WICKRA_ALLIGATOR_NEW; + public static MethodHandle WICKRA_ALLIGATOR_UPDATE; + public static MethodHandle WICKRA_ALLIGATOR_RESET; + public static MethodHandle WICKRA_ALLIGATOR_FREE; + public static MethodHandle WICKRA_ANDREWS_PITCHFORK_NEW; + public static MethodHandle WICKRA_ANDREWS_PITCHFORK_UPDATE; + public static MethodHandle WICKRA_ANDREWS_PITCHFORK_RESET; + public static MethodHandle WICKRA_ANDREWS_PITCHFORK_FREE; + public static MethodHandle WICKRA_AROON_NEW; + public static MethodHandle WICKRA_AROON_UPDATE; + public static MethodHandle WICKRA_AROON_RESET; + public static MethodHandle WICKRA_AROON_FREE; + public static MethodHandle WICKRA_ATR_BANDS_NEW; + public static MethodHandle WICKRA_ATR_BANDS_UPDATE; + public static MethodHandle WICKRA_ATR_BANDS_RESET; + public static MethodHandle WICKRA_ATR_BANDS_FREE; + public static MethodHandle WICKRA_ATR_RATCHET_NEW; + public static MethodHandle WICKRA_ATR_RATCHET_UPDATE; + public static MethodHandle WICKRA_ATR_RATCHET_RESET; + public static MethodHandle WICKRA_ATR_RATCHET_FREE; + public static MethodHandle WICKRA_AUTO_FIB_NEW; + public static MethodHandle WICKRA_AUTO_FIB_UPDATE; + public static MethodHandle WICKRA_AUTO_FIB_RESET; + public static MethodHandle WICKRA_AUTO_FIB_FREE; + public static MethodHandle WICKRA_BOLLINGER_BANDS_NEW; + public static MethodHandle WICKRA_BOLLINGER_BANDS_UPDATE; + public static MethodHandle WICKRA_BOLLINGER_BANDS_RESET; + public static MethodHandle WICKRA_BOLLINGER_BANDS_FREE; + public static MethodHandle WICKRA_BOMAR_BANDS_NEW; + public static MethodHandle WICKRA_BOMAR_BANDS_UPDATE; + public static MethodHandle WICKRA_BOMAR_BANDS_RESET; + public static MethodHandle WICKRA_BOMAR_BANDS_FREE; + public static MethodHandle WICKRA_CAMARILLA_NEW; + public static MethodHandle WICKRA_CAMARILLA_UPDATE; + public static MethodHandle WICKRA_CAMARILLA_RESET; + public static MethodHandle WICKRA_CAMARILLA_FREE; + public static MethodHandle WICKRA_CANDLE_VOLUME_NEW; + public static MethodHandle WICKRA_CANDLE_VOLUME_UPDATE; + public static MethodHandle WICKRA_CANDLE_VOLUME_RESET; + public static MethodHandle WICKRA_CANDLE_VOLUME_FREE; + public static MethodHandle WICKRA_CENTRAL_PIVOT_RANGE_NEW; + public static MethodHandle WICKRA_CENTRAL_PIVOT_RANGE_UPDATE; + public static MethodHandle WICKRA_CENTRAL_PIVOT_RANGE_RESET; + public static MethodHandle WICKRA_CENTRAL_PIVOT_RANGE_FREE; + public static MethodHandle WICKRA_CHANDE_KROLL_STOP_NEW; + public static MethodHandle WICKRA_CHANDE_KROLL_STOP_UPDATE; + public static MethodHandle WICKRA_CHANDE_KROLL_STOP_RESET; + public static MethodHandle WICKRA_CHANDE_KROLL_STOP_FREE; + public static MethodHandle WICKRA_CHANDELIER_EXIT_NEW; + public static MethodHandle WICKRA_CHANDELIER_EXIT_UPDATE; + public static MethodHandle WICKRA_CHANDELIER_EXIT_RESET; + public static MethodHandle WICKRA_CHANDELIER_EXIT_FREE; + public static MethodHandle WICKRA_CLASSIC_PIVOTS_NEW; + public static MethodHandle WICKRA_CLASSIC_PIVOTS_UPDATE; + public static MethodHandle WICKRA_CLASSIC_PIVOTS_RESET; + public static MethodHandle WICKRA_CLASSIC_PIVOTS_FREE; + public static MethodHandle WICKRA_COINTEGRATION_NEW; + public static MethodHandle WICKRA_COINTEGRATION_UPDATE; + public static MethodHandle WICKRA_COINTEGRATION_RESET; + public static MethodHandle WICKRA_COINTEGRATION_FREE; + public static MethodHandle WICKRA_COMPOSITE_PROFILE_NEW; + public static MethodHandle WICKRA_COMPOSITE_PROFILE_UPDATE; + public static MethodHandle WICKRA_COMPOSITE_PROFILE_RESET; + public static MethodHandle WICKRA_COMPOSITE_PROFILE_FREE; + public static MethodHandle WICKRA_DEMARK_PIVOTS_NEW; + public static MethodHandle WICKRA_DEMARK_PIVOTS_UPDATE; + public static MethodHandle WICKRA_DEMARK_PIVOTS_RESET; + public static MethodHandle WICKRA_DEMARK_PIVOTS_FREE; + public static MethodHandle WICKRA_DONCHIAN_NEW; + public static MethodHandle WICKRA_DONCHIAN_UPDATE; + public static MethodHandle WICKRA_DONCHIAN_RESET; + public static MethodHandle WICKRA_DONCHIAN_FREE; + public static MethodHandle WICKRA_DONCHIAN_STOP_NEW; + public static MethodHandle WICKRA_DONCHIAN_STOP_UPDATE; + public static MethodHandle WICKRA_DONCHIAN_STOP_RESET; + public static MethodHandle WICKRA_DONCHIAN_STOP_FREE; + public static MethodHandle WICKRA_DOUBLE_BOLLINGER_NEW; + public static MethodHandle WICKRA_DOUBLE_BOLLINGER_UPDATE; + public static MethodHandle WICKRA_DOUBLE_BOLLINGER_RESET; + public static MethodHandle WICKRA_DOUBLE_BOLLINGER_FREE; + public static MethodHandle WICKRA_ELDER_RAY_NEW; + public static MethodHandle WICKRA_ELDER_RAY_UPDATE; + public static MethodHandle WICKRA_ELDER_RAY_RESET; + public static MethodHandle WICKRA_ELDER_RAY_FREE; + public static MethodHandle WICKRA_ELDER_SAFE_ZONE_NEW; + public static MethodHandle WICKRA_ELDER_SAFE_ZONE_UPDATE; + public static MethodHandle WICKRA_ELDER_SAFE_ZONE_RESET; + public static MethodHandle WICKRA_ELDER_SAFE_ZONE_FREE; + public static MethodHandle WICKRA_EQUIVOLUME_NEW; + public static MethodHandle WICKRA_EQUIVOLUME_UPDATE; + public static MethodHandle WICKRA_EQUIVOLUME_RESET; + public static MethodHandle WICKRA_EQUIVOLUME_FREE; + public static MethodHandle WICKRA_FIB_ARCS_NEW; + public static MethodHandle WICKRA_FIB_ARCS_UPDATE; + public static MethodHandle WICKRA_FIB_ARCS_RESET; + public static MethodHandle WICKRA_FIB_ARCS_FREE; + public static MethodHandle WICKRA_FIB_CHANNEL_NEW; + public static MethodHandle WICKRA_FIB_CHANNEL_UPDATE; + public static MethodHandle WICKRA_FIB_CHANNEL_RESET; + public static MethodHandle WICKRA_FIB_CHANNEL_FREE; + public static MethodHandle WICKRA_FIB_CONFLUENCE_NEW; + public static MethodHandle WICKRA_FIB_CONFLUENCE_UPDATE; + public static MethodHandle WICKRA_FIB_CONFLUENCE_RESET; + public static MethodHandle WICKRA_FIB_CONFLUENCE_FREE; + public static MethodHandle WICKRA_FIB_EXTENSION_NEW; + public static MethodHandle WICKRA_FIB_EXTENSION_UPDATE; + public static MethodHandle WICKRA_FIB_EXTENSION_RESET; + public static MethodHandle WICKRA_FIB_EXTENSION_FREE; + public static MethodHandle WICKRA_FIB_FAN_NEW; + public static MethodHandle WICKRA_FIB_FAN_UPDATE; + public static MethodHandle WICKRA_FIB_FAN_RESET; + public static MethodHandle WICKRA_FIB_FAN_FREE; + public static MethodHandle WICKRA_FIB_PROJECTION_NEW; + public static MethodHandle WICKRA_FIB_PROJECTION_UPDATE; + public static MethodHandle WICKRA_FIB_PROJECTION_RESET; + public static MethodHandle WICKRA_FIB_PROJECTION_FREE; + public static MethodHandle WICKRA_FIB_RETRACEMENT_NEW; + public static MethodHandle WICKRA_FIB_RETRACEMENT_UPDATE; + public static MethodHandle WICKRA_FIB_RETRACEMENT_RESET; + public static MethodHandle WICKRA_FIB_RETRACEMENT_FREE; + public static MethodHandle WICKRA_FIB_TIME_ZONES_NEW; + public static MethodHandle WICKRA_FIB_TIME_ZONES_UPDATE; + public static MethodHandle WICKRA_FIB_TIME_ZONES_RESET; + public static MethodHandle WICKRA_FIB_TIME_ZONES_FREE; + public static MethodHandle WICKRA_FIBONACCI_PIVOTS_NEW; + public static MethodHandle WICKRA_FIBONACCI_PIVOTS_UPDATE; + public static MethodHandle WICKRA_FIBONACCI_PIVOTS_RESET; + public static MethodHandle WICKRA_FIBONACCI_PIVOTS_FREE; + public static MethodHandle WICKRA_FRACTAL_CHAOS_BANDS_NEW; + public static MethodHandle WICKRA_FRACTAL_CHAOS_BANDS_UPDATE; + public static MethodHandle WICKRA_FRACTAL_CHAOS_BANDS_RESET; + public static MethodHandle WICKRA_FRACTAL_CHAOS_BANDS_FREE; + public static MethodHandle WICKRA_GATOR_OSCILLATOR_NEW; + public static MethodHandle WICKRA_GATOR_OSCILLATOR_UPDATE; + public static MethodHandle WICKRA_GATOR_OSCILLATOR_RESET; + public static MethodHandle WICKRA_GATOR_OSCILLATOR_FREE; + public static MethodHandle WICKRA_GOLDEN_POCKET_NEW; + public static MethodHandle WICKRA_GOLDEN_POCKET_UPDATE; + public static MethodHandle WICKRA_GOLDEN_POCKET_RESET; + public static MethodHandle WICKRA_GOLDEN_POCKET_FREE; + public static MethodHandle WICKRA_HEIKIN_ASHI_NEW; + public static MethodHandle WICKRA_HEIKIN_ASHI_UPDATE; + public static MethodHandle WICKRA_HEIKIN_ASHI_RESET; + public static MethodHandle WICKRA_HEIKIN_ASHI_FREE; + public static MethodHandle WICKRA_HIGH_LOW_VOLUME_NODES_NEW; + public static MethodHandle WICKRA_HIGH_LOW_VOLUME_NODES_UPDATE; + public static MethodHandle WICKRA_HIGH_LOW_VOLUME_NODES_RESET; + public static MethodHandle WICKRA_HIGH_LOW_VOLUME_NODES_FREE; + public static MethodHandle WICKRA_HT_PHASOR_NEW; + public static MethodHandle WICKRA_HT_PHASOR_UPDATE; + public static MethodHandle WICKRA_HT_PHASOR_RESET; + public static MethodHandle WICKRA_HT_PHASOR_FREE; + public static MethodHandle WICKRA_HURST_CHANNEL_NEW; + public static MethodHandle WICKRA_HURST_CHANNEL_UPDATE; + public static MethodHandle WICKRA_HURST_CHANNEL_RESET; + public static MethodHandle WICKRA_HURST_CHANNEL_FREE; + public static MethodHandle WICKRA_ICHIMOKU_NEW; + public static MethodHandle WICKRA_ICHIMOKU_UPDATE; + public static MethodHandle WICKRA_ICHIMOKU_RESET; + public static MethodHandle WICKRA_ICHIMOKU_FREE; + public static MethodHandle WICKRA_INITIAL_BALANCE_NEW; + public static MethodHandle WICKRA_INITIAL_BALANCE_UPDATE; + public static MethodHandle WICKRA_INITIAL_BALANCE_RESET; + public static MethodHandle WICKRA_INITIAL_BALANCE_FREE; + public static MethodHandle WICKRA_KALMAN_HEDGE_RATIO_NEW; + public static MethodHandle WICKRA_KALMAN_HEDGE_RATIO_UPDATE; + public static MethodHandle WICKRA_KALMAN_HEDGE_RATIO_RESET; + public static MethodHandle WICKRA_KALMAN_HEDGE_RATIO_FREE; + public static MethodHandle WICKRA_KASE_DEV_STOP_NEW; + public static MethodHandle WICKRA_KASE_DEV_STOP_UPDATE; + public static MethodHandle WICKRA_KASE_DEV_STOP_RESET; + public static MethodHandle WICKRA_KASE_DEV_STOP_FREE; + public static MethodHandle WICKRA_KASE_PERMISSION_STOCHASTIC_NEW; + public static MethodHandle WICKRA_KASE_PERMISSION_STOCHASTIC_UPDATE; + public static MethodHandle WICKRA_KASE_PERMISSION_STOCHASTIC_RESET; + public static MethodHandle WICKRA_KASE_PERMISSION_STOCHASTIC_FREE; + public static MethodHandle WICKRA_KELTNER_NEW; + public static MethodHandle WICKRA_KELTNER_UPDATE; + public static MethodHandle WICKRA_KELTNER_RESET; + public static MethodHandle WICKRA_KELTNER_FREE; + public static MethodHandle WICKRA_KST_NEW; + public static MethodHandle WICKRA_KST_UPDATE; + public static MethodHandle WICKRA_KST_RESET; + public static MethodHandle WICKRA_KST_FREE; + public static MethodHandle WICKRA_LEAD_LAG_CROSS_CORRELATION_NEW; + public static MethodHandle WICKRA_LEAD_LAG_CROSS_CORRELATION_UPDATE; + public static MethodHandle WICKRA_LEAD_LAG_CROSS_CORRELATION_RESET; + public static MethodHandle WICKRA_LEAD_LAG_CROSS_CORRELATION_FREE; + public static MethodHandle WICKRA_LIN_REG_CHANNEL_NEW; + public static MethodHandle WICKRA_LIN_REG_CHANNEL_UPDATE; + public static MethodHandle WICKRA_LIN_REG_CHANNEL_RESET; + public static MethodHandle WICKRA_LIN_REG_CHANNEL_FREE; + public static MethodHandle WICKRA_LIQUIDATION_FEATURES_NEW; + public static MethodHandle WICKRA_LIQUIDATION_FEATURES_UPDATE; + public static MethodHandle WICKRA_LIQUIDATION_FEATURES_RESET; + public static MethodHandle WICKRA_LIQUIDATION_FEATURES_FREE; + public static MethodHandle WICKRA_MA_ENVELOPE_NEW; + public static MethodHandle WICKRA_MA_ENVELOPE_UPDATE; + public static MethodHandle WICKRA_MA_ENVELOPE_RESET; + public static MethodHandle WICKRA_MA_ENVELOPE_FREE; + public static MethodHandle WICKRA_MACD_INDICATOR_NEW; + public static MethodHandle WICKRA_MACD_INDICATOR_UPDATE; + public static MethodHandle WICKRA_MACD_INDICATOR_RESET; + public static MethodHandle WICKRA_MACD_INDICATOR_FREE; + public static MethodHandle WICKRA_MACD_FIX_NEW; + public static MethodHandle WICKRA_MACD_FIX_UPDATE; + public static MethodHandle WICKRA_MACD_FIX_RESET; + public static MethodHandle WICKRA_MACD_FIX_FREE; + public static MethodHandle WICKRA_MAMA_NEW; + public static MethodHandle WICKRA_MAMA_UPDATE; + public static MethodHandle WICKRA_MAMA_RESET; + public static MethodHandle WICKRA_MAMA_FREE; + public static MethodHandle WICKRA_MEDIAN_CHANNEL_NEW; + public static MethodHandle WICKRA_MEDIAN_CHANNEL_UPDATE; + public static MethodHandle WICKRA_MEDIAN_CHANNEL_RESET; + public static MethodHandle WICKRA_MEDIAN_CHANNEL_FREE; + public static MethodHandle WICKRA_MODIFIED_MA_STOP_NEW; + public static MethodHandle WICKRA_MODIFIED_MA_STOP_UPDATE; + public static MethodHandle WICKRA_MODIFIED_MA_STOP_RESET; + public static MethodHandle WICKRA_MODIFIED_MA_STOP_FREE; + public static MethodHandle WICKRA_MURREY_MATH_LINES_NEW; + public static MethodHandle WICKRA_MURREY_MATH_LINES_UPDATE; + public static MethodHandle WICKRA_MURREY_MATH_LINES_RESET; + public static MethodHandle WICKRA_MURREY_MATH_LINES_FREE; + public static MethodHandle WICKRA_NRTR_NEW; + public static MethodHandle WICKRA_NRTR_UPDATE; + public static MethodHandle WICKRA_NRTR_RESET; + public static MethodHandle WICKRA_NRTR_FREE; + public static MethodHandle WICKRA_OPENING_RANGE_NEW; + public static MethodHandle WICKRA_OPENING_RANGE_UPDATE; + public static MethodHandle WICKRA_OPENING_RANGE_RESET; + public static MethodHandle WICKRA_OPENING_RANGE_FREE; + public static MethodHandle WICKRA_OVERNIGHT_INTRADAY_RETURN_NEW; + public static MethodHandle WICKRA_OVERNIGHT_INTRADAY_RETURN_UPDATE; + public static MethodHandle WICKRA_OVERNIGHT_INTRADAY_RETURN_RESET; + public static MethodHandle WICKRA_OVERNIGHT_INTRADAY_RETURN_FREE; + public static MethodHandle WICKRA_PROJECTION_BANDS_NEW; + public static MethodHandle WICKRA_PROJECTION_BANDS_UPDATE; + public static MethodHandle WICKRA_PROJECTION_BANDS_RESET; + public static MethodHandle WICKRA_PROJECTION_BANDS_FREE; + public static MethodHandle WICKRA_QQE_NEW; + public static MethodHandle WICKRA_QQE_UPDATE; + public static MethodHandle WICKRA_QQE_RESET; + public static MethodHandle WICKRA_QQE_FREE; + public static MethodHandle WICKRA_QUARTILE_BANDS_NEW; + public static MethodHandle WICKRA_QUARTILE_BANDS_UPDATE; + public static MethodHandle WICKRA_QUARTILE_BANDS_RESET; + public static MethodHandle WICKRA_QUARTILE_BANDS_FREE; + public static MethodHandle WICKRA_RELATIVE_STRENGTH_AB_NEW; + public static MethodHandle WICKRA_RELATIVE_STRENGTH_AB_UPDATE; + public static MethodHandle WICKRA_RELATIVE_STRENGTH_AB_RESET; + public static MethodHandle WICKRA_RELATIVE_STRENGTH_AB_FREE; + public static MethodHandle WICKRA_RWI_NEW; + public static MethodHandle WICKRA_RWI_UPDATE; + public static MethodHandle WICKRA_RWI_RESET; + public static MethodHandle WICKRA_RWI_FREE; + public static MethodHandle WICKRA_SESSION_HIGH_LOW_NEW; + public static MethodHandle WICKRA_SESSION_HIGH_LOW_UPDATE; + public static MethodHandle WICKRA_SESSION_HIGH_LOW_RESET; + public static MethodHandle WICKRA_SESSION_HIGH_LOW_FREE; + public static MethodHandle WICKRA_SESSION_RANGE_NEW; + public static MethodHandle WICKRA_SESSION_RANGE_UPDATE; + public static MethodHandle WICKRA_SESSION_RANGE_RESET; + public static MethodHandle WICKRA_SESSION_RANGE_FREE; + public static MethodHandle WICKRA_SMOOTHED_HEIKIN_ASHI_NEW; + public static MethodHandle WICKRA_SMOOTHED_HEIKIN_ASHI_UPDATE; + public static MethodHandle WICKRA_SMOOTHED_HEIKIN_ASHI_RESET; + public static MethodHandle WICKRA_SMOOTHED_HEIKIN_ASHI_FREE; + public static MethodHandle WICKRA_SPREAD_BOLLINGER_BANDS_NEW; + public static MethodHandle WICKRA_SPREAD_BOLLINGER_BANDS_UPDATE; + public static MethodHandle WICKRA_SPREAD_BOLLINGER_BANDS_RESET; + public static MethodHandle WICKRA_SPREAD_BOLLINGER_BANDS_FREE; + public static MethodHandle WICKRA_STANDARD_ERROR_BANDS_NEW; + public static MethodHandle WICKRA_STANDARD_ERROR_BANDS_UPDATE; + public static MethodHandle WICKRA_STANDARD_ERROR_BANDS_RESET; + public static MethodHandle WICKRA_STANDARD_ERROR_BANDS_FREE; + public static MethodHandle WICKRA_STARC_BANDS_NEW; + public static MethodHandle WICKRA_STARC_BANDS_UPDATE; + public static MethodHandle WICKRA_STARC_BANDS_RESET; + public static MethodHandle WICKRA_STARC_BANDS_FREE; + public static MethodHandle WICKRA_STOCHASTIC_NEW; + public static MethodHandle WICKRA_STOCHASTIC_UPDATE; + public static MethodHandle WICKRA_STOCHASTIC_RESET; + public static MethodHandle WICKRA_STOCHASTIC_FREE; + public static MethodHandle WICKRA_SUPER_TREND_NEW; + public static MethodHandle WICKRA_SUPER_TREND_UPDATE; + public static MethodHandle WICKRA_SUPER_TREND_RESET; + public static MethodHandle WICKRA_SUPER_TREND_FREE; + public static MethodHandle WICKRA_TD_LINES_NEW; + public static MethodHandle WICKRA_TD_LINES_UPDATE; + public static MethodHandle WICKRA_TD_LINES_RESET; + public static MethodHandle WICKRA_TD_LINES_FREE; + public static MethodHandle WICKRA_TD_MOVING_AVERAGE_NEW; + public static MethodHandle WICKRA_TD_MOVING_AVERAGE_UPDATE; + public static MethodHandle WICKRA_TD_MOVING_AVERAGE_RESET; + public static MethodHandle WICKRA_TD_MOVING_AVERAGE_FREE; + public static MethodHandle WICKRA_TD_RANGE_PROJECTION_NEW; + public static MethodHandle WICKRA_TD_RANGE_PROJECTION_UPDATE; + public static MethodHandle WICKRA_TD_RANGE_PROJECTION_RESET; + public static MethodHandle WICKRA_TD_RANGE_PROJECTION_FREE; + public static MethodHandle WICKRA_TD_RISK_LEVEL_NEW; + public static MethodHandle WICKRA_TD_RISK_LEVEL_UPDATE; + public static MethodHandle WICKRA_TD_RISK_LEVEL_RESET; + public static MethodHandle WICKRA_TD_RISK_LEVEL_FREE; + public static MethodHandle WICKRA_TD_SEQUENTIAL_NEW; + public static MethodHandle WICKRA_TD_SEQUENTIAL_UPDATE; + public static MethodHandle WICKRA_TD_SEQUENTIAL_RESET; + public static MethodHandle WICKRA_TD_SEQUENTIAL_FREE; + public static MethodHandle WICKRA_TTM_SQUEEZE_NEW; + public static MethodHandle WICKRA_TTM_SQUEEZE_UPDATE; + public static MethodHandle WICKRA_TTM_SQUEEZE_RESET; + public static MethodHandle WICKRA_TTM_SQUEEZE_FREE; + public static MethodHandle WICKRA_VALUE_AREA_NEW; + public static MethodHandle WICKRA_VALUE_AREA_UPDATE; + public static MethodHandle WICKRA_VALUE_AREA_RESET; + public static MethodHandle WICKRA_VALUE_AREA_FREE; + public static MethodHandle WICKRA_VOLATILITY_CONE_NEW; + public static MethodHandle WICKRA_VOLATILITY_CONE_UPDATE; + public static MethodHandle WICKRA_VOLATILITY_CONE_RESET; + public static MethodHandle WICKRA_VOLATILITY_CONE_FREE; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_MACD_NEW; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_MACD_UPDATE; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_MACD_RESET; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_MACD_FREE; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_SR_NEW; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_SR_UPDATE; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_SR_RESET; + public static MethodHandle WICKRA_VOLUME_WEIGHTED_SR_FREE; + public static MethodHandle WICKRA_VORTEX_NEW; + public static MethodHandle WICKRA_VORTEX_UPDATE; + public static MethodHandle WICKRA_VORTEX_RESET; + public static MethodHandle WICKRA_VORTEX_FREE; + public static MethodHandle WICKRA_VWAP_STD_DEV_BANDS_NEW; + public static MethodHandle WICKRA_VWAP_STD_DEV_BANDS_UPDATE; + public static MethodHandle WICKRA_VWAP_STD_DEV_BANDS_RESET; + public static MethodHandle WICKRA_VWAP_STD_DEV_BANDS_FREE; + public static MethodHandle WICKRA_WAVE_TREND_NEW; + public static MethodHandle WICKRA_WAVE_TREND_UPDATE; + public static MethodHandle WICKRA_WAVE_TREND_RESET; + public static MethodHandle WICKRA_WAVE_TREND_FREE; + public static MethodHandle WICKRA_WILLIAMS_FRACTALS_NEW; + public static MethodHandle WICKRA_WILLIAMS_FRACTALS_UPDATE; + public static MethodHandle WICKRA_WILLIAMS_FRACTALS_RESET; + public static MethodHandle WICKRA_WILLIAMS_FRACTALS_FREE; + public static MethodHandle WICKRA_WOODIE_PIVOTS_NEW; + public static MethodHandle WICKRA_WOODIE_PIVOTS_UPDATE; + public static MethodHandle WICKRA_WOODIE_PIVOTS_RESET; + public static MethodHandle WICKRA_WOODIE_PIVOTS_FREE; + public static MethodHandle WICKRA_ZERO_LAG_MACD_NEW; + public static MethodHandle WICKRA_ZERO_LAG_MACD_UPDATE; + public static MethodHandle WICKRA_ZERO_LAG_MACD_RESET; + public static MethodHandle WICKRA_ZERO_LAG_MACD_FREE; + public static MethodHandle WICKRA_ZIG_ZAG_NEW; + public static MethodHandle WICKRA_ZIG_ZAG_UPDATE; + public static MethodHandle WICKRA_ZIG_ZAG_RESET; + public static MethodHandle WICKRA_ZIG_ZAG_FREE; + public static MethodHandle WICKRA_DAY_OF_WEEK_PROFILE_NEW; + public static MethodHandle WICKRA_DAY_OF_WEEK_PROFILE_UPDATE; + public static MethodHandle WICKRA_DAY_OF_WEEK_PROFILE_RESET; + public static MethodHandle WICKRA_DAY_OF_WEEK_PROFILE_FREE; + public static MethodHandle WICKRA_INTRADAY_VOLATILITY_PROFILE_NEW; + public static MethodHandle WICKRA_INTRADAY_VOLATILITY_PROFILE_UPDATE; + public static MethodHandle WICKRA_INTRADAY_VOLATILITY_PROFILE_RESET; + public static MethodHandle WICKRA_INTRADAY_VOLATILITY_PROFILE_FREE; + public static MethodHandle WICKRA_TIME_OF_DAY_RETURN_PROFILE_NEW; + public static MethodHandle WICKRA_TIME_OF_DAY_RETURN_PROFILE_UPDATE; + public static MethodHandle WICKRA_TIME_OF_DAY_RETURN_PROFILE_RESET; + public static MethodHandle WICKRA_TIME_OF_DAY_RETURN_PROFILE_FREE; + public static MethodHandle WICKRA_TPO_PROFILE_NEW; + public static MethodHandle WICKRA_TPO_PROFILE_UPDATE; + public static MethodHandle WICKRA_TPO_PROFILE_RESET; + public static MethodHandle WICKRA_TPO_PROFILE_FREE; + public static MethodHandle WICKRA_VOLUME_BY_TIME_PROFILE_NEW; + public static MethodHandle WICKRA_VOLUME_BY_TIME_PROFILE_UPDATE; + public static MethodHandle WICKRA_VOLUME_BY_TIME_PROFILE_RESET; + public static MethodHandle WICKRA_VOLUME_BY_TIME_PROFILE_FREE; + public static MethodHandle WICKRA_VOLUME_PROFILE_NEW; + public static MethodHandle WICKRA_VOLUME_PROFILE_UPDATE; + public static MethodHandle WICKRA_VOLUME_PROFILE_RESET; + public static MethodHandle WICKRA_VOLUME_PROFILE_FREE; + public static MethodHandle WICKRA_DOLLAR_BARS_NEW; + public static MethodHandle WICKRA_DOLLAR_BARS_UPDATE; + public static MethodHandle WICKRA_DOLLAR_BARS_RESET; + public static MethodHandle WICKRA_DOLLAR_BARS_FREE; + public static MethodHandle WICKRA_IMBALANCE_BARS_NEW; + public static MethodHandle WICKRA_IMBALANCE_BARS_UPDATE; + public static MethodHandle WICKRA_IMBALANCE_BARS_RESET; + public static MethodHandle WICKRA_IMBALANCE_BARS_FREE; + public static MethodHandle WICKRA_KAGI_BARS_NEW; + public static MethodHandle WICKRA_KAGI_BARS_UPDATE; + public static MethodHandle WICKRA_KAGI_BARS_RESET; + public static MethodHandle WICKRA_KAGI_BARS_FREE; + public static MethodHandle WICKRA_POINT_AND_FIGURE_BARS_NEW; + public static MethodHandle WICKRA_POINT_AND_FIGURE_BARS_UPDATE; + public static MethodHandle WICKRA_POINT_AND_FIGURE_BARS_RESET; + public static MethodHandle WICKRA_POINT_AND_FIGURE_BARS_FREE; + public static MethodHandle WICKRA_RANGE_BARS_NEW; + public static MethodHandle WICKRA_RANGE_BARS_UPDATE; + public static MethodHandle WICKRA_RANGE_BARS_RESET; + public static MethodHandle WICKRA_RANGE_BARS_FREE; + public static MethodHandle WICKRA_RENKO_BARS_NEW; + public static MethodHandle WICKRA_RENKO_BARS_UPDATE; + public static MethodHandle WICKRA_RENKO_BARS_RESET; + public static MethodHandle WICKRA_RENKO_BARS_FREE; + public static MethodHandle WICKRA_RUN_BARS_NEW; + public static MethodHandle WICKRA_RUN_BARS_UPDATE; + public static MethodHandle WICKRA_RUN_BARS_RESET; + public static MethodHandle WICKRA_RUN_BARS_FREE; + public static MethodHandle WICKRA_THREE_LINE_BREAK_BARS_NEW; + public static MethodHandle WICKRA_THREE_LINE_BREAK_BARS_UPDATE; + public static MethodHandle WICKRA_THREE_LINE_BREAK_BARS_RESET; + public static MethodHandle WICKRA_THREE_LINE_BREAK_BARS_FREE; + public static MethodHandle WICKRA_TICK_BARS_NEW; + public static MethodHandle WICKRA_TICK_BARS_UPDATE; + public static MethodHandle WICKRA_TICK_BARS_RESET; + public static MethodHandle WICKRA_TICK_BARS_FREE; + public static MethodHandle WICKRA_VOLUME_BARS_NEW; + public static MethodHandle WICKRA_VOLUME_BARS_UPDATE; + public static MethodHandle WICKRA_VOLUME_BARS_RESET; + public static MethodHandle WICKRA_VOLUME_BARS_FREE; + public static MethodHandle WICKRA_MACD_EXT_NEW; + public static MethodHandle WICKRA_MACD_EXT_UPDATE; + public static MethodHandle WICKRA_MACD_EXT_RESET; + public static MethodHandle WICKRA_MACD_EXT_FREE; + public static MethodHandle WICKRA_FOOTPRINT_NEW; + public static MethodHandle WICKRA_FOOTPRINT_UPDATE; + public static MethodHandle WICKRA_FOOTPRINT_RESET; + public static MethodHandle WICKRA_FOOTPRINT_FREE; + + static { + init0(); + init1(); + init2(); + init3(); + init4(); + init5(); + init6(); + init7(); + init8(); + init9(); + init10(); + init11(); + init12(); + init13(); + init14(); + init15(); + init16(); + init17(); + init18(); + init19(); + init20(); + } + + private static void init0() { + WICKRA_ADAPTIVE_CYCLE_NEW = h("wickra_adaptive_cycle_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ADAPTIVE_CYCLE_UPDATE = h("wickra_adaptive_cycle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ADAPTIVE_CYCLE_BATCH = h("wickra_adaptive_cycle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_CYCLE_RESET = h("wickra_adaptive_cycle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_CYCLE_FREE = h("wickra_adaptive_cycle_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_LAGUERRE_FILTER_NEW = h("wickra_adaptive_laguerre_filter_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_LAGUERRE_FILTER_UPDATE = h("wickra_adaptive_laguerre_filter_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ADAPTIVE_LAGUERRE_FILTER_BATCH = h("wickra_adaptive_laguerre_filter_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_LAGUERRE_FILTER_RESET = h("wickra_adaptive_laguerre_filter_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_LAGUERRE_FILTER_FREE = h("wickra_adaptive_laguerre_filter_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_RSI_NEW = h("wickra_adaptive_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_RSI_UPDATE = h("wickra_adaptive_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ADAPTIVE_RSI_BATCH = h("wickra_adaptive_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_RSI_RESET = h("wickra_adaptive_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_RSI_FREE = h("wickra_adaptive_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALMA_NEW = h("wickra_alma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_ALMA_UPDATE = h("wickra_alma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ALMA_BATCH = h("wickra_alma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ALMA_RESET = h("wickra_alma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALMA_FREE = h("wickra_alma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANCHORED_RSI_NEW = h("wickra_anchored_rsi_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ANCHORED_RSI_UPDATE = h("wickra_anchored_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ANCHORED_RSI_BATCH = h("wickra_anchored_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ANCHORED_RSI_RESET = h("wickra_anchored_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANCHORED_RSI_FREE = h("wickra_anchored_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_APO_NEW = h("wickra_apo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_APO_UPDATE = h("wickra_apo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_APO_BATCH = h("wickra_apo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_APO_RESET = h("wickra_apo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_APO_FREE = h("wickra_apo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTOCORRELATION_NEW = h("wickra_autocorrelation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_AUTOCORRELATION_UPDATE = h("wickra_autocorrelation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_AUTOCORRELATION_BATCH = h("wickra_autocorrelation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AUTOCORRELATION_RESET = h("wickra_autocorrelation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTOCORRELATION_FREE = h("wickra_autocorrelation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTOCORRELATION_PERIODOGRAM_NEW = h("wickra_autocorrelation_periodogram_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_AUTOCORRELATION_PERIODOGRAM_UPDATE = h("wickra_autocorrelation_periodogram_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_AUTOCORRELATION_PERIODOGRAM_BATCH = h("wickra_autocorrelation_periodogram_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AUTOCORRELATION_PERIODOGRAM_RESET = h("wickra_autocorrelation_periodogram_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTOCORRELATION_PERIODOGRAM_FREE = h("wickra_autocorrelation_periodogram_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVERAGE_DRAWDOWN_NEW = h("wickra_average_drawdown_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_AVERAGE_DRAWDOWN_UPDATE = h("wickra_average_drawdown_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_AVERAGE_DRAWDOWN_BATCH = h("wickra_average_drawdown_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AVERAGE_DRAWDOWN_RESET = h("wickra_average_drawdown_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVERAGE_DRAWDOWN_FREE = h("wickra_average_drawdown_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BANDPASS_FILTER_NEW = h("wickra_bandpass_filter_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_BANDPASS_FILTER_UPDATE = h("wickra_bandpass_filter_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_BANDPASS_FILTER_BATCH = h("wickra_bandpass_filter_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BANDPASS_FILTER_RESET = h("wickra_bandpass_filter_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BANDPASS_FILTER_FREE = h("wickra_bandpass_filter_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BIPOWER_VARIATION_NEW = h("wickra_bipower_variation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BIPOWER_VARIATION_UPDATE = h("wickra_bipower_variation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_BIPOWER_VARIATION_BATCH = h("wickra_bipower_variation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BIPOWER_VARIATION_RESET = h("wickra_bipower_variation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BIPOWER_VARIATION_FREE = h("wickra_bipower_variation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOLLINGER_BANDWIDTH_NEW = h("wickra_bollinger_bandwidth_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_BOLLINGER_BANDWIDTH_UPDATE = h("wickra_bollinger_bandwidth_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_BOLLINGER_BANDWIDTH_BATCH = h("wickra_bollinger_bandwidth_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BOLLINGER_BANDWIDTH_RESET = h("wickra_bollinger_bandwidth_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOLLINGER_BANDWIDTH_FREE = h("wickra_bollinger_bandwidth_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BURKE_RATIO_NEW = h("wickra_burke_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BURKE_RATIO_UPDATE = h("wickra_burke_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_BURKE_RATIO_BATCH = h("wickra_burke_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BURKE_RATIO_RESET = h("wickra_burke_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BURKE_RATIO_FREE = h("wickra_burke_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CALMAR_RATIO_NEW = h("wickra_calmar_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CALMAR_RATIO_UPDATE = h("wickra_calmar_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CALMAR_RATIO_BATCH = h("wickra_calmar_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CALMAR_RATIO_RESET = h("wickra_calmar_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CALMAR_RATIO_FREE = h("wickra_calmar_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CENTER_OF_GRAVITY_NEW = h("wickra_center_of_gravity_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CENTER_OF_GRAVITY_UPDATE = h("wickra_center_of_gravity_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CENTER_OF_GRAVITY_BATCH = h("wickra_center_of_gravity_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CENTER_OF_GRAVITY_RESET = h("wickra_center_of_gravity_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CENTER_OF_GRAVITY_FREE = h("wickra_center_of_gravity_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CFO_NEW = h("wickra_cfo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CFO_UPDATE = h("wickra_cfo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CFO_BATCH = h("wickra_cfo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CFO_RESET = h("wickra_cfo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CFO_FREE = h("wickra_cfo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CMO_NEW = h("wickra_cmo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CMO_UPDATE = h("wickra_cmo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CMO_BATCH = h("wickra_cmo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CMO_RESET = h("wickra_cmo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CMO_FREE = h("wickra_cmo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COEFFICIENT_OF_VARIATION_NEW = h("wickra_coefficient_of_variation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_COEFFICIENT_OF_VARIATION_UPDATE = h("wickra_coefficient_of_variation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_COEFFICIENT_OF_VARIATION_BATCH = h("wickra_coefficient_of_variation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_COEFFICIENT_OF_VARIATION_RESET = h("wickra_coefficient_of_variation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COEFFICIENT_OF_VARIATION_FREE = h("wickra_coefficient_of_variation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COMMON_SENSE_RATIO_NEW = h("wickra_common_sense_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_COMMON_SENSE_RATIO_UPDATE = h("wickra_common_sense_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_COMMON_SENSE_RATIO_BATCH = h("wickra_common_sense_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_COMMON_SENSE_RATIO_RESET = h("wickra_common_sense_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COMMON_SENSE_RATIO_FREE = h("wickra_common_sense_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONDITIONAL_VALUE_AT_RISK_NEW = h("wickra_conditional_value_at_risk_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_CONDITIONAL_VALUE_AT_RISK_UPDATE = h("wickra_conditional_value_at_risk_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CONDITIONAL_VALUE_AT_RISK_BATCH = h("wickra_conditional_value_at_risk_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CONDITIONAL_VALUE_AT_RISK_RESET = h("wickra_conditional_value_at_risk_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONDITIONAL_VALUE_AT_RISK_FREE = h("wickra_conditional_value_at_risk_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONNORS_RSI_NEW = h("wickra_connors_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_CONNORS_RSI_UPDATE = h("wickra_connors_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CONNORS_RSI_BATCH = h("wickra_connors_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CONNORS_RSI_RESET = h("wickra_connors_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONNORS_RSI_FREE = h("wickra_connors_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COPPOCK_NEW = h("wickra_coppock_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_COPPOCK_UPDATE = h("wickra_coppock_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_COPPOCK_BATCH = h("wickra_coppock_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_COPPOCK_RESET = h("wickra_coppock_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COPPOCK_FREE = h("wickra_coppock_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CORRELATION_TREND_INDICATOR_NEW = h("wickra_correlation_trend_indicator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CORRELATION_TREND_INDICATOR_UPDATE = h("wickra_correlation_trend_indicator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CORRELATION_TREND_INDICATOR_BATCH = h("wickra_correlation_trend_indicator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CORRELATION_TREND_INDICATOR_RESET = h("wickra_correlation_trend_indicator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CORRELATION_TREND_INDICATOR_FREE = h("wickra_correlation_trend_indicator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CYBERNETIC_CYCLE_NEW = h("wickra_cybernetic_cycle_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CYBERNETIC_CYCLE_UPDATE = h("wickra_cybernetic_cycle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_CYBERNETIC_CYCLE_BATCH = h("wickra_cybernetic_cycle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CYBERNETIC_CYCLE_RESET = h("wickra_cybernetic_cycle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CYBERNETIC_CYCLE_FREE = h("wickra_cybernetic_cycle_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init1() { + WICKRA_DECYCLER_NEW = h("wickra_decycler_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DECYCLER_UPDATE = h("wickra_decycler_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DECYCLER_BATCH = h("wickra_decycler_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DECYCLER_RESET = h("wickra_decycler_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DECYCLER_FREE = h("wickra_decycler_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DECYCLER_OSCILLATOR_NEW = h("wickra_decycler_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_DECYCLER_OSCILLATOR_UPDATE = h("wickra_decycler_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DECYCLER_OSCILLATOR_BATCH = h("wickra_decycler_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DECYCLER_OSCILLATOR_RESET = h("wickra_decycler_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DECYCLER_OSCILLATOR_FREE = h("wickra_decycler_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMA_NEW = h("wickra_dema_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DEMA_UPDATE = h("wickra_dema_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DEMA_BATCH = h("wickra_dema_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DEMA_RESET = h("wickra_dema_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMA_FREE = h("wickra_dema_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DERIVATIVE_OSCILLATOR_NEW = h("wickra_derivative_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_DERIVATIVE_OSCILLATOR_UPDATE = h("wickra_derivative_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DERIVATIVE_OSCILLATOR_BATCH = h("wickra_derivative_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DERIVATIVE_OSCILLATOR_RESET = h("wickra_derivative_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DERIVATIVE_OSCILLATOR_FREE = h("wickra_derivative_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DETRENDED_STD_DEV_NEW = h("wickra_detrended_std_dev_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DETRENDED_STD_DEV_UPDATE = h("wickra_detrended_std_dev_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DETRENDED_STD_DEV_BATCH = h("wickra_detrended_std_dev_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DETRENDED_STD_DEV_RESET = h("wickra_detrended_std_dev_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DETRENDED_STD_DEV_FREE = h("wickra_detrended_std_dev_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DISPARITY_INDEX_NEW = h("wickra_disparity_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DISPARITY_INDEX_UPDATE = h("wickra_disparity_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DISPARITY_INDEX_BATCH = h("wickra_disparity_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DISPARITY_INDEX_RESET = h("wickra_disparity_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DISPARITY_INDEX_FREE = h("wickra_disparity_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DPO_NEW = h("wickra_dpo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DPO_UPDATE = h("wickra_dpo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DPO_BATCH = h("wickra_dpo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DPO_RESET = h("wickra_dpo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DPO_FREE = h("wickra_dpo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DRAWDOWN_DURATION_NEW = h("wickra_drawdown_duration_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DRAWDOWN_DURATION_UPDATE = h("wickra_drawdown_duration_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DRAWDOWN_DURATION_BATCH = h("wickra_drawdown_duration_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DRAWDOWN_DURATION_RESET = h("wickra_drawdown_duration_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DRAWDOWN_DURATION_FREE = h("wickra_drawdown_duration_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DYNAMIC_MOMENTUM_INDEX_NEW = h("wickra_dynamic_momentum_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DYNAMIC_MOMENTUM_INDEX_UPDATE = h("wickra_dynamic_momentum_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_DYNAMIC_MOMENTUM_INDEX_BATCH = h("wickra_dynamic_momentum_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DYNAMIC_MOMENTUM_INDEX_RESET = h("wickra_dynamic_momentum_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DYNAMIC_MOMENTUM_INDEX_FREE = h("wickra_dynamic_momentum_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EHLERS_STOCHASTIC_NEW = h("wickra_ehlers_stochastic_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EHLERS_STOCHASTIC_UPDATE = h("wickra_ehlers_stochastic_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EHLERS_STOCHASTIC_BATCH = h("wickra_ehlers_stochastic_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EHLERS_STOCHASTIC_RESET = h("wickra_ehlers_stochastic_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EHLERS_STOCHASTIC_FREE = h("wickra_ehlers_stochastic_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EHMA_NEW = h("wickra_ehma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EHMA_UPDATE = h("wickra_ehma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EHMA_BATCH = h("wickra_ehma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EHMA_RESET = h("wickra_ehma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EHMA_FREE = h("wickra_ehma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_IMPULSE_NEW = h("wickra_elder_impulse_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ELDER_IMPULSE_UPDATE = h("wickra_elder_impulse_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ELDER_IMPULSE_BATCH = h("wickra_elder_impulse_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ELDER_IMPULSE_RESET = h("wickra_elder_impulse_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_IMPULSE_FREE = h("wickra_elder_impulse_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EMA_NEW = h("wickra_ema_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EMA_UPDATE = h("wickra_ema_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EMA_BATCH = h("wickra_ema_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EMA_RESET = h("wickra_ema_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EMA_FREE = h("wickra_ema_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EMPIRICAL_MODE_DECOMPOSITION_NEW = h("wickra_empirical_mode_decomposition_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_EMPIRICAL_MODE_DECOMPOSITION_UPDATE = h("wickra_empirical_mode_decomposition_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EMPIRICAL_MODE_DECOMPOSITION_BATCH = h("wickra_empirical_mode_decomposition_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EMPIRICAL_MODE_DECOMPOSITION_RESET = h("wickra_empirical_mode_decomposition_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EMPIRICAL_MODE_DECOMPOSITION_FREE = h("wickra_empirical_mode_decomposition_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EVEN_BETTER_SINEWAVE_NEW = h("wickra_even_better_sinewave_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_EVEN_BETTER_SINEWAVE_UPDATE = h("wickra_even_better_sinewave_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EVEN_BETTER_SINEWAVE_BATCH = h("wickra_even_better_sinewave_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EVEN_BETTER_SINEWAVE_RESET = h("wickra_even_better_sinewave_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EVEN_BETTER_SINEWAVE_FREE = h("wickra_even_better_sinewave_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EWMA_VOLATILITY_NEW = h("wickra_ewma_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_EWMA_VOLATILITY_UPDATE = h("wickra_ewma_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EWMA_VOLATILITY_BATCH = h("wickra_ewma_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EWMA_VOLATILITY_RESET = h("wickra_ewma_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EWMA_VOLATILITY_FREE = h("wickra_ewma_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EXPECTANCY_NEW = h("wickra_expectancy_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EXPECTANCY_UPDATE = h("wickra_expectancy_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_EXPECTANCY_BATCH = h("wickra_expectancy_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EXPECTANCY_RESET = h("wickra_expectancy_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EXPECTANCY_FREE = h("wickra_expectancy_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FAMA_NEW = h("wickra_fama_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_FAMA_UPDATE = h("wickra_fama_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_FAMA_BATCH = h("wickra_fama_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FAMA_RESET = h("wickra_fama_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FAMA_FREE = h("wickra_fama_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FISHER_RSI_NEW = h("wickra_fisher_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FISHER_RSI_UPDATE = h("wickra_fisher_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_FISHER_RSI_BATCH = h("wickra_fisher_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FISHER_RSI_RESET = h("wickra_fisher_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FISHER_RSI_FREE = h("wickra_fisher_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FISHER_TRANSFORM_NEW = h("wickra_fisher_transform_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FISHER_TRANSFORM_UPDATE = h("wickra_fisher_transform_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_FISHER_TRANSFORM_BATCH = h("wickra_fisher_transform_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FISHER_TRANSFORM_RESET = h("wickra_fisher_transform_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FISHER_TRANSFORM_FREE = h("wickra_fisher_transform_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRAMA_NEW = h("wickra_frama_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FRAMA_UPDATE = h("wickra_frama_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_FRAMA_BATCH = h("wickra_frama_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FRAMA_RESET = h("wickra_frama_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRAMA_FREE = h("wickra_frama_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAIN_LOSS_RATIO_NEW = h("wickra_gain_loss_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_GAIN_LOSS_RATIO_UPDATE = h("wickra_gain_loss_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_GAIN_LOSS_RATIO_BATCH = h("wickra_gain_loss_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GAIN_LOSS_RATIO_RESET = h("wickra_gain_loss_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAIN_LOSS_RATIO_FREE = h("wickra_gain_loss_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAIN_TO_PAIN_RATIO_NEW = h("wickra_gain_to_pain_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_GAIN_TO_PAIN_RATIO_UPDATE = h("wickra_gain_to_pain_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_GAIN_TO_PAIN_RATIO_BATCH = h("wickra_gain_to_pain_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GAIN_TO_PAIN_RATIO_RESET = h("wickra_gain_to_pain_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAIN_TO_PAIN_RATIO_FREE = h("wickra_gain_to_pain_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARCH11_NEW = h("wickra_garch11_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_GARCH11_UPDATE = h("wickra_garch11_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_GARCH11_BATCH = h("wickra_garch11_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GARCH11_RESET = h("wickra_garch11_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARCH11_FREE = h("wickra_garch11_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init2() { + WICKRA_GENERALIZED_DEMA_NEW = h("wickra_generalized_dema_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_GENERALIZED_DEMA_UPDATE = h("wickra_generalized_dema_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_GENERALIZED_DEMA_BATCH = h("wickra_generalized_dema_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GENERALIZED_DEMA_RESET = h("wickra_generalized_dema_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GENERALIZED_DEMA_FREE = h("wickra_generalized_dema_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GEOMETRIC_MA_NEW = h("wickra_geometric_ma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_GEOMETRIC_MA_UPDATE = h("wickra_geometric_ma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_GEOMETRIC_MA_BATCH = h("wickra_geometric_ma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GEOMETRIC_MA_RESET = h("wickra_geometric_ma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GEOMETRIC_MA_FREE = h("wickra_geometric_ma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGHPASS_FILTER_NEW = h("wickra_highpass_filter_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HIGHPASS_FILTER_UPDATE = h("wickra_highpass_filter_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HIGHPASS_FILTER_BATCH = h("wickra_highpass_filter_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HIGHPASS_FILTER_RESET = h("wickra_highpass_filter_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGHPASS_FILTER_FREE = h("wickra_highpass_filter_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HILBERT_DOMINANT_CYCLE_NEW = h("wickra_hilbert_dominant_cycle_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HILBERT_DOMINANT_CYCLE_UPDATE = h("wickra_hilbert_dominant_cycle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HILBERT_DOMINANT_CYCLE_BATCH = h("wickra_hilbert_dominant_cycle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HILBERT_DOMINANT_CYCLE_RESET = h("wickra_hilbert_dominant_cycle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HILBERT_DOMINANT_CYCLE_FREE = h("wickra_hilbert_dominant_cycle_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HISTORICAL_VOLATILITY_NEW = h("wickra_historical_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_HISTORICAL_VOLATILITY_UPDATE = h("wickra_historical_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HISTORICAL_VOLATILITY_BATCH = h("wickra_historical_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HISTORICAL_VOLATILITY_RESET = h("wickra_historical_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HISTORICAL_VOLATILITY_FREE = h("wickra_historical_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HMA_NEW = h("wickra_hma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HMA_UPDATE = h("wickra_hma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HMA_BATCH = h("wickra_hma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HMA_RESET = h("wickra_hma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HMA_FREE = h("wickra_hma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HOLT_WINTERS_NEW = h("wickra_holt_winters_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_HOLT_WINTERS_UPDATE = h("wickra_holt_winters_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HOLT_WINTERS_BATCH = h("wickra_holt_winters_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HOLT_WINTERS_RESET = h("wickra_holt_winters_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HOLT_WINTERS_FREE = h("wickra_holt_winters_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_DC_PHASE_NEW = h("wickra_ht_dc_phase_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HT_DC_PHASE_UPDATE = h("wickra_ht_dc_phase_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HT_DC_PHASE_BATCH = h("wickra_ht_dc_phase_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HT_DC_PHASE_RESET = h("wickra_ht_dc_phase_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_DC_PHASE_FREE = h("wickra_ht_dc_phase_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_TREND_MODE_NEW = h("wickra_ht_trend_mode_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HT_TREND_MODE_UPDATE = h("wickra_ht_trend_mode_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HT_TREND_MODE_BATCH = h("wickra_ht_trend_mode_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HT_TREND_MODE_RESET = h("wickra_ht_trend_mode_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_TREND_MODE_FREE = h("wickra_ht_trend_mode_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HURST_EXPONENT_NEW = h("wickra_hurst_exponent_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_HURST_EXPONENT_UPDATE = h("wickra_hurst_exponent_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_HURST_EXPONENT_BATCH = h("wickra_hurst_exponent_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HURST_EXPONENT_RESET = h("wickra_hurst_exponent_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HURST_EXPONENT_FREE = h("wickra_hurst_exponent_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INSTANTANEOUS_TRENDLINE_NEW = h("wickra_instantaneous_trendline_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_INSTANTANEOUS_TRENDLINE_UPDATE = h("wickra_instantaneous_trendline_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_INSTANTANEOUS_TRENDLINE_BATCH = h("wickra_instantaneous_trendline_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INSTANTANEOUS_TRENDLINE_RESET = h("wickra_instantaneous_trendline_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INSTANTANEOUS_TRENDLINE_FREE = h("wickra_instantaneous_trendline_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INVERSE_FISHER_TRANSFORM_NEW = h("wickra_inverse_fisher_transform_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_INVERSE_FISHER_TRANSFORM_UPDATE = h("wickra_inverse_fisher_transform_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_INVERSE_FISHER_TRANSFORM_BATCH = h("wickra_inverse_fisher_transform_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INVERSE_FISHER_TRANSFORM_RESET = h("wickra_inverse_fisher_transform_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INVERSE_FISHER_TRANSFORM_FREE = h("wickra_inverse_fisher_transform_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JARQUE_BERA_NEW = h("wickra_jarque_bera_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_JARQUE_BERA_UPDATE = h("wickra_jarque_bera_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_JARQUE_BERA_BATCH = h("wickra_jarque_bera_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_JARQUE_BERA_RESET = h("wickra_jarque_bera_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JARQUE_BERA_FREE = h("wickra_jarque_bera_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JMA_NEW = h("wickra_jma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_INT)); + WICKRA_JMA_UPDATE = h("wickra_jma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_JMA_BATCH = h("wickra_jma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_JMA_RESET = h("wickra_jma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JMA_FREE = h("wickra_jma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JUMP_INDICATOR_NEW = h("wickra_jump_indicator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_JUMP_INDICATOR_UPDATE = h("wickra_jump_indicator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_JUMP_INDICATOR_BATCH = h("wickra_jump_indicator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_JUMP_INDICATOR_RESET = h("wickra_jump_indicator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_JUMP_INDICATOR_FREE = h("wickra_jump_indicator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_K_RATIO_NEW = h("wickra_k_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_K_RATIO_UPDATE = h("wickra_k_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_K_RATIO_BATCH = h("wickra_k_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_K_RATIO_RESET = h("wickra_k_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_K_RATIO_FREE = h("wickra_k_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KAMA_NEW = h("wickra_kama_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_KAMA_UPDATE = h("wickra_kama_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_KAMA_BATCH = h("wickra_kama_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KAMA_RESET = h("wickra_kama_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KAMA_FREE = h("wickra_kama_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KELLY_CRITERION_NEW = h("wickra_kelly_criterion_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_KELLY_CRITERION_UPDATE = h("wickra_kelly_criterion_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_KELLY_CRITERION_BATCH = h("wickra_kelly_criterion_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KELLY_CRITERION_RESET = h("wickra_kelly_criterion_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KELLY_CRITERION_FREE = h("wickra_kelly_criterion_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KURTOSIS_NEW = h("wickra_kurtosis_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_KURTOSIS_UPDATE = h("wickra_kurtosis_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_KURTOSIS_BATCH = h("wickra_kurtosis_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KURTOSIS_RESET = h("wickra_kurtosis_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KURTOSIS_FREE = h("wickra_kurtosis_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LAGUERRE_RSI_NEW = h("wickra_laguerre_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_LAGUERRE_RSI_UPDATE = h("wickra_laguerre_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LAGUERRE_RSI_BATCH = h("wickra_laguerre_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LAGUERRE_RSI_RESET = h("wickra_laguerre_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LAGUERRE_RSI_FREE = h("wickra_laguerre_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LINEAR_REGRESSION_NEW = h("wickra_linear_regression_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_LINEAR_REGRESSION_UPDATE = h("wickra_linear_regression_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LINEAR_REGRESSION_BATCH = h("wickra_linear_regression_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LINEAR_REGRESSION_RESET = h("wickra_linear_regression_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LINEAR_REGRESSION_FREE = h("wickra_linear_regression_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_ANGLE_NEW = h("wickra_lin_reg_angle_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_ANGLE_UPDATE = h("wickra_lin_reg_angle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LIN_REG_ANGLE_BATCH = h("wickra_lin_reg_angle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_ANGLE_RESET = h("wickra_lin_reg_angle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_ANGLE_FREE = h("wickra_lin_reg_angle_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_INTERCEPT_NEW = h("wickra_lin_reg_intercept_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_INTERCEPT_UPDATE = h("wickra_lin_reg_intercept_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LIN_REG_INTERCEPT_BATCH = h("wickra_lin_reg_intercept_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_INTERCEPT_RESET = h("wickra_lin_reg_intercept_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_INTERCEPT_FREE = h("wickra_lin_reg_intercept_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_SLOPE_NEW = h("wickra_lin_reg_slope_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_SLOPE_UPDATE = h("wickra_lin_reg_slope_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LIN_REG_SLOPE_BATCH = h("wickra_lin_reg_slope_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LIN_REG_SLOPE_RESET = h("wickra_lin_reg_slope_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_SLOPE_FREE = h("wickra_lin_reg_slope_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init3() { + WICKRA_LOG_RETURN_NEW = h("wickra_log_return_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_LOG_RETURN_UPDATE = h("wickra_log_return_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_LOG_RETURN_BATCH = h("wickra_log_return_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LOG_RETURN_RESET = h("wickra_log_return_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LOG_RETURN_FREE = h("wickra_log_return_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_M2_MEASURE_NEW = h("wickra_m2_measure_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_M2_MEASURE_UPDATE = h("wickra_m2_measure_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_M2_MEASURE_BATCH = h("wickra_m2_measure_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_M2_MEASURE_RESET = h("wickra_m2_measure_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_M2_MEASURE_FREE = h("wickra_m2_measure_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_HISTOGRAM_NEW = h("wickra_macd_histogram_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_MACD_HISTOGRAM_UPDATE = h("wickra_macd_histogram_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MACD_HISTOGRAM_BATCH = h("wickra_macd_histogram_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MACD_HISTOGRAM_RESET = h("wickra_macd_histogram_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_HISTOGRAM_FREE = h("wickra_macd_histogram_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARTIN_RATIO_NEW = h("wickra_martin_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MARTIN_RATIO_UPDATE = h("wickra_martin_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MARTIN_RATIO_BATCH = h("wickra_martin_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MARTIN_RATIO_RESET = h("wickra_martin_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARTIN_RATIO_FREE = h("wickra_martin_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAX_DRAWDOWN_NEW = h("wickra_max_drawdown_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MAX_DRAWDOWN_UPDATE = h("wickra_max_drawdown_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MAX_DRAWDOWN_BATCH = h("wickra_max_drawdown_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MAX_DRAWDOWN_RESET = h("wickra_max_drawdown_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAX_DRAWDOWN_FREE = h("wickra_max_drawdown_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_GINLEY_DYNAMIC_NEW = h("wickra_mc_ginley_dynamic_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MC_GINLEY_DYNAMIC_UPDATE = h("wickra_mc_ginley_dynamic_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MC_GINLEY_DYNAMIC_BATCH = h("wickra_mc_ginley_dynamic_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MC_GINLEY_DYNAMIC_RESET = h("wickra_mc_ginley_dynamic_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_GINLEY_DYNAMIC_FREE = h("wickra_mc_ginley_dynamic_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_ABSOLUTE_DEVIATION_NEW = h("wickra_median_absolute_deviation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MEDIAN_ABSOLUTE_DEVIATION_UPDATE = h("wickra_median_absolute_deviation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MEDIAN_ABSOLUTE_DEVIATION_BATCH = h("wickra_median_absolute_deviation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MEDIAN_ABSOLUTE_DEVIATION_RESET = h("wickra_median_absolute_deviation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_ABSOLUTE_DEVIATION_FREE = h("wickra_median_absolute_deviation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_MA_NEW = h("wickra_median_ma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MEDIAN_MA_UPDATE = h("wickra_median_ma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MEDIAN_MA_BATCH = h("wickra_median_ma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MEDIAN_MA_RESET = h("wickra_median_ma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_MA_FREE = h("wickra_median_ma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MID_POINT_NEW = h("wickra_mid_point_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MID_POINT_UPDATE = h("wickra_mid_point_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MID_POINT_BATCH = h("wickra_mid_point_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MID_POINT_RESET = h("wickra_mid_point_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MID_POINT_FREE = h("wickra_mid_point_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MOM_NEW = h("wickra_mom_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MOM_UPDATE = h("wickra_mom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_MOM_BATCH = h("wickra_mom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MOM_RESET = h("wickra_mom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MOM_FREE = h("wickra_mom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OMEGA_RATIO_NEW = h("wickra_omega_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_OMEGA_RATIO_UPDATE = h("wickra_omega_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_OMEGA_RATIO_BATCH = h("wickra_omega_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_OMEGA_RATIO_RESET = h("wickra_omega_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OMEGA_RATIO_FREE = h("wickra_omega_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIN_INDEX_NEW = h("wickra_pain_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PAIN_INDEX_UPDATE = h("wickra_pain_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PAIN_INDEX_BATCH = h("wickra_pain_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PAIN_INDEX_RESET = h("wickra_pain_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIN_INDEX_FREE = h("wickra_pain_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENT_B_NEW = h("wickra_percent_b_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_PERCENT_B_UPDATE = h("wickra_percent_b_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PERCENT_B_BATCH = h("wickra_percent_b_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PERCENT_B_RESET = h("wickra_percent_b_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENT_B_FREE = h("wickra_percent_b_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENTAGE_TRAILING_STOP_NEW = h("wickra_percentage_trailing_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_PERCENTAGE_TRAILING_STOP_UPDATE = h("wickra_percentage_trailing_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PERCENTAGE_TRAILING_STOP_BATCH = h("wickra_percentage_trailing_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PERCENTAGE_TRAILING_STOP_RESET = h("wickra_percentage_trailing_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENTAGE_TRAILING_STOP_FREE = h("wickra_percentage_trailing_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PMO_NEW = h("wickra_pmo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PMO_UPDATE = h("wickra_pmo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PMO_BATCH = h("wickra_pmo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PMO_RESET = h("wickra_pmo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PMO_FREE = h("wickra_pmo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_POLARIZED_FRACTAL_EFFICIENCY_NEW = h("wickra_polarized_fractal_efficiency_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_POLARIZED_FRACTAL_EFFICIENCY_UPDATE = h("wickra_polarized_fractal_efficiency_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_POLARIZED_FRACTAL_EFFICIENCY_BATCH = h("wickra_polarized_fractal_efficiency_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_POLARIZED_FRACTAL_EFFICIENCY_RESET = h("wickra_polarized_fractal_efficiency_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_POLARIZED_FRACTAL_EFFICIENCY_FREE = h("wickra_polarized_fractal_efficiency_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PPO_NEW = h("wickra_ppo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PPO_UPDATE = h("wickra_ppo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PPO_BATCH = h("wickra_ppo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PPO_RESET = h("wickra_ppo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PPO_FREE = h("wickra_ppo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PPO_HISTOGRAM_NEW = h("wickra_ppo_histogram_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_PPO_HISTOGRAM_UPDATE = h("wickra_ppo_histogram_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PPO_HISTOGRAM_BATCH = h("wickra_ppo_histogram_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PPO_HISTOGRAM_RESET = h("wickra_ppo_histogram_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PPO_HISTOGRAM_FREE = h("wickra_ppo_histogram_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROFIT_FACTOR_NEW = h("wickra_profit_factor_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PROFIT_FACTOR_UPDATE = h("wickra_profit_factor_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_PROFIT_FACTOR_BATCH = h("wickra_profit_factor_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PROFIT_FACTOR_RESET = h("wickra_profit_factor_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROFIT_FACTOR_FREE = h("wickra_profit_factor_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_R_SQUARED_NEW = h("wickra_r_squared_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_R_SQUARED_UPDATE = h("wickra_r_squared_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_R_SQUARED_BATCH = h("wickra_r_squared_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_R_SQUARED_RESET = h("wickra_r_squared_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_R_SQUARED_FREE = h("wickra_r_squared_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REALIZED_VOLATILITY_NEW = h("wickra_realized_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_REALIZED_VOLATILITY_UPDATE = h("wickra_realized_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_REALIZED_VOLATILITY_BATCH = h("wickra_realized_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_REALIZED_VOLATILITY_RESET = h("wickra_realized_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REALIZED_VOLATILITY_FREE = h("wickra_realized_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RECOVERY_FACTOR_NEW = h("wickra_recovery_factor_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_RECOVERY_FACTOR_UPDATE = h("wickra_recovery_factor_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RECOVERY_FACTOR_BATCH = h("wickra_recovery_factor_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RECOVERY_FACTOR_RESET = h("wickra_recovery_factor_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RECOVERY_FACTOR_FREE = h("wickra_recovery_factor_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REFLEX_NEW = h("wickra_reflex_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_REFLEX_UPDATE = h("wickra_reflex_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_REFLEX_BATCH = h("wickra_reflex_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_REFLEX_RESET = h("wickra_reflex_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REFLEX_FREE = h("wickra_reflex_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REGIME_LABEL_NEW = h("wickra_regime_label_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_REGIME_LABEL_UPDATE = h("wickra_regime_label_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_REGIME_LABEL_BATCH = h("wickra_regime_label_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_REGIME_LABEL_RESET = h("wickra_regime_label_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REGIME_LABEL_FREE = h("wickra_regime_label_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init4() { + WICKRA_RENKO_TRAILING_STOP_NEW = h("wickra_renko_trailing_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_RENKO_TRAILING_STOP_UPDATE = h("wickra_renko_trailing_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RENKO_TRAILING_STOP_BATCH = h("wickra_renko_trailing_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RENKO_TRAILING_STOP_RESET = h("wickra_renko_trailing_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RENKO_TRAILING_STOP_FREE = h("wickra_renko_trailing_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RMI_NEW = h("wickra_rmi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_RMI_UPDATE = h("wickra_rmi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RMI_BATCH = h("wickra_rmi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RMI_RESET = h("wickra_rmi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RMI_FREE = h("wickra_rmi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROC_NEW = h("wickra_roc_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROC_UPDATE = h("wickra_roc_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROC_BATCH = h("wickra_roc_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROC_RESET = h("wickra_roc_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROC_FREE = h("wickra_roc_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCP_NEW = h("wickra_rocp_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROCP_UPDATE = h("wickra_rocp_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROCP_BATCH = h("wickra_rocp_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROCP_RESET = h("wickra_rocp_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCP_FREE = h("wickra_rocp_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCR_NEW = h("wickra_rocr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROCR_UPDATE = h("wickra_rocr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROCR_BATCH = h("wickra_rocr_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROCR_RESET = h("wickra_rocr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCR_FREE = h("wickra_rocr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCR100_NEW = h("wickra_rocr100_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROCR100_UPDATE = h("wickra_rocr100_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROCR100_BATCH = h("wickra_rocr100_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROCR100_RESET = h("wickra_rocr100_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROCR100_FREE = h("wickra_rocr100_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_IQR_NEW = h("wickra_rolling_iqr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_IQR_UPDATE = h("wickra_rolling_iqr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROLLING_IQR_BATCH = h("wickra_rolling_iqr_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_IQR_RESET = h("wickra_rolling_iqr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_IQR_FREE = h("wickra_rolling_iqr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_MIN_MAX_SCALER_NEW = h("wickra_rolling_min_max_scaler_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_MIN_MAX_SCALER_UPDATE = h("wickra_rolling_min_max_scaler_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROLLING_MIN_MAX_SCALER_BATCH = h("wickra_rolling_min_max_scaler_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_MIN_MAX_SCALER_RESET = h("wickra_rolling_min_max_scaler_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_MIN_MAX_SCALER_FREE = h("wickra_rolling_min_max_scaler_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_PERCENTILE_RANK_NEW = h("wickra_rolling_percentile_rank_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_PERCENTILE_RANK_UPDATE = h("wickra_rolling_percentile_rank_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROLLING_PERCENTILE_RANK_BATCH = h("wickra_rolling_percentile_rank_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_PERCENTILE_RANK_RESET = h("wickra_rolling_percentile_rank_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_PERCENTILE_RANK_FREE = h("wickra_rolling_percentile_rank_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_QUANTILE_NEW = h("wickra_rolling_quantile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ROLLING_QUANTILE_UPDATE = h("wickra_rolling_quantile_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROLLING_QUANTILE_BATCH = h("wickra_rolling_quantile_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_QUANTILE_RESET = h("wickra_rolling_quantile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_QUANTILE_FREE = h("wickra_rolling_quantile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROOFING_FILTER_NEW = h("wickra_roofing_filter_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_ROOFING_FILTER_UPDATE = h("wickra_roofing_filter_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ROOFING_FILTER_BATCH = h("wickra_roofing_filter_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROOFING_FILTER_RESET = h("wickra_roofing_filter_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROOFING_FILTER_FREE = h("wickra_roofing_filter_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RSI_NEW = h("wickra_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RSI_UPDATE = h("wickra_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RSI_BATCH = h("wickra_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RSI_RESET = h("wickra_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RSI_FREE = h("wickra_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RSX_NEW = h("wickra_rsx_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RSX_UPDATE = h("wickra_rsx_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RSX_BATCH = h("wickra_rsx_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RSX_RESET = h("wickra_rsx_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RSX_FREE = h("wickra_rsx_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RVI_VOLATILITY_NEW = h("wickra_rvi_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RVI_VOLATILITY_UPDATE = h("wickra_rvi_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_RVI_VOLATILITY_BATCH = h("wickra_rvi_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RVI_VOLATILITY_RESET = h("wickra_rvi_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RVI_VOLATILITY_FREE = h("wickra_rvi_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SAMPLE_ENTROPY_NEW = h("wickra_sample_entropy_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_SAMPLE_ENTROPY_UPDATE = h("wickra_sample_entropy_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SAMPLE_ENTROPY_BATCH = h("wickra_sample_entropy_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SAMPLE_ENTROPY_RESET = h("wickra_sample_entropy_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SAMPLE_ENTROPY_FREE = h("wickra_sample_entropy_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHANNON_ENTROPY_NEW = h("wickra_shannon_entropy_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_SHANNON_ENTROPY_UPDATE = h("wickra_shannon_entropy_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SHANNON_ENTROPY_BATCH = h("wickra_shannon_entropy_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SHANNON_ENTROPY_RESET = h("wickra_shannon_entropy_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHANNON_ENTROPY_FREE = h("wickra_shannon_entropy_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHARPE_RATIO_NEW = h("wickra_sharpe_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_SHARPE_RATIO_UPDATE = h("wickra_sharpe_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SHARPE_RATIO_BATCH = h("wickra_sharpe_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SHARPE_RATIO_RESET = h("wickra_sharpe_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHARPE_RATIO_FREE = h("wickra_sharpe_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINE_WAVE_NEW = h("wickra_sine_wave_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SINE_WAVE_UPDATE = h("wickra_sine_wave_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SINE_WAVE_BATCH = h("wickra_sine_wave_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SINE_WAVE_RESET = h("wickra_sine_wave_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINE_WAVE_FREE = h("wickra_sine_wave_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINE_WEIGHTED_MA_NEW = h("wickra_sine_weighted_ma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SINE_WEIGHTED_MA_UPDATE = h("wickra_sine_weighted_ma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SINE_WEIGHTED_MA_BATCH = h("wickra_sine_weighted_ma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SINE_WEIGHTED_MA_RESET = h("wickra_sine_weighted_ma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINE_WEIGHTED_MA_FREE = h("wickra_sine_weighted_ma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SKEWNESS_NEW = h("wickra_skewness_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SKEWNESS_UPDATE = h("wickra_skewness_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SKEWNESS_BATCH = h("wickra_skewness_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SKEWNESS_RESET = h("wickra_skewness_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SKEWNESS_FREE = h("wickra_skewness_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMA_NEW = h("wickra_sma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SMA_UPDATE = h("wickra_sma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SMA_BATCH = h("wickra_sma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SMA_RESET = h("wickra_sma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMA_FREE = h("wickra_sma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMMA_NEW = h("wickra_smma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SMMA_UPDATE = h("wickra_smma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SMMA_BATCH = h("wickra_smma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SMMA_RESET = h("wickra_smma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMMA_FREE = h("wickra_smma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SORTINO_RATIO_NEW = h("wickra_sortino_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_SORTINO_RATIO_UPDATE = h("wickra_sortino_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SORTINO_RATIO_BATCH = h("wickra_sortino_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SORTINO_RATIO_RESET = h("wickra_sortino_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SORTINO_RATIO_FREE = h("wickra_sortino_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STANDARD_ERROR_NEW = h("wickra_standard_error_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_STANDARD_ERROR_UPDATE = h("wickra_standard_error_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STANDARD_ERROR_BATCH = h("wickra_standard_error_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STANDARD_ERROR_RESET = h("wickra_standard_error_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STANDARD_ERROR_FREE = h("wickra_standard_error_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init5() { + WICKRA_STC_NEW = h("wickra_stc_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_STC_UPDATE = h("wickra_stc_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STC_BATCH = h("wickra_stc_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STC_RESET = h("wickra_stc_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STC_FREE = h("wickra_stc_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STD_DEV_NEW = h("wickra_std_dev_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_STD_DEV_UPDATE = h("wickra_std_dev_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STD_DEV_BATCH = h("wickra_std_dev_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STD_DEV_RESET = h("wickra_std_dev_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STD_DEV_FREE = h("wickra_std_dev_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STEP_TRAILING_STOP_NEW = h("wickra_step_trailing_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_STEP_TRAILING_STOP_UPDATE = h("wickra_step_trailing_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STEP_TRAILING_STOP_BATCH = h("wickra_step_trailing_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STEP_TRAILING_STOP_RESET = h("wickra_step_trailing_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STEP_TRAILING_STOP_FREE = h("wickra_step_trailing_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STERLING_RATIO_NEW = h("wickra_sterling_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_STERLING_RATIO_UPDATE = h("wickra_sterling_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STERLING_RATIO_BATCH = h("wickra_sterling_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STERLING_RATIO_RESET = h("wickra_sterling_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STERLING_RATIO_FREE = h("wickra_sterling_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCH_RSI_NEW = h("wickra_stoch_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_STOCH_RSI_UPDATE = h("wickra_stoch_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_STOCH_RSI_BATCH = h("wickra_stoch_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STOCH_RSI_RESET = h("wickra_stoch_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCH_RSI_FREE = h("wickra_stoch_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SUPER_SMOOTHER_NEW = h("wickra_super_smoother_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SUPER_SMOOTHER_UPDATE = h("wickra_super_smoother_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_SUPER_SMOOTHER_BATCH = h("wickra_super_smoother_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SUPER_SMOOTHER_RESET = h("wickra_super_smoother_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SUPER_SMOOTHER_FREE = h("wickra_super_smoother_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_T3_NEW = h("wickra_t3_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_T3_UPDATE = h("wickra_t3_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_T3_BATCH = h("wickra_t3_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_T3_RESET = h("wickra_t3_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_T3_FREE = h("wickra_t3_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAIL_RATIO_NEW = h("wickra_tail_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TAIL_RATIO_UPDATE = h("wickra_tail_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TAIL_RATIO_BATCH = h("wickra_tail_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TAIL_RATIO_RESET = h("wickra_tail_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAIL_RATIO_FREE = h("wickra_tail_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TEMA_NEW = h("wickra_tema_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TEMA_UPDATE = h("wickra_tema_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TEMA_BATCH = h("wickra_tema_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TEMA_RESET = h("wickra_tema_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TEMA_FREE = h("wickra_tema_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TII_NEW = h("wickra_tii_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TII_UPDATE = h("wickra_tii_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TII_BATCH = h("wickra_tii_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TII_RESET = h("wickra_tii_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TII_FREE = h("wickra_tii_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TREND_LABEL_NEW = h("wickra_trend_label_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TREND_LABEL_UPDATE = h("wickra_trend_label_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TREND_LABEL_BATCH = h("wickra_trend_label_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TREND_LABEL_RESET = h("wickra_trend_label_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TREND_LABEL_FREE = h("wickra_trend_label_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TREND_STRENGTH_INDEX_NEW = h("wickra_trend_strength_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TREND_STRENGTH_INDEX_UPDATE = h("wickra_trend_strength_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TREND_STRENGTH_INDEX_BATCH = h("wickra_trend_strength_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TREND_STRENGTH_INDEX_RESET = h("wickra_trend_strength_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TREND_STRENGTH_INDEX_FREE = h("wickra_trend_strength_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRENDFLEX_NEW = h("wickra_trendflex_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TRENDFLEX_UPDATE = h("wickra_trendflex_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TRENDFLEX_BATCH = h("wickra_trendflex_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRENDFLEX_RESET = h("wickra_trendflex_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRENDFLEX_FREE = h("wickra_trendflex_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIMA_NEW = h("wickra_trima_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TRIMA_UPDATE = h("wickra_trima_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TRIMA_BATCH = h("wickra_trima_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRIMA_RESET = h("wickra_trima_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIMA_FREE = h("wickra_trima_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIX_NEW = h("wickra_trix_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TRIX_UPDATE = h("wickra_trix_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TRIX_BATCH = h("wickra_trix_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRIX_RESET = h("wickra_trix_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIX_FREE = h("wickra_trix_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSF_NEW = h("wickra_tsf_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TSF_UPDATE = h("wickra_tsf_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TSF_BATCH = h("wickra_tsf_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TSF_RESET = h("wickra_tsf_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSF_FREE = h("wickra_tsf_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSF_OSCILLATOR_NEW = h("wickra_tsf_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TSF_OSCILLATOR_UPDATE = h("wickra_tsf_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TSF_OSCILLATOR_BATCH = h("wickra_tsf_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TSF_OSCILLATOR_RESET = h("wickra_tsf_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSF_OSCILLATOR_FREE = h("wickra_tsf_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSI_NEW = h("wickra_tsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TSI_UPDATE = h("wickra_tsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_TSI_BATCH = h("wickra_tsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TSI_RESET = h("wickra_tsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSI_FREE = h("wickra_tsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ULCER_INDEX_NEW = h("wickra_ulcer_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ULCER_INDEX_UPDATE = h("wickra_ulcer_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ULCER_INDEX_BATCH = h("wickra_ulcer_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ULCER_INDEX_RESET = h("wickra_ulcer_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ULCER_INDEX_FREE = h("wickra_ulcer_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UNIVERSAL_OSCILLATOR_NEW = h("wickra_universal_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_UNIVERSAL_OSCILLATOR_UPDATE = h("wickra_universal_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_UNIVERSAL_OSCILLATOR_BATCH = h("wickra_universal_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_UNIVERSAL_OSCILLATOR_RESET = h("wickra_universal_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UNIVERSAL_OSCILLATOR_FREE = h("wickra_universal_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_POTENTIAL_RATIO_NEW = h("wickra_upside_potential_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_UPSIDE_POTENTIAL_RATIO_UPDATE = h("wickra_upside_potential_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_UPSIDE_POTENTIAL_RATIO_BATCH = h("wickra_upside_potential_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_UPSIDE_POTENTIAL_RATIO_RESET = h("wickra_upside_potential_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_POTENTIAL_RATIO_FREE = h("wickra_upside_potential_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VALUE_AT_RISK_NEW = h("wickra_value_at_risk_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_VALUE_AT_RISK_UPDATE = h("wickra_value_at_risk_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_VALUE_AT_RISK_BATCH = h("wickra_value_at_risk_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VALUE_AT_RISK_RESET = h("wickra_value_at_risk_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VALUE_AT_RISK_FREE = h("wickra_value_at_risk_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VARIANCE_NEW = h("wickra_variance_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VARIANCE_UPDATE = h("wickra_variance_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_VARIANCE_BATCH = h("wickra_variance_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VARIANCE_RESET = h("wickra_variance_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VARIANCE_FREE = h("wickra_variance_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VERTICAL_HORIZONTAL_FILTER_NEW = h("wickra_vertical_horizontal_filter_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VERTICAL_HORIZONTAL_FILTER_UPDATE = h("wickra_vertical_horizontal_filter_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_VERTICAL_HORIZONTAL_FILTER_BATCH = h("wickra_vertical_horizontal_filter_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VERTICAL_HORIZONTAL_FILTER_RESET = h("wickra_vertical_horizontal_filter_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VERTICAL_HORIZONTAL_FILTER_FREE = h("wickra_vertical_horizontal_filter_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init6() { + WICKRA_VIDYA_NEW = h("wickra_vidya_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VIDYA_UPDATE = h("wickra_vidya_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_VIDYA_BATCH = h("wickra_vidya_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VIDYA_RESET = h("wickra_vidya_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VIDYA_FREE = h("wickra_vidya_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_OF_VOLATILITY_NEW = h("wickra_volatility_of_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VOLATILITY_OF_VOLATILITY_UPDATE = h("wickra_volatility_of_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_VOLATILITY_OF_VOLATILITY_BATCH = h("wickra_volatility_of_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLATILITY_OF_VOLATILITY_RESET = h("wickra_volatility_of_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_OF_VOLATILITY_FREE = h("wickra_volatility_of_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAVE_PM_NEW = h("wickra_wave_pm_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_WAVE_PM_UPDATE = h("wickra_wave_pm_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_WAVE_PM_BATCH = h("wickra_wave_pm_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WAVE_PM_RESET = h("wickra_wave_pm_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAVE_PM_FREE = h("wickra_wave_pm_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WIN_RATE_NEW = h("wickra_win_rate_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_WIN_RATE_UPDATE = h("wickra_win_rate_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_WIN_RATE_BATCH = h("wickra_win_rate_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WIN_RATE_RESET = h("wickra_win_rate_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WIN_RATE_FREE = h("wickra_win_rate_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WMA_NEW = h("wickra_wma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_WMA_UPDATE = h("wickra_wma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_WMA_BATCH = h("wickra_wma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WMA_RESET = h("wickra_wma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WMA_FREE = h("wickra_wma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_Z_SCORE_NEW = h("wickra_z_score_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_Z_SCORE_UPDATE = h("wickra_z_score_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_Z_SCORE_BATCH = h("wickra_z_score_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_Z_SCORE_RESET = h("wickra_z_score_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_Z_SCORE_FREE = h("wickra_z_score_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZLEMA_NEW = h("wickra_zlema_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ZLEMA_UPDATE = h("wickra_zlema_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE)); + WICKRA_ZLEMA_BATCH = h("wickra_zlema_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ZLEMA_RESET = h("wickra_zlema_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZLEMA_FREE = h("wickra_zlema_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALPHA_NEW = h("wickra_alpha_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ALPHA_UPDATE = h("wickra_alpha_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_ALPHA_BATCH = h("wickra_alpha_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ALPHA_RESET = h("wickra_alpha_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALPHA_FREE = h("wickra_alpha_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETA_NEW = h("wickra_beta_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BETA_UPDATE = h("wickra_beta_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_BETA_BATCH = h("wickra_beta_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BETA_RESET = h("wickra_beta_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETA_FREE = h("wickra_beta_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETA_NEUTRAL_SPREAD_NEW = h("wickra_beta_neutral_spread_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BETA_NEUTRAL_SPREAD_UPDATE = h("wickra_beta_neutral_spread_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_BETA_NEUTRAL_SPREAD_BATCH = h("wickra_beta_neutral_spread_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BETA_NEUTRAL_SPREAD_RESET = h("wickra_beta_neutral_spread_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETA_NEUTRAL_SPREAD_FREE = h("wickra_beta_neutral_spread_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DISTANCE_SSD_NEW = h("wickra_distance_ssd_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DISTANCE_SSD_UPDATE = h("wickra_distance_ssd_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_DISTANCE_SSD_BATCH = h("wickra_distance_ssd_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DISTANCE_SSD_RESET = h("wickra_distance_ssd_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DISTANCE_SSD_FREE = h("wickra_distance_ssd_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GRANGER_CAUSALITY_NEW = h("wickra_granger_causality_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_GRANGER_CAUSALITY_UPDATE = h("wickra_granger_causality_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_GRANGER_CAUSALITY_BATCH = h("wickra_granger_causality_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GRANGER_CAUSALITY_RESET = h("wickra_granger_causality_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GRANGER_CAUSALITY_FREE = h("wickra_granger_causality_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HASBROUCK_INFORMATION_SHARE_NEW = h("wickra_hasbrouck_information_share_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HASBROUCK_INFORMATION_SHARE_UPDATE = h("wickra_hasbrouck_information_share_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_HASBROUCK_INFORMATION_SHARE_BATCH = h("wickra_hasbrouck_information_share_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HASBROUCK_INFORMATION_SHARE_RESET = h("wickra_hasbrouck_information_share_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HASBROUCK_INFORMATION_SHARE_FREE = h("wickra_hasbrouck_information_share_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INFORMATION_RATIO_NEW = h("wickra_information_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_INFORMATION_RATIO_UPDATE = h("wickra_information_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_INFORMATION_RATIO_BATCH = h("wickra_information_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INFORMATION_RATIO_RESET = h("wickra_information_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INFORMATION_RATIO_FREE = h("wickra_information_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KENDALL_TAU_NEW = h("wickra_kendall_tau_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_KENDALL_TAU_UPDATE = h("wickra_kendall_tau_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_KENDALL_TAU_BATCH = h("wickra_kendall_tau_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KENDALL_TAU_RESET = h("wickra_kendall_tau_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KENDALL_TAU_FREE = h("wickra_kendall_tau_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OU_HALF_LIFE_NEW = h("wickra_ou_half_life_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_OU_HALF_LIFE_UPDATE = h("wickra_ou_half_life_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_OU_HALF_LIFE_BATCH = h("wickra_ou_half_life_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_OU_HALF_LIFE_RESET = h("wickra_ou_half_life_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OU_HALF_LIFE_FREE = h("wickra_ou_half_life_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIR_SPREAD_Z_SCORE_NEW = h("wickra_pair_spread_z_score_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PAIR_SPREAD_Z_SCORE_UPDATE = h("wickra_pair_spread_z_score_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_PAIR_SPREAD_Z_SCORE_BATCH = h("wickra_pair_spread_z_score_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PAIR_SPREAD_Z_SCORE_RESET = h("wickra_pair_spread_z_score_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIR_SPREAD_Z_SCORE_FREE = h("wickra_pair_spread_z_score_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIRWISE_BETA_NEW = h("wickra_pairwise_beta_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PAIRWISE_BETA_UPDATE = h("wickra_pairwise_beta_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_PAIRWISE_BETA_BATCH = h("wickra_pairwise_beta_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PAIRWISE_BETA_RESET = h("wickra_pairwise_beta_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PAIRWISE_BETA_FREE = h("wickra_pairwise_beta_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PEARSON_CORRELATION_NEW = h("wickra_pearson_correlation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PEARSON_CORRELATION_UPDATE = h("wickra_pearson_correlation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_PEARSON_CORRELATION_BATCH = h("wickra_pearson_correlation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PEARSON_CORRELATION_RESET = h("wickra_pearson_correlation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PEARSON_CORRELATION_FREE = h("wickra_pearson_correlation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_CORRELATION_NEW = h("wickra_rolling_correlation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_CORRELATION_UPDATE = h("wickra_rolling_correlation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_ROLLING_CORRELATION_BATCH = h("wickra_rolling_correlation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_CORRELATION_RESET = h("wickra_rolling_correlation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_CORRELATION_FREE = h("wickra_rolling_correlation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_COVARIANCE_NEW = h("wickra_rolling_covariance_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_COVARIANCE_UPDATE = h("wickra_rolling_covariance_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_ROLLING_COVARIANCE_BATCH = h("wickra_rolling_covariance_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_COVARIANCE_RESET = h("wickra_rolling_covariance_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_COVARIANCE_FREE = h("wickra_rolling_covariance_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPEARMAN_CORRELATION_NEW = h("wickra_spearman_correlation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SPEARMAN_CORRELATION_UPDATE = h("wickra_spearman_correlation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_SPEARMAN_CORRELATION_BATCH = h("wickra_spearman_correlation_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SPEARMAN_CORRELATION_RESET = h("wickra_spearman_correlation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPEARMAN_CORRELATION_FREE = h("wickra_spearman_correlation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_AR1_COEFFICIENT_NEW = h("wickra_spread_ar1_coefficient_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SPREAD_AR1_COEFFICIENT_UPDATE = h("wickra_spread_ar1_coefficient_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_SPREAD_AR1_COEFFICIENT_BATCH = h("wickra_spread_ar1_coefficient_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SPREAD_AR1_COEFFICIENT_RESET = h("wickra_spread_ar1_coefficient_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_AR1_COEFFICIENT_FREE = h("wickra_spread_ar1_coefficient_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_HURST_NEW = h("wickra_spread_hurst_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SPREAD_HURST_UPDATE = h("wickra_spread_hurst_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_SPREAD_HURST_BATCH = h("wickra_spread_hurst_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SPREAD_HURST_RESET = h("wickra_spread_hurst_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_HURST_FREE = h("wickra_spread_hurst_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init7() { + WICKRA_TREYNOR_RATIO_NEW = h("wickra_treynor_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_TREYNOR_RATIO_UPDATE = h("wickra_treynor_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_TREYNOR_RATIO_BATCH = h("wickra_treynor_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TREYNOR_RATIO_RESET = h("wickra_treynor_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TREYNOR_RATIO_FREE = h("wickra_treynor_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VARIANCE_RATIO_NEW = h("wickra_variance_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VARIANCE_RATIO_UPDATE = h("wickra_variance_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_VARIANCE_RATIO_BATCH = h("wickra_variance_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VARIANCE_RATIO_RESET = h("wickra_variance_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VARIANCE_RATIO_FREE = h("wickra_variance_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABANDONED_BABY_NEW = h("wickra_abandoned_baby_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ABANDONED_BABY_UPDATE = h("wickra_abandoned_baby_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ABANDONED_BABY_BATCH = h("wickra_abandoned_baby_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ABANDONED_BABY_RESET = h("wickra_abandoned_baby_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABANDONED_BABY_FREE = h("wickra_abandoned_baby_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABCD_NEW = h("wickra_abcd_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ABCD_UPDATE = h("wickra_abcd_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ABCD_BATCH = h("wickra_abcd_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ABCD_RESET = h("wickra_abcd_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABCD_FREE = h("wickra_abcd_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ACCELERATOR_OSCILLATOR_NEW = h("wickra_accelerator_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ACCELERATOR_OSCILLATOR_UPDATE = h("wickra_accelerator_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ACCELERATOR_OSCILLATOR_BATCH = h("wickra_accelerator_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ACCELERATOR_OSCILLATOR_RESET = h("wickra_accelerator_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ACCELERATOR_OSCILLATOR_FREE = h("wickra_accelerator_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AD_OSCILLATOR_NEW = h("wickra_ad_oscillator_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_AD_OSCILLATOR_UPDATE = h("wickra_ad_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AD_OSCILLATOR_BATCH = h("wickra_ad_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AD_OSCILLATOR_RESET = h("wickra_ad_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AD_OSCILLATOR_FREE = h("wickra_ad_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_CCI_NEW = h("wickra_adaptive_cci_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_CCI_UPDATE = h("wickra_adaptive_cci_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ADAPTIVE_CCI_BATCH = h("wickra_adaptive_cci_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADAPTIVE_CCI_RESET = h("wickra_adaptive_cci_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADAPTIVE_CCI_FREE = h("wickra_adaptive_cci_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADL_NEW = h("wickra_adl_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ADL_UPDATE = h("wickra_adl_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ADL_BATCH = h("wickra_adl_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADL_RESET = h("wickra_adl_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADL_FREE = h("wickra_adl_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_BLOCK_NEW = h("wickra_advance_block_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ADVANCE_BLOCK_UPDATE = h("wickra_advance_block_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ADVANCE_BLOCK_BATCH = h("wickra_advance_block_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADVANCE_BLOCK_RESET = h("wickra_advance_block_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_BLOCK_FREE = h("wickra_advance_block_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADXR_NEW = h("wickra_adxr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ADXR_UPDATE = h("wickra_adxr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ADXR_BATCH = h("wickra_adxr_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ADXR_RESET = h("wickra_adxr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADXR_FREE = h("wickra_adxr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANCHORED_VWAP_NEW = h("wickra_anchored_vwap_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ANCHORED_VWAP_UPDATE = h("wickra_anchored_vwap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ANCHORED_VWAP_BATCH = h("wickra_anchored_vwap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ANCHORED_VWAP_RESET = h("wickra_anchored_vwap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANCHORED_VWAP_FREE = h("wickra_anchored_vwap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AROON_OSCILLATOR_NEW = h("wickra_aroon_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_AROON_OSCILLATOR_UPDATE = h("wickra_aroon_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AROON_OSCILLATOR_BATCH = h("wickra_aroon_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AROON_OSCILLATOR_RESET = h("wickra_aroon_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AROON_OSCILLATOR_FREE = h("wickra_aroon_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_NEW = h("wickra_atr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ATR_UPDATE = h("wickra_atr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ATR_BATCH = h("wickra_atr_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ATR_RESET = h("wickra_atr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_FREE = h("wickra_atr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_TRAILING_STOP_NEW = h("wickra_atr_trailing_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ATR_TRAILING_STOP_UPDATE = h("wickra_atr_trailing_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ATR_TRAILING_STOP_BATCH = h("wickra_atr_trailing_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ATR_TRAILING_STOP_RESET = h("wickra_atr_trailing_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_TRAILING_STOP_FREE = h("wickra_atr_trailing_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVERAGE_DAILY_RANGE_NEW = h("wickra_average_daily_range_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_INT)); + WICKRA_AVERAGE_DAILY_RANGE_UPDATE = h("wickra_average_daily_range_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AVERAGE_DAILY_RANGE_BATCH = h("wickra_average_daily_range_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AVERAGE_DAILY_RANGE_RESET = h("wickra_average_daily_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVERAGE_DAILY_RANGE_FREE = h("wickra_average_daily_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVG_PRICE_NEW = h("wickra_avg_price_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_AVG_PRICE_UPDATE = h("wickra_avg_price_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AVG_PRICE_BATCH = h("wickra_avg_price_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AVG_PRICE_RESET = h("wickra_avg_price_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AVG_PRICE_FREE = h("wickra_avg_price_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AWESOME_OSCILLATOR_NEW = h("wickra_awesome_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_UPDATE = h("wickra_awesome_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_BATCH = h("wickra_awesome_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_RESET = h("wickra_awesome_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AWESOME_OSCILLATOR_FREE = h("wickra_awesome_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_NEW = h("wickra_awesome_oscillator_histogram_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_UPDATE = h("wickra_awesome_oscillator_histogram_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_BATCH = h("wickra_awesome_oscillator_histogram_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_RESET = h("wickra_awesome_oscillator_histogram_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AWESOME_OSCILLATOR_HISTOGRAM_FREE = h("wickra_awesome_oscillator_histogram_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BALANCE_OF_POWER_NEW = h("wickra_balance_of_power_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BALANCE_OF_POWER_UPDATE = h("wickra_balance_of_power_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BALANCE_OF_POWER_BATCH = h("wickra_balance_of_power_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BALANCE_OF_POWER_RESET = h("wickra_balance_of_power_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BALANCE_OF_POWER_FREE = h("wickra_balance_of_power_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BAT_NEW = h("wickra_bat_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BAT_UPDATE = h("wickra_bat_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BAT_BATCH = h("wickra_bat_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BAT_RESET = h("wickra_bat_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BAT_FREE = h("wickra_bat_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BELT_HOLD_NEW = h("wickra_belt_hold_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BELT_HOLD_UPDATE = h("wickra_belt_hold_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BELT_HOLD_BATCH = h("wickra_belt_hold_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BELT_HOLD_RESET = h("wickra_belt_hold_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BELT_HOLD_FREE = h("wickra_belt_hold_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETTER_VOLUME_NEW = h("wickra_better_volume_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BETTER_VOLUME_UPDATE = h("wickra_better_volume_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BETTER_VOLUME_BATCH = h("wickra_better_volume_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BETTER_VOLUME_RESET = h("wickra_better_volume_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BETTER_VOLUME_FREE = h("wickra_better_volume_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BODY_SIZE_PCT_NEW = h("wickra_body_size_pct_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BODY_SIZE_PCT_UPDATE = h("wickra_body_size_pct_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BODY_SIZE_PCT_BATCH = h("wickra_body_size_pct_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BODY_SIZE_PCT_RESET = h("wickra_body_size_pct_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BODY_SIZE_PCT_FREE = h("wickra_body_size_pct_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BREAKAWAY_NEW = h("wickra_breakaway_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BREAKAWAY_UPDATE = h("wickra_breakaway_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BREAKAWAY_BATCH = h("wickra_breakaway_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BREAKAWAY_RESET = h("wickra_breakaway_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BREAKAWAY_FREE = h("wickra_breakaway_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init8() { + WICKRA_BUTTERFLY_NEW = h("wickra_butterfly_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BUTTERFLY_UPDATE = h("wickra_butterfly_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_BUTTERFLY_BATCH = h("wickra_butterfly_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_BUTTERFLY_RESET = h("wickra_butterfly_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BUTTERFLY_FREE = h("wickra_butterfly_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CCI_NEW = h("wickra_cci_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CCI_UPDATE = h("wickra_cci_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CCI_BATCH = h("wickra_cci_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CCI_RESET = h("wickra_cci_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CCI_FREE = h("wickra_cci_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_OSCILLATOR_NEW = h("wickra_chaikin_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_CHAIKIN_OSCILLATOR_UPDATE = h("wickra_chaikin_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CHAIKIN_OSCILLATOR_BATCH = h("wickra_chaikin_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CHAIKIN_OSCILLATOR_RESET = h("wickra_chaikin_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_OSCILLATOR_FREE = h("wickra_chaikin_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_VOLATILITY_NEW = h("wickra_chaikin_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_CHAIKIN_VOLATILITY_UPDATE = h("wickra_chaikin_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CHAIKIN_VOLATILITY_BATCH = h("wickra_chaikin_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CHAIKIN_VOLATILITY_RESET = h("wickra_chaikin_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_VOLATILITY_FREE = h("wickra_chaikin_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHOPPINESS_INDEX_NEW = h("wickra_choppiness_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CHOPPINESS_INDEX_UPDATE = h("wickra_choppiness_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CHOPPINESS_INDEX_BATCH = h("wickra_choppiness_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CHOPPINESS_INDEX_RESET = h("wickra_choppiness_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHOPPINESS_INDEX_FREE = h("wickra_choppiness_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLOSE_VS_OPEN_NEW = h("wickra_close_vs_open_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CLOSE_VS_OPEN_UPDATE = h("wickra_close_vs_open_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CLOSE_VS_OPEN_BATCH = h("wickra_close_vs_open_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CLOSE_VS_OPEN_RESET = h("wickra_close_vs_open_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLOSE_VS_OPEN_FREE = h("wickra_close_vs_open_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLOSING_MARUBOZU_NEW = h("wickra_closing_marubozu_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CLOSING_MARUBOZU_UPDATE = h("wickra_closing_marubozu_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CLOSING_MARUBOZU_BATCH = h("wickra_closing_marubozu_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CLOSING_MARUBOZU_RESET = h("wickra_closing_marubozu_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLOSING_MARUBOZU_FREE = h("wickra_closing_marubozu_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_MONEY_FLOW_NEW = h("wickra_chaikin_money_flow_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CHAIKIN_MONEY_FLOW_UPDATE = h("wickra_chaikin_money_flow_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CHAIKIN_MONEY_FLOW_BATCH = h("wickra_chaikin_money_flow_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CHAIKIN_MONEY_FLOW_RESET = h("wickra_chaikin_money_flow_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHAIKIN_MONEY_FLOW_FREE = h("wickra_chaikin_money_flow_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONCEALING_BABY_SWALLOW_NEW = h("wickra_concealing_baby_swallow_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CONCEALING_BABY_SWALLOW_UPDATE = h("wickra_concealing_baby_swallow_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CONCEALING_BABY_SWALLOW_BATCH = h("wickra_concealing_baby_swallow_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CONCEALING_BABY_SWALLOW_RESET = h("wickra_concealing_baby_swallow_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CONCEALING_BABY_SWALLOW_FREE = h("wickra_concealing_baby_swallow_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COUNTERATTACK_NEW = h("wickra_counterattack_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_COUNTERATTACK_UPDATE = h("wickra_counterattack_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_COUNTERATTACK_BATCH = h("wickra_counterattack_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_COUNTERATTACK_RESET = h("wickra_counterattack_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COUNTERATTACK_FREE = h("wickra_counterattack_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CRAB_NEW = h("wickra_crab_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CRAB_UPDATE = h("wickra_crab_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CRAB_BATCH = h("wickra_crab_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CRAB_RESET = h("wickra_crab_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CRAB_FREE = h("wickra_crab_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUP_AND_HANDLE_NEW = h("wickra_cup_and_handle_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CUP_AND_HANDLE_UPDATE = h("wickra_cup_and_handle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CUP_AND_HANDLE_BATCH = h("wickra_cup_and_handle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CUP_AND_HANDLE_RESET = h("wickra_cup_and_handle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUP_AND_HANDLE_FREE = h("wickra_cup_and_handle_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CYPHER_NEW = h("wickra_cypher_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CYPHER_UPDATE = h("wickra_cypher_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CYPHER_BATCH = h("wickra_cypher_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_CYPHER_RESET = h("wickra_cypher_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CYPHER_FREE = h("wickra_cypher_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMAND_INDEX_NEW = h("wickra_demand_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DEMAND_INDEX_UPDATE = h("wickra_demand_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DEMAND_INDEX_BATCH = h("wickra_demand_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DEMAND_INDEX_RESET = h("wickra_demand_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMAND_INDEX_FREE = h("wickra_demand_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOJI_NEW = h("wickra_doji_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DOJI_UPDATE = h("wickra_doji_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DOJI_BATCH = h("wickra_doji_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DOJI_RESET = h("wickra_doji_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOJI_FREE = h("wickra_doji_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOJI_STAR_NEW = h("wickra_doji_star_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DOJI_STAR_UPDATE = h("wickra_doji_star_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DOJI_STAR_BATCH = h("wickra_doji_star_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DOJI_STAR_RESET = h("wickra_doji_star_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOJI_STAR_FREE = h("wickra_doji_star_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOUBLE_TOP_BOTTOM_NEW = h("wickra_double_top_bottom_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DOUBLE_TOP_BOTTOM_UPDATE = h("wickra_double_top_bottom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DOUBLE_TOP_BOTTOM_BATCH = h("wickra_double_top_bottom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DOUBLE_TOP_BOTTOM_RESET = h("wickra_double_top_bottom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOUBLE_TOP_BOTTOM_FREE = h("wickra_double_top_bottom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOWNSIDE_GAP_THREE_METHODS_NEW = h("wickra_downside_gap_three_methods_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DOWNSIDE_GAP_THREE_METHODS_UPDATE = h("wickra_downside_gap_three_methods_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DOWNSIDE_GAP_THREE_METHODS_BATCH = h("wickra_downside_gap_three_methods_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DOWNSIDE_GAP_THREE_METHODS_RESET = h("wickra_downside_gap_three_methods_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOWNSIDE_GAP_THREE_METHODS_FREE = h("wickra_downside_gap_three_methods_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DRAGONFLY_DOJI_NEW = h("wickra_dragonfly_doji_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DRAGONFLY_DOJI_UPDATE = h("wickra_dragonfly_doji_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DRAGONFLY_DOJI_BATCH = h("wickra_dragonfly_doji_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DRAGONFLY_DOJI_RESET = h("wickra_dragonfly_doji_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DRAGONFLY_DOJI_FREE = h("wickra_dragonfly_doji_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DUMPLING_TOP_NEW = h("wickra_dumpling_top_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DUMPLING_TOP_UPDATE = h("wickra_dumpling_top_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DUMPLING_TOP_BATCH = h("wickra_dumpling_top_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DUMPLING_TOP_RESET = h("wickra_dumpling_top_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DUMPLING_TOP_FREE = h("wickra_dumpling_top_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DX_NEW = h("wickra_dx_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DX_UPDATE = h("wickra_dx_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_DX_BATCH = h("wickra_dx_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DX_RESET = h("wickra_dx_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DX_FREE = h("wickra_dx_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EASE_OF_MOVEMENT_NEW = h("wickra_ease_of_movement_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EASE_OF_MOVEMENT_UPDATE = h("wickra_ease_of_movement_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_EASE_OF_MOVEMENT_BATCH = h("wickra_ease_of_movement_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EASE_OF_MOVEMENT_RESET = h("wickra_ease_of_movement_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EASE_OF_MOVEMENT_FREE = h("wickra_ease_of_movement_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ENGULFING_NEW = h("wickra_engulfing_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ENGULFING_UPDATE = h("wickra_engulfing_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ENGULFING_BATCH = h("wickra_engulfing_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ENGULFING_RESET = h("wickra_engulfing_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ENGULFING_FREE = h("wickra_engulfing_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EVENING_DOJI_STAR_NEW = h("wickra_evening_doji_star_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_EVENING_DOJI_STAR_UPDATE = h("wickra_evening_doji_star_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_EVENING_DOJI_STAR_BATCH = h("wickra_evening_doji_star_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EVENING_DOJI_STAR_RESET = h("wickra_evening_doji_star_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EVENING_DOJI_STAR_FREE = h("wickra_evening_doji_star_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init9() { + WICKRA_EVWMA_NEW = h("wickra_evwma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EVWMA_UPDATE = h("wickra_evwma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_EVWMA_BATCH = h("wickra_evwma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_EVWMA_RESET = h("wickra_evwma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EVWMA_FREE = h("wickra_evwma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FALLING_THREE_METHODS_NEW = h("wickra_falling_three_methods_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FALLING_THREE_METHODS_UPDATE = h("wickra_falling_three_methods_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FALLING_THREE_METHODS_BATCH = h("wickra_falling_three_methods_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FALLING_THREE_METHODS_RESET = h("wickra_falling_three_methods_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FALLING_THREE_METHODS_FREE = h("wickra_falling_three_methods_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FLAG_PENNANT_NEW = h("wickra_flag_pennant_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FLAG_PENNANT_UPDATE = h("wickra_flag_pennant_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FLAG_PENNANT_BATCH = h("wickra_flag_pennant_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FLAG_PENNANT_RESET = h("wickra_flag_pennant_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FLAG_PENNANT_FREE = h("wickra_flag_pennant_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FORCE_INDEX_NEW = h("wickra_force_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FORCE_INDEX_UPDATE = h("wickra_force_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FORCE_INDEX_BATCH = h("wickra_force_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FORCE_INDEX_RESET = h("wickra_force_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FORCE_INDEX_FREE = h("wickra_force_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRY_PAN_BOTTOM_NEW = h("wickra_fry_pan_bottom_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FRY_PAN_BOTTOM_UPDATE = h("wickra_fry_pan_bottom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FRY_PAN_BOTTOM_BATCH = h("wickra_fry_pan_bottom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_FRY_PAN_BOTTOM_RESET = h("wickra_fry_pan_bottom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRY_PAN_BOTTOM_FREE = h("wickra_fry_pan_bottom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAP_SIDE_BY_SIDE_WHITE_NEW = h("wickra_gap_side_by_side_white_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_GAP_SIDE_BY_SIDE_WHITE_UPDATE = h("wickra_gap_side_by_side_white_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_GAP_SIDE_BY_SIDE_WHITE_BATCH = h("wickra_gap_side_by_side_white_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GAP_SIDE_BY_SIDE_WHITE_RESET = h("wickra_gap_side_by_side_white_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GAP_SIDE_BY_SIDE_WHITE_FREE = h("wickra_gap_side_by_side_white_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARMAN_KLASS_VOLATILITY_NEW = h("wickra_garman_klass_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_GARMAN_KLASS_VOLATILITY_UPDATE = h("wickra_garman_klass_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_GARMAN_KLASS_VOLATILITY_BATCH = h("wickra_garman_klass_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GARMAN_KLASS_VOLATILITY_RESET = h("wickra_garman_klass_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARMAN_KLASS_VOLATILITY_FREE = h("wickra_garman_klass_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARTLEY_NEW = h("wickra_gartley_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_GARTLEY_UPDATE = h("wickra_gartley_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_GARTLEY_BATCH = h("wickra_gartley_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GARTLEY_RESET = h("wickra_gartley_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GARTLEY_FREE = h("wickra_gartley_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GRAVESTONE_DOJI_NEW = h("wickra_gravestone_doji_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_GRAVESTONE_DOJI_UPDATE = h("wickra_gravestone_doji_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_GRAVESTONE_DOJI_BATCH = h("wickra_gravestone_doji_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_GRAVESTONE_DOJI_RESET = h("wickra_gravestone_doji_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GRAVESTONE_DOJI_FREE = h("wickra_gravestone_doji_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HAMMER_NEW = h("wickra_hammer_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HAMMER_UPDATE = h("wickra_hammer_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HAMMER_BATCH = h("wickra_hammer_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HAMMER_RESET = h("wickra_hammer_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HAMMER_FREE = h("wickra_hammer_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HANGING_MAN_NEW = h("wickra_hanging_man_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HANGING_MAN_UPDATE = h("wickra_hanging_man_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HANGING_MAN_BATCH = h("wickra_hanging_man_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HANGING_MAN_RESET = h("wickra_hanging_man_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HANGING_MAN_FREE = h("wickra_hanging_man_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HARAMI_NEW = h("wickra_harami_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HARAMI_UPDATE = h("wickra_harami_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HARAMI_BATCH = h("wickra_harami_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HARAMI_RESET = h("wickra_harami_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HARAMI_FREE = h("wickra_harami_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HARAMI_CROSS_NEW = h("wickra_harami_cross_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HARAMI_CROSS_UPDATE = h("wickra_harami_cross_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HARAMI_CROSS_BATCH = h("wickra_harami_cross_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HARAMI_CROSS_RESET = h("wickra_harami_cross_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HARAMI_CROSS_FREE = h("wickra_harami_cross_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEAD_AND_SHOULDERS_NEW = h("wickra_head_and_shoulders_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HEAD_AND_SHOULDERS_UPDATE = h("wickra_head_and_shoulders_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HEAD_AND_SHOULDERS_BATCH = h("wickra_head_and_shoulders_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HEAD_AND_SHOULDERS_RESET = h("wickra_head_and_shoulders_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEAD_AND_SHOULDERS_FREE = h("wickra_head_and_shoulders_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEIKIN_ASHI_OSCILLATOR_NEW = h("wickra_heikin_ashi_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HEIKIN_ASHI_OSCILLATOR_UPDATE = h("wickra_heikin_ashi_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HEIKIN_ASHI_OSCILLATOR_BATCH = h("wickra_heikin_ashi_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HEIKIN_ASHI_OSCILLATOR_RESET = h("wickra_heikin_ashi_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEIKIN_ASHI_OSCILLATOR_FREE = h("wickra_heikin_ashi_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_RANGE_NEW = h("wickra_high_low_range_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HIGH_LOW_RANGE_UPDATE = h("wickra_high_low_range_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HIGH_LOW_RANGE_BATCH = h("wickra_high_low_range_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HIGH_LOW_RANGE_RESET = h("wickra_high_low_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_RANGE_FREE = h("wickra_high_low_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_WAVE_NEW = h("wickra_high_wave_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HIGH_WAVE_UPDATE = h("wickra_high_wave_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HIGH_WAVE_BATCH = h("wickra_high_wave_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HIGH_WAVE_RESET = h("wickra_high_wave_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_WAVE_FREE = h("wickra_high_wave_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIKKAKE_NEW = h("wickra_hikkake_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HIKKAKE_UPDATE = h("wickra_hikkake_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HIKKAKE_BATCH = h("wickra_hikkake_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HIKKAKE_RESET = h("wickra_hikkake_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIKKAKE_FREE = h("wickra_hikkake_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIKKAKE_MODIFIED_NEW = h("wickra_hikkake_modified_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HIKKAKE_MODIFIED_UPDATE = h("wickra_hikkake_modified_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HIKKAKE_MODIFIED_BATCH = h("wickra_hikkake_modified_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HIKKAKE_MODIFIED_RESET = h("wickra_hikkake_modified_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIKKAKE_MODIFIED_FREE = h("wickra_hikkake_modified_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HI_LO_ACTIVATOR_NEW = h("wickra_hi_lo_activator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HI_LO_ACTIVATOR_UPDATE = h("wickra_hi_lo_activator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HI_LO_ACTIVATOR_BATCH = h("wickra_hi_lo_activator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HI_LO_ACTIVATOR_RESET = h("wickra_hi_lo_activator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HI_LO_ACTIVATOR_FREE = h("wickra_hi_lo_activator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HOMING_PIGEON_NEW = h("wickra_homing_pigeon_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HOMING_PIGEON_UPDATE = h("wickra_homing_pigeon_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_HOMING_PIGEON_BATCH = h("wickra_homing_pigeon_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_HOMING_PIGEON_RESET = h("wickra_homing_pigeon_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HOMING_PIGEON_FREE = h("wickra_homing_pigeon_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IDENTICAL_THREE_CROWS_NEW = h("wickra_identical_three_crows_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_IDENTICAL_THREE_CROWS_UPDATE = h("wickra_identical_three_crows_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_IDENTICAL_THREE_CROWS_BATCH = h("wickra_identical_three_crows_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_IDENTICAL_THREE_CROWS_RESET = h("wickra_identical_three_crows_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IDENTICAL_THREE_CROWS_FREE = h("wickra_identical_three_crows_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IN_NECK_NEW = h("wickra_in_neck_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_IN_NECK_UPDATE = h("wickra_in_neck_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_IN_NECK_BATCH = h("wickra_in_neck_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_IN_NECK_RESET = h("wickra_in_neck_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IN_NECK_FREE = h("wickra_in_neck_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INERTIA_NEW = h("wickra_inertia_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_INERTIA_UPDATE = h("wickra_inertia_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_INERTIA_BATCH = h("wickra_inertia_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INERTIA_RESET = h("wickra_inertia_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INERTIA_FREE = h("wickra_inertia_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init10() { + WICKRA_INTRADAY_INTENSITY_NEW = h("wickra_intraday_intensity_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_INTRADAY_INTENSITY_UPDATE = h("wickra_intraday_intensity_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_INTRADAY_INTENSITY_BATCH = h("wickra_intraday_intensity_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INTRADAY_INTENSITY_RESET = h("wickra_intraday_intensity_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INTRADAY_INTENSITY_FREE = h("wickra_intraday_intensity_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INTRADAY_MOMENTUM_INDEX_NEW = h("wickra_intraday_momentum_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_INTRADAY_MOMENTUM_INDEX_UPDATE = h("wickra_intraday_momentum_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_INTRADAY_MOMENTUM_INDEX_BATCH = h("wickra_intraday_momentum_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INTRADAY_MOMENTUM_INDEX_RESET = h("wickra_intraday_momentum_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INTRADAY_MOMENTUM_INDEX_FREE = h("wickra_intraday_momentum_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INVERTED_HAMMER_NEW = h("wickra_inverted_hammer_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_INVERTED_HAMMER_UPDATE = h("wickra_inverted_hammer_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_INVERTED_HAMMER_BATCH = h("wickra_inverted_hammer_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_INVERTED_HAMMER_RESET = h("wickra_inverted_hammer_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INVERTED_HAMMER_FREE = h("wickra_inverted_hammer_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KICKING_NEW = h("wickra_kicking_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_KICKING_UPDATE = h("wickra_kicking_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_KICKING_BATCH = h("wickra_kicking_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KICKING_RESET = h("wickra_kicking_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KICKING_FREE = h("wickra_kicking_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KICKING_BY_LENGTH_NEW = h("wickra_kicking_by_length_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_KICKING_BY_LENGTH_UPDATE = h("wickra_kicking_by_length_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_KICKING_BY_LENGTH_BATCH = h("wickra_kicking_by_length_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KICKING_BY_LENGTH_RESET = h("wickra_kicking_by_length_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KICKING_BY_LENGTH_FREE = h("wickra_kicking_by_length_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KVO_NEW = h("wickra_kvo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_KVO_UPDATE = h("wickra_kvo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_KVO_BATCH = h("wickra_kvo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_KVO_RESET = h("wickra_kvo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KVO_FREE = h("wickra_kvo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LADDER_BOTTOM_NEW = h("wickra_ladder_bottom_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_LADDER_BOTTOM_UPDATE = h("wickra_ladder_bottom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_LADDER_BOTTOM_BATCH = h("wickra_ladder_bottom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LADDER_BOTTOM_RESET = h("wickra_ladder_bottom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LADDER_BOTTOM_FREE = h("wickra_ladder_bottom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_LEGGED_DOJI_NEW = h("wickra_long_legged_doji_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_LONG_LEGGED_DOJI_UPDATE = h("wickra_long_legged_doji_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_LONG_LEGGED_DOJI_BATCH = h("wickra_long_legged_doji_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LONG_LEGGED_DOJI_RESET = h("wickra_long_legged_doji_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_LEGGED_DOJI_FREE = h("wickra_long_legged_doji_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_LINE_NEW = h("wickra_long_line_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_LONG_LINE_UPDATE = h("wickra_long_line_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_LONG_LINE_BATCH = h("wickra_long_line_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_LONG_LINE_RESET = h("wickra_long_line_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_LINE_FREE = h("wickra_long_line_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARKET_FACILITATION_INDEX_NEW = h("wickra_market_facilitation_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MARKET_FACILITATION_INDEX_UPDATE = h("wickra_market_facilitation_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MARKET_FACILITATION_INDEX_BATCH = h("wickra_market_facilitation_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MARKET_FACILITATION_INDEX_RESET = h("wickra_market_facilitation_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARKET_FACILITATION_INDEX_FREE = h("wickra_market_facilitation_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARUBOZU_NEW = h("wickra_marubozu_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MARUBOZU_UPDATE = h("wickra_marubozu_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MARUBOZU_BATCH = h("wickra_marubozu_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MARUBOZU_RESET = h("wickra_marubozu_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MARUBOZU_FREE = h("wickra_marubozu_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MASS_INDEX_NEW = h("wickra_mass_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_MASS_INDEX_UPDATE = h("wickra_mass_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MASS_INDEX_BATCH = h("wickra_mass_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MASS_INDEX_RESET = h("wickra_mass_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MASS_INDEX_FREE = h("wickra_mass_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAT_HOLD_NEW = h("wickra_mat_hold_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MAT_HOLD_UPDATE = h("wickra_mat_hold_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MAT_HOLD_BATCH = h("wickra_mat_hold_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MAT_HOLD_RESET = h("wickra_mat_hold_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAT_HOLD_FREE = h("wickra_mat_hold_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MATCHING_LOW_NEW = h("wickra_matching_low_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MATCHING_LOW_UPDATE = h("wickra_matching_low_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MATCHING_LOW_BATCH = h("wickra_matching_low_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MATCHING_LOW_RESET = h("wickra_matching_low_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MATCHING_LOW_FREE = h("wickra_matching_low_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_PRICE_NEW = h("wickra_median_price_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MEDIAN_PRICE_UPDATE = h("wickra_median_price_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MEDIAN_PRICE_BATCH = h("wickra_median_price_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MEDIAN_PRICE_RESET = h("wickra_median_price_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_PRICE_FREE = h("wickra_median_price_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MFI_NEW = h("wickra_mfi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MFI_UPDATE = h("wickra_mfi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MFI_BATCH = h("wickra_mfi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MFI_RESET = h("wickra_mfi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MFI_FREE = h("wickra_mfi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MID_PRICE_NEW = h("wickra_mid_price_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MID_PRICE_UPDATE = h("wickra_mid_price_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MID_PRICE_BATCH = h("wickra_mid_price_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MID_PRICE_RESET = h("wickra_mid_price_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MID_PRICE_FREE = h("wickra_mid_price_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MINUS_DI_NEW = h("wickra_minus_di_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MINUS_DI_UPDATE = h("wickra_minus_di_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MINUS_DI_BATCH = h("wickra_minus_di_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MINUS_DI_RESET = h("wickra_minus_di_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MINUS_DI_FREE = h("wickra_minus_di_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MINUS_DM_NEW = h("wickra_minus_dm_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MINUS_DM_UPDATE = h("wickra_minus_dm_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MINUS_DM_BATCH = h("wickra_minus_dm_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MINUS_DM_RESET = h("wickra_minus_dm_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MINUS_DM_FREE = h("wickra_minus_dm_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MORNING_DOJI_STAR_NEW = h("wickra_morning_doji_star_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MORNING_DOJI_STAR_UPDATE = h("wickra_morning_doji_star_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MORNING_DOJI_STAR_BATCH = h("wickra_morning_doji_star_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MORNING_DOJI_STAR_RESET = h("wickra_morning_doji_star_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MORNING_DOJI_STAR_FREE = h("wickra_morning_doji_star_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MORNING_EVENING_STAR_NEW = h("wickra_morning_evening_star_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MORNING_EVENING_STAR_UPDATE = h("wickra_morning_evening_star_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_MORNING_EVENING_STAR_BATCH = h("wickra_morning_evening_star_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MORNING_EVENING_STAR_RESET = h("wickra_morning_evening_star_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MORNING_EVENING_STAR_FREE = h("wickra_morning_evening_star_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NAKED_POC_NEW = h("wickra_naked_poc_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_NAKED_POC_UPDATE = h("wickra_naked_poc_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_NAKED_POC_BATCH = h("wickra_naked_poc_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_NAKED_POC_RESET = h("wickra_naked_poc_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NAKED_POC_FREE = h("wickra_naked_poc_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NATR_NEW = h("wickra_natr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_NATR_UPDATE = h("wickra_natr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_NATR_BATCH = h("wickra_natr_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_NATR_RESET = h("wickra_natr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NATR_FREE = h("wickra_natr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NEW_PRICE_LINES_NEW = h("wickra_new_price_lines_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_NEW_PRICE_LINES_UPDATE = h("wickra_new_price_lines_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_NEW_PRICE_LINES_BATCH = h("wickra_new_price_lines_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_NEW_PRICE_LINES_RESET = h("wickra_new_price_lines_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NEW_PRICE_LINES_FREE = h("wickra_new_price_lines_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init11() { + WICKRA_NVI_NEW = h("wickra_nvi_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_NVI_UPDATE = h("wickra_nvi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_NVI_BATCH = h("wickra_nvi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_NVI_RESET = h("wickra_nvi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NVI_FREE = h("wickra_nvi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OBV_NEW = h("wickra_obv_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_OBV_UPDATE = h("wickra_obv_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OBV_BATCH = h("wickra_obv_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_OBV_RESET = h("wickra_obv_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OBV_FREE = h("wickra_obv_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ON_NECK_NEW = h("wickra_on_neck_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ON_NECK_UPDATE = h("wickra_on_neck_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ON_NECK_BATCH = h("wickra_on_neck_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ON_NECK_RESET = h("wickra_on_neck_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ON_NECK_FREE = h("wickra_on_neck_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPENING_MARUBOZU_NEW = h("wickra_opening_marubozu_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_OPENING_MARUBOZU_UPDATE = h("wickra_opening_marubozu_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OPENING_MARUBOZU_BATCH = h("wickra_opening_marubozu_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_OPENING_MARUBOZU_RESET = h("wickra_opening_marubozu_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPENING_MARUBOZU_FREE = h("wickra_opening_marubozu_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OVERNIGHT_GAP_NEW = h("wickra_overnight_gap_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_OVERNIGHT_GAP_UPDATE = h("wickra_overnight_gap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OVERNIGHT_GAP_BATCH = h("wickra_overnight_gap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_OVERNIGHT_GAP_RESET = h("wickra_overnight_gap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OVERNIGHT_GAP_FREE = h("wickra_overnight_gap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PARKINSON_VOLATILITY_NEW = h("wickra_parkinson_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PARKINSON_VOLATILITY_UPDATE = h("wickra_parkinson_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PARKINSON_VOLATILITY_BATCH = h("wickra_parkinson_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PARKINSON_VOLATILITY_RESET = h("wickra_parkinson_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PARKINSON_VOLATILITY_FREE = h("wickra_parkinson_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PGO_NEW = h("wickra_pgo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PGO_UPDATE = h("wickra_pgo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PGO_BATCH = h("wickra_pgo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PGO_RESET = h("wickra_pgo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PGO_FREE = h("wickra_pgo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIERCING_DARK_CLOUD_NEW = h("wickra_piercing_dark_cloud_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_PIERCING_DARK_CLOUD_UPDATE = h("wickra_piercing_dark_cloud_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PIERCING_DARK_CLOUD_BATCH = h("wickra_piercing_dark_cloud_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PIERCING_DARK_CLOUD_RESET = h("wickra_piercing_dark_cloud_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIERCING_DARK_CLOUD_FREE = h("wickra_piercing_dark_cloud_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIVOT_REVERSAL_NEW = h("wickra_pivot_reversal_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PIVOT_REVERSAL_UPDATE = h("wickra_pivot_reversal_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PIVOT_REVERSAL_BATCH = h("wickra_pivot_reversal_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PIVOT_REVERSAL_RESET = h("wickra_pivot_reversal_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIVOT_REVERSAL_FREE = h("wickra_pivot_reversal_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PLUS_DI_NEW = h("wickra_plus_di_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PLUS_DI_UPDATE = h("wickra_plus_di_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PLUS_DI_BATCH = h("wickra_plus_di_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PLUS_DI_RESET = h("wickra_plus_di_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PLUS_DI_FREE = h("wickra_plus_di_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PLUS_DM_NEW = h("wickra_plus_dm_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PLUS_DM_UPDATE = h("wickra_plus_dm_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PLUS_DM_BATCH = h("wickra_plus_dm_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PLUS_DM_RESET = h("wickra_plus_dm_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PLUS_DM_FREE = h("wickra_plus_dm_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROFILE_SHAPE_NEW = h("wickra_profile_shape_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PROFILE_SHAPE_UPDATE = h("wickra_profile_shape_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PROFILE_SHAPE_BATCH = h("wickra_profile_shape_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PROFILE_SHAPE_RESET = h("wickra_profile_shape_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROFILE_SHAPE_FREE = h("wickra_profile_shape_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROJECTION_OSCILLATOR_NEW = h("wickra_projection_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PROJECTION_OSCILLATOR_UPDATE = h("wickra_projection_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PROJECTION_OSCILLATOR_BATCH = h("wickra_projection_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PROJECTION_OSCILLATOR_RESET = h("wickra_projection_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROJECTION_OSCILLATOR_FREE = h("wickra_projection_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PSAR_NEW = h("wickra_psar_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_PSAR_UPDATE = h("wickra_psar_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PSAR_BATCH = h("wickra_psar_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PSAR_RESET = h("wickra_psar_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PSAR_FREE = h("wickra_psar_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PVI_NEW = h("wickra_pvi_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_PVI_UPDATE = h("wickra_pvi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PVI_BATCH = h("wickra_pvi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_PVI_RESET = h("wickra_pvi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PVI_FREE = h("wickra_pvi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QSTICK_NEW = h("wickra_qstick_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_QSTICK_UPDATE = h("wickra_qstick_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_QSTICK_BATCH = h("wickra_qstick_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_QSTICK_RESET = h("wickra_qstick_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QSTICK_FREE = h("wickra_qstick_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RECTANGLE_RANGE_NEW = h("wickra_rectangle_range_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_RECTANGLE_RANGE_UPDATE = h("wickra_rectangle_range_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_RECTANGLE_RANGE_BATCH = h("wickra_rectangle_range_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RECTANGLE_RANGE_RESET = h("wickra_rectangle_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RECTANGLE_RANGE_FREE = h("wickra_rectangle_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RICKSHAW_MAN_NEW = h("wickra_rickshaw_man_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_RICKSHAW_MAN_UPDATE = h("wickra_rickshaw_man_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_RICKSHAW_MAN_BATCH = h("wickra_rickshaw_man_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RICKSHAW_MAN_RESET = h("wickra_rickshaw_man_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RICKSHAW_MAN_FREE = h("wickra_rickshaw_man_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RISING_THREE_METHODS_NEW = h("wickra_rising_three_methods_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_RISING_THREE_METHODS_UPDATE = h("wickra_rising_three_methods_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_RISING_THREE_METHODS_BATCH = h("wickra_rising_three_methods_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RISING_THREE_METHODS_RESET = h("wickra_rising_three_methods_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RISING_THREE_METHODS_FREE = h("wickra_rising_three_methods_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROGERS_SATCHELL_VOLATILITY_NEW = h("wickra_rogers_satchell_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_ROGERS_SATCHELL_VOLATILITY_UPDATE = h("wickra_rogers_satchell_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ROGERS_SATCHELL_VOLATILITY_BATCH = h("wickra_rogers_satchell_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROGERS_SATCHELL_VOLATILITY_RESET = h("wickra_rogers_satchell_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROGERS_SATCHELL_VOLATILITY_FREE = h("wickra_rogers_satchell_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RVI_NEW = h("wickra_rvi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RVI_UPDATE = h("wickra_rvi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_RVI_BATCH = h("wickra_rvi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_RVI_RESET = h("wickra_rvi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RVI_FREE = h("wickra_rvi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SAR_EXT_NEW = h("wickra_sar_ext_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_SAR_EXT_UPDATE = h("wickra_sar_ext_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SAR_EXT_BATCH = h("wickra_sar_ext_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SAR_EXT_RESET = h("wickra_sar_ext_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SAR_EXT_FREE = h("wickra_sar_ext_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SEASONAL_Z_SCORE_NEW = h("wickra_seasonal_z_score_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_SEASONAL_Z_SCORE_UPDATE = h("wickra_seasonal_z_score_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SEASONAL_Z_SCORE_BATCH = h("wickra_seasonal_z_score_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SEASONAL_Z_SCORE_RESET = h("wickra_seasonal_z_score_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SEASONAL_Z_SCORE_FREE = h("wickra_seasonal_z_score_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SEPARATING_LINES_NEW = h("wickra_separating_lines_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SEPARATING_LINES_UPDATE = h("wickra_separating_lines_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SEPARATING_LINES_BATCH = h("wickra_separating_lines_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SEPARATING_LINES_RESET = h("wickra_separating_lines_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SEPARATING_LINES_FREE = h("wickra_separating_lines_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init12() { + WICKRA_SESSION_VWAP_NEW = h("wickra_session_vwap_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_SESSION_VWAP_UPDATE = h("wickra_session_vwap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SESSION_VWAP_BATCH = h("wickra_session_vwap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SESSION_VWAP_RESET = h("wickra_session_vwap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SESSION_VWAP_FREE = h("wickra_session_vwap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHARK_NEW = h("wickra_shark_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SHARK_UPDATE = h("wickra_shark_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SHARK_BATCH = h("wickra_shark_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SHARK_RESET = h("wickra_shark_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHARK_FREE = h("wickra_shark_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHOOTING_STAR_NEW = h("wickra_shooting_star_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SHOOTING_STAR_UPDATE = h("wickra_shooting_star_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SHOOTING_STAR_BATCH = h("wickra_shooting_star_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SHOOTING_STAR_RESET = h("wickra_shooting_star_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHOOTING_STAR_FREE = h("wickra_shooting_star_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHORT_LINE_NEW = h("wickra_short_line_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SHORT_LINE_UPDATE = h("wickra_short_line_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SHORT_LINE_BATCH = h("wickra_short_line_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SHORT_LINE_RESET = h("wickra_short_line_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SHORT_LINE_FREE = h("wickra_short_line_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINGLE_PRINTS_NEW = h("wickra_single_prints_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_SINGLE_PRINTS_UPDATE = h("wickra_single_prints_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SINGLE_PRINTS_BATCH = h("wickra_single_prints_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SINGLE_PRINTS_RESET = h("wickra_single_prints_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SINGLE_PRINTS_FREE = h("wickra_single_prints_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMI_NEW = h("wickra_smi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_SMI_UPDATE = h("wickra_smi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SMI_BATCH = h("wickra_smi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SMI_RESET = h("wickra_smi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMI_FREE = h("wickra_smi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPINNING_TOP_NEW = h("wickra_spinning_top_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SPINNING_TOP_UPDATE = h("wickra_spinning_top_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_SPINNING_TOP_BATCH = h("wickra_spinning_top_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_SPINNING_TOP_RESET = h("wickra_spinning_top_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPINNING_TOP_FREE = h("wickra_spinning_top_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STALLED_PATTERN_NEW = h("wickra_stalled_pattern_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_STALLED_PATTERN_UPDATE = h("wickra_stalled_pattern_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_STALLED_PATTERN_BATCH = h("wickra_stalled_pattern_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STALLED_PATTERN_RESET = h("wickra_stalled_pattern_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STALLED_PATTERN_FREE = h("wickra_stalled_pattern_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STICK_SANDWICH_NEW = h("wickra_stick_sandwich_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_STICK_SANDWICH_UPDATE = h("wickra_stick_sandwich_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_STICK_SANDWICH_BATCH = h("wickra_stick_sandwich_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STICK_SANDWICH_RESET = h("wickra_stick_sandwich_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STICK_SANDWICH_FREE = h("wickra_stick_sandwich_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCHASTIC_CCI_NEW = h("wickra_stochastic_cci_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_STOCHASTIC_CCI_UPDATE = h("wickra_stochastic_cci_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_STOCHASTIC_CCI_BATCH = h("wickra_stochastic_cci_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_STOCHASTIC_CCI_RESET = h("wickra_stochastic_cci_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCHASTIC_CCI_FREE = h("wickra_stochastic_cci_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAKURI_NEW = h("wickra_takuri_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TAKURI_UPDATE = h("wickra_takuri_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TAKURI_BATCH = h("wickra_takuri_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TAKURI_RESET = h("wickra_takuri_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAKURI_FREE = h("wickra_takuri_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TASUKI_GAP_NEW = h("wickra_tasuki_gap_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TASUKI_GAP_UPDATE = h("wickra_tasuki_gap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TASUKI_GAP_BATCH = h("wickra_tasuki_gap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TASUKI_GAP_RESET = h("wickra_tasuki_gap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TASUKI_GAP_FREE = h("wickra_tasuki_gap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CAMOUFLAGE_NEW = h("wickra_td_camouflage_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_CAMOUFLAGE_UPDATE = h("wickra_td_camouflage_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_CAMOUFLAGE_BATCH = h("wickra_td_camouflage_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_CAMOUFLAGE_RESET = h("wickra_td_camouflage_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CAMOUFLAGE_FREE = h("wickra_td_camouflage_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CLOP_NEW = h("wickra_td_clop_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_CLOP_UPDATE = h("wickra_td_clop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_CLOP_BATCH = h("wickra_td_clop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_CLOP_RESET = h("wickra_td_clop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CLOP_FREE = h("wickra_td_clop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CLOPWIN_NEW = h("wickra_td_clopwin_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_CLOPWIN_UPDATE = h("wickra_td_clopwin_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_CLOPWIN_BATCH = h("wickra_td_clopwin_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_CLOPWIN_RESET = h("wickra_td_clopwin_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_CLOPWIN_FREE = h("wickra_td_clopwin_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_COMBO_NEW = h("wickra_td_combo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_COMBO_UPDATE = h("wickra_td_combo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_COMBO_BATCH = h("wickra_td_combo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_COMBO_RESET = h("wickra_td_combo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_COMBO_FREE = h("wickra_td_combo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_COUNTDOWN_NEW = h("wickra_td_countdown_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_COUNTDOWN_UPDATE = h("wickra_td_countdown_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_COUNTDOWN_BATCH = h("wickra_td_countdown_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_COUNTDOWN_RESET = h("wickra_td_countdown_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_COUNTDOWN_FREE = h("wickra_td_countdown_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_DE_MARKER_NEW = h("wickra_td_de_marker_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TD_DE_MARKER_UPDATE = h("wickra_td_de_marker_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_DE_MARKER_BATCH = h("wickra_td_de_marker_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_DE_MARKER_RESET = h("wickra_td_de_marker_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_DE_MARKER_FREE = h("wickra_td_de_marker_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_DIFFERENTIAL_NEW = h("wickra_td_differential_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_DIFFERENTIAL_UPDATE = h("wickra_td_differential_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_DIFFERENTIAL_BATCH = h("wickra_td_differential_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_DIFFERENTIAL_RESET = h("wickra_td_differential_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_DIFFERENTIAL_FREE = h("wickra_td_differential_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_D_WAVE_NEW = h("wickra_td_d_wave_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TD_D_WAVE_UPDATE = h("wickra_td_d_wave_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_D_WAVE_BATCH = h("wickra_td_d_wave_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_D_WAVE_RESET = h("wickra_td_d_wave_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_D_WAVE_FREE = h("wickra_td_d_wave_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_OPEN_NEW = h("wickra_td_open_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_OPEN_UPDATE = h("wickra_td_open_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_OPEN_BATCH = h("wickra_td_open_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_OPEN_RESET = h("wickra_td_open_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_OPEN_FREE = h("wickra_td_open_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_PRESSURE_NEW = h("wickra_td_pressure_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TD_PRESSURE_UPDATE = h("wickra_td_pressure_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_PRESSURE_BATCH = h("wickra_td_pressure_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_PRESSURE_RESET = h("wickra_td_pressure_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_PRESSURE_FREE = h("wickra_td_pressure_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_PROPULSION_NEW = h("wickra_td_propulsion_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_PROPULSION_UPDATE = h("wickra_td_propulsion_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_PROPULSION_BATCH = h("wickra_td_propulsion_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_PROPULSION_RESET = h("wickra_td_propulsion_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_PROPULSION_FREE = h("wickra_td_propulsion_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_REI_NEW = h("wickra_td_rei_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TD_REI_UPDATE = h("wickra_td_rei_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_REI_BATCH = h("wickra_td_rei_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_REI_RESET = h("wickra_td_rei_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_REI_FREE = h("wickra_td_rei_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init13() { + WICKRA_TD_SETUP_NEW = h("wickra_td_setup_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_SETUP_UPDATE = h("wickra_td_setup_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_SETUP_BATCH = h("wickra_td_setup_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_SETUP_RESET = h("wickra_td_setup_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_SETUP_FREE = h("wickra_td_setup_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_TRAP_NEW = h("wickra_td_trap_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_TRAP_UPDATE = h("wickra_td_trap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TD_TRAP_BATCH = h("wickra_td_trap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TD_TRAP_RESET = h("wickra_td_trap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_TRAP_FREE = h("wickra_td_trap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_DRIVES_NEW = h("wickra_three_drives_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_DRIVES_UPDATE = h("wickra_three_drives_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_DRIVES_BATCH = h("wickra_three_drives_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_DRIVES_RESET = h("wickra_three_drives_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_DRIVES_FREE = h("wickra_three_drives_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_INSIDE_NEW = h("wickra_three_inside_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_INSIDE_UPDATE = h("wickra_three_inside_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_INSIDE_BATCH = h("wickra_three_inside_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_INSIDE_RESET = h("wickra_three_inside_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_INSIDE_FREE = h("wickra_three_inside_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_BREAK_NEW = h("wickra_three_line_break_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_THREE_LINE_BREAK_UPDATE = h("wickra_three_line_break_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_LINE_BREAK_BATCH = h("wickra_three_line_break_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_LINE_BREAK_RESET = h("wickra_three_line_break_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_BREAK_FREE = h("wickra_three_line_break_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_STRIKE_NEW = h("wickra_three_line_strike_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_LINE_STRIKE_UPDATE = h("wickra_three_line_strike_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_LINE_STRIKE_BATCH = h("wickra_three_line_strike_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_LINE_STRIKE_RESET = h("wickra_three_line_strike_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_STRIKE_FREE = h("wickra_three_line_strike_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_OUTSIDE_NEW = h("wickra_three_outside_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_OUTSIDE_UPDATE = h("wickra_three_outside_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_OUTSIDE_BATCH = h("wickra_three_outside_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_OUTSIDE_RESET = h("wickra_three_outside_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_OUTSIDE_FREE = h("wickra_three_outside_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_SOLDIERS_OR_CROWS_NEW = h("wickra_three_soldiers_or_crows_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_SOLDIERS_OR_CROWS_UPDATE = h("wickra_three_soldiers_or_crows_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_SOLDIERS_OR_CROWS_BATCH = h("wickra_three_soldiers_or_crows_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_SOLDIERS_OR_CROWS_RESET = h("wickra_three_soldiers_or_crows_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_SOLDIERS_OR_CROWS_FREE = h("wickra_three_soldiers_or_crows_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_STARS_IN_SOUTH_NEW = h("wickra_three_stars_in_south_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THREE_STARS_IN_SOUTH_UPDATE = h("wickra_three_stars_in_south_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THREE_STARS_IN_SOUTH_BATCH = h("wickra_three_stars_in_south_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THREE_STARS_IN_SOUTH_RESET = h("wickra_three_stars_in_south_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_STARS_IN_SOUTH_FREE = h("wickra_three_stars_in_south_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THRUSTING_NEW = h("wickra_thrusting_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_THRUSTING_UPDATE = h("wickra_thrusting_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_THRUSTING_BATCH = h("wickra_thrusting_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_THRUSTING_RESET = h("wickra_thrusting_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THRUSTING_FREE = h("wickra_thrusting_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TIME_BASED_STOP_NEW = h("wickra_time_based_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TIME_BASED_STOP_UPDATE = h("wickra_time_based_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TIME_BASED_STOP_BATCH = h("wickra_time_based_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TIME_BASED_STOP_RESET = h("wickra_time_based_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TIME_BASED_STOP_FREE = h("wickra_time_based_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TOWER_TOP_BOTTOM_NEW = h("wickra_tower_top_bottom_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TOWER_TOP_BOTTOM_UPDATE = h("wickra_tower_top_bottom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TOWER_TOP_BOTTOM_BATCH = h("wickra_tower_top_bottom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TOWER_TOP_BOTTOM_RESET = h("wickra_tower_top_bottom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TOWER_TOP_BOTTOM_FREE = h("wickra_tower_top_bottom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRADE_VOLUME_INDEX_NEW = h("wickra_trade_volume_index_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_TRADE_VOLUME_INDEX_UPDATE = h("wickra_trade_volume_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TRADE_VOLUME_INDEX_BATCH = h("wickra_trade_volume_index_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRADE_VOLUME_INDEX_RESET = h("wickra_trade_volume_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRADE_VOLUME_INDEX_FREE = h("wickra_trade_volume_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIANGLE_NEW = h("wickra_triangle_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TRIANGLE_UPDATE = h("wickra_triangle_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TRIANGLE_BATCH = h("wickra_triangle_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRIANGLE_RESET = h("wickra_triangle_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIANGLE_FREE = h("wickra_triangle_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIPLE_TOP_BOTTOM_NEW = h("wickra_triple_top_bottom_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TRIPLE_TOP_BOTTOM_UPDATE = h("wickra_triple_top_bottom_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TRIPLE_TOP_BOTTOM_BATCH = h("wickra_triple_top_bottom_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRIPLE_TOP_BOTTOM_RESET = h("wickra_triple_top_bottom_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIPLE_TOP_BOTTOM_FREE = h("wickra_triple_top_bottom_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRISTAR_NEW = h("wickra_tristar_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TRISTAR_UPDATE = h("wickra_tristar_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TRISTAR_BATCH = h("wickra_tristar_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRISTAR_RESET = h("wickra_tristar_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRISTAR_FREE = h("wickra_tristar_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRUE_RANGE_NEW = h("wickra_true_range_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TRUE_RANGE_UPDATE = h("wickra_true_range_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TRUE_RANGE_BATCH = h("wickra_true_range_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TRUE_RANGE_RESET = h("wickra_true_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRUE_RANGE_FREE = h("wickra_true_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSV_NEW = h("wickra_tsv_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TSV_UPDATE = h("wickra_tsv_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TSV_BATCH = h("wickra_tsv_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TSV_RESET = h("wickra_tsv_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TSV_FREE = h("wickra_tsv_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TTM_TREND_NEW = h("wickra_ttm_trend_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TTM_TREND_UPDATE = h("wickra_ttm_trend_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TTM_TREND_BATCH = h("wickra_ttm_trend_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TTM_TREND_RESET = h("wickra_ttm_trend_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TTM_TREND_FREE = h("wickra_ttm_trend_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TURN_OF_MONTH_NEW = h("wickra_turn_of_month_new", FunctionDescriptor.of(ADDRESS, JAVA_INT, JAVA_INT, JAVA_INT)); + WICKRA_TURN_OF_MONTH_UPDATE = h("wickra_turn_of_month_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TURN_OF_MONTH_BATCH = h("wickra_turn_of_month_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TURN_OF_MONTH_RESET = h("wickra_turn_of_month_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TURN_OF_MONTH_FREE = h("wickra_turn_of_month_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWEEZER_NEW = h("wickra_tweezer_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TWEEZER_UPDATE = h("wickra_tweezer_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TWEEZER_BATCH = h("wickra_tweezer_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TWEEZER_RESET = h("wickra_tweezer_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWEEZER_FREE = h("wickra_tweezer_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWIGGS_MONEY_FLOW_NEW = h("wickra_twiggs_money_flow_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TWIGGS_MONEY_FLOW_UPDATE = h("wickra_twiggs_money_flow_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TWIGGS_MONEY_FLOW_BATCH = h("wickra_twiggs_money_flow_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TWIGGS_MONEY_FLOW_RESET = h("wickra_twiggs_money_flow_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWIGGS_MONEY_FLOW_FREE = h("wickra_twiggs_money_flow_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWO_CROWS_NEW = h("wickra_two_crows_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TWO_CROWS_UPDATE = h("wickra_two_crows_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TWO_CROWS_BATCH = h("wickra_two_crows_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TWO_CROWS_RESET = h("wickra_two_crows_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TWO_CROWS_FREE = h("wickra_two_crows_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TYPICAL_PRICE_NEW = h("wickra_typical_price_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TYPICAL_PRICE_UPDATE = h("wickra_typical_price_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TYPICAL_PRICE_BATCH = h("wickra_typical_price_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TYPICAL_PRICE_RESET = h("wickra_typical_price_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TYPICAL_PRICE_FREE = h("wickra_typical_price_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init14() { + WICKRA_ULTIMATE_OSCILLATOR_NEW = h("wickra_ultimate_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ULTIMATE_OSCILLATOR_UPDATE = h("wickra_ultimate_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ULTIMATE_OSCILLATOR_BATCH = h("wickra_ultimate_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ULTIMATE_OSCILLATOR_RESET = h("wickra_ultimate_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ULTIMATE_OSCILLATOR_FREE = h("wickra_ultimate_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UNIQUE_THREE_RIVER_NEW = h("wickra_unique_three_river_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_UNIQUE_THREE_RIVER_UPDATE = h("wickra_unique_three_river_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_UNIQUE_THREE_RIVER_BATCH = h("wickra_unique_three_river_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_UNIQUE_THREE_RIVER_RESET = h("wickra_unique_three_river_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UNIQUE_THREE_RIVER_FREE = h("wickra_unique_three_river_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_GAP_THREE_METHODS_NEW = h("wickra_upside_gap_three_methods_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_UPSIDE_GAP_THREE_METHODS_UPDATE = h("wickra_upside_gap_three_methods_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_UPSIDE_GAP_THREE_METHODS_BATCH = h("wickra_upside_gap_three_methods_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_UPSIDE_GAP_THREE_METHODS_RESET = h("wickra_upside_gap_three_methods_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_GAP_THREE_METHODS_FREE = h("wickra_upside_gap_three_methods_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_GAP_TWO_CROWS_NEW = h("wickra_upside_gap_two_crows_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_UPSIDE_GAP_TWO_CROWS_UPDATE = h("wickra_upside_gap_two_crows_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_UPSIDE_GAP_TWO_CROWS_BATCH = h("wickra_upside_gap_two_crows_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_UPSIDE_GAP_TWO_CROWS_RESET = h("wickra_upside_gap_two_crows_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UPSIDE_GAP_TWO_CROWS_FREE = h("wickra_upside_gap_two_crows_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_RATIO_NEW = h("wickra_volatility_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VOLATILITY_RATIO_UPDATE = h("wickra_volatility_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VOLATILITY_RATIO_BATCH = h("wickra_volatility_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLATILITY_RATIO_RESET = h("wickra_volatility_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_RATIO_FREE = h("wickra_volatility_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLTY_STOP_NEW = h("wickra_volty_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_VOLTY_STOP_UPDATE = h("wickra_volty_stop_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VOLTY_STOP_BATCH = h("wickra_volty_stop_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLTY_STOP_RESET = h("wickra_volty_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLTY_STOP_FREE = h("wickra_volty_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_OSCILLATOR_NEW = h("wickra_volume_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VOLUME_OSCILLATOR_UPDATE = h("wickra_volume_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VOLUME_OSCILLATOR_BATCH = h("wickra_volume_oscillator_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_OSCILLATOR_RESET = h("wickra_volume_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_OSCILLATOR_FREE = h("wickra_volume_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_RSI_NEW = h("wickra_volume_rsi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_RSI_UPDATE = h("wickra_volume_rsi_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VOLUME_RSI_BATCH = h("wickra_volume_rsi_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_RSI_RESET = h("wickra_volume_rsi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_RSI_FREE = h("wickra_volume_rsi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_PRICE_TREND_NEW = h("wickra_volume_price_trend_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_VOLUME_PRICE_TREND_UPDATE = h("wickra_volume_price_trend_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VOLUME_PRICE_TREND_BATCH = h("wickra_volume_price_trend_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_PRICE_TREND_RESET = h("wickra_volume_price_trend_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_PRICE_TREND_FREE = h("wickra_volume_price_trend_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWAP_NEW = h("wickra_vwap_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_VWAP_UPDATE = h("wickra_vwap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VWAP_BATCH = h("wickra_vwap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VWAP_RESET = h("wickra_vwap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWAP_FREE = h("wickra_vwap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_VWAP_NEW = h("wickra_rolling_vwap_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_VWAP_UPDATE = h("wickra_rolling_vwap_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ROLLING_VWAP_BATCH = h("wickra_rolling_vwap_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ROLLING_VWAP_RESET = h("wickra_rolling_vwap_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLLING_VWAP_FREE = h("wickra_rolling_vwap_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWMA_NEW = h("wickra_vwma_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VWMA_UPDATE = h("wickra_vwma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VWMA_BATCH = h("wickra_vwma_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VWMA_RESET = h("wickra_vwma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWMA_FREE = h("wickra_vwma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VZO_NEW = h("wickra_vzo_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VZO_UPDATE = h("wickra_vzo_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VZO_BATCH = h("wickra_vzo_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VZO_RESET = h("wickra_vzo_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VZO_FREE = h("wickra_vzo_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAD_NEW = h("wickra_wad_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WAD_UPDATE = h("wickra_wad_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_WAD_BATCH = h("wickra_wad_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WAD_RESET = h("wickra_wad_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAD_FREE = h("wickra_wad_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WEDGE_NEW = h("wickra_wedge_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WEDGE_UPDATE = h("wickra_wedge_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_WEDGE_BATCH = h("wickra_wedge_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WEDGE_RESET = h("wickra_wedge_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WEDGE_FREE = h("wickra_wedge_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WEIGHTED_CLOSE_NEW = h("wickra_weighted_close_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WEIGHTED_CLOSE_UPDATE = h("wickra_weighted_close_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_WEIGHTED_CLOSE_BATCH = h("wickra_weighted_close_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WEIGHTED_CLOSE_RESET = h("wickra_weighted_close_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WEIGHTED_CLOSE_FREE = h("wickra_weighted_close_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WICK_RATIO_NEW = h("wickra_wick_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WICK_RATIO_UPDATE = h("wickra_wick_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_WICK_RATIO_BATCH = h("wickra_wick_ratio_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WICK_RATIO_RESET = h("wickra_wick_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WICK_RATIO_FREE = h("wickra_wick_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WILLIAMS_R_NEW = h("wickra_williams_r_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_WILLIAMS_R_UPDATE = h("wickra_williams_r_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_WILLIAMS_R_BATCH = h("wickra_williams_r_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_WILLIAMS_R_RESET = h("wickra_williams_r_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WILLIAMS_R_FREE = h("wickra_williams_r_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_YANG_ZHANG_VOLATILITY_NEW = h("wickra_yang_zhang_volatility_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_YANG_ZHANG_VOLATILITY_UPDATE = h("wickra_yang_zhang_volatility_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_YANG_ZHANG_VOLATILITY_BATCH = h("wickra_yang_zhang_volatility_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_YANG_ZHANG_VOLATILITY_RESET = h("wickra_yang_zhang_volatility_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_YANG_ZHANG_VOLATILITY_FREE = h("wickra_yang_zhang_volatility_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_YOYO_EXIT_NEW = h("wickra_yoyo_exit_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_YOYO_EXIT_UPDATE = h("wickra_yoyo_exit_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_YOYO_EXIT_BATCH = h("wickra_yoyo_exit_batch", FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_YOYO_EXIT_RESET = h("wickra_yoyo_exit_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_YOYO_EXIT_FREE = h("wickra_yoyo_exit_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AMIHUD_ILLIQUIDITY_NEW = h("wickra_amihud_illiquidity_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_AMIHUD_ILLIQUIDITY_UPDATE = h("wickra_amihud_illiquidity_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_AMIHUD_ILLIQUIDITY_RESET = h("wickra_amihud_illiquidity_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AMIHUD_ILLIQUIDITY_FREE = h("wickra_amihud_illiquidity_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_DELTA_NEW = h("wickra_cumulative_volume_delta_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_DELTA_UPDATE = h("wickra_cumulative_volume_delta_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_CUMULATIVE_VOLUME_DELTA_RESET = h("wickra_cumulative_volume_delta_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_DELTA_FREE = h("wickra_cumulative_volume_delta_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIN_NEW = h("wickra_pin_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PIN_UPDATE = h("wickra_pin_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_PIN_RESET = h("wickra_pin_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PIN_FREE = h("wickra_pin_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLL_MEASURE_NEW = h("wickra_roll_measure_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ROLL_MEASURE_UPDATE = h("wickra_roll_measure_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_ROLL_MEASURE_RESET = h("wickra_roll_measure_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ROLL_MEASURE_FREE = h("wickra_roll_measure_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SIGNED_VOLUME_NEW = h("wickra_signed_volume_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_SIGNED_VOLUME_UPDATE = h("wickra_signed_volume_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_SIGNED_VOLUME_RESET = h("wickra_signed_volume_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SIGNED_VOLUME_FREE = h("wickra_signed_volume_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init15() { + WICKRA_TRADE_IMBALANCE_NEW = h("wickra_trade_imbalance_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TRADE_IMBALANCE_UPDATE = h("wickra_trade_imbalance_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_TRADE_IMBALANCE_RESET = h("wickra_trade_imbalance_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRADE_IMBALANCE_FREE = h("wickra_trade_imbalance_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRADE_SIGN_AUTOCORRELATION_NEW = h("wickra_trade_sign_autocorrelation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TRADE_SIGN_AUTOCORRELATION_UPDATE = h("wickra_trade_sign_autocorrelation_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_TRADE_SIGN_AUTOCORRELATION_RESET = h("wickra_trade_sign_autocorrelation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRADE_SIGN_AUTOCORRELATION_FREE = h("wickra_trade_sign_autocorrelation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VPIN_NEW = h("wickra_vpin_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_VPIN_UPDATE = h("wickra_vpin_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG)); + WICKRA_VPIN_RESET = h("wickra_vpin_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VPIN_FREE = h("wickra_vpin_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EFFECTIVE_SPREAD_NEW = h("wickra_effective_spread_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_EFFECTIVE_SPREAD_UPDATE = h("wickra_effective_spread_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_EFFECTIVE_SPREAD_RESET = h("wickra_effective_spread_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EFFECTIVE_SPREAD_FREE = h("wickra_effective_spread_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KYLES_LAMBDA_NEW = h("wickra_kyles_lambda_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_KYLES_LAMBDA_UPDATE = h("wickra_kyles_lambda_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_KYLES_LAMBDA_RESET = h("wickra_kyles_lambda_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KYLES_LAMBDA_FREE = h("wickra_kyles_lambda_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REALIZED_SPREAD_NEW = h("wickra_realized_spread_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_REALIZED_SPREAD_UPDATE = h("wickra_realized_spread_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_REALIZED_SPREAD_RESET = h("wickra_realized_spread_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_REALIZED_SPREAD_FREE = h("wickra_realized_spread_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CALENDAR_SPREAD_NEW = h("wickra_calendar_spread_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CALENDAR_SPREAD_UPDATE = h("wickra_calendar_spread_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CALENDAR_SPREAD_RESET = h("wickra_calendar_spread_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CALENDAR_SPREAD_FREE = h("wickra_calendar_spread_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ESTIMATED_LEVERAGE_RATIO_NEW = h("wickra_estimated_leverage_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ESTIMATED_LEVERAGE_RATIO_UPDATE = h("wickra_estimated_leverage_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_ESTIMATED_LEVERAGE_RATIO_RESET = h("wickra_estimated_leverage_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ESTIMATED_LEVERAGE_RATIO_FREE = h("wickra_estimated_leverage_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_BASIS_NEW = h("wickra_funding_basis_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FUNDING_BASIS_UPDATE = h("wickra_funding_basis_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FUNDING_BASIS_RESET = h("wickra_funding_basis_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_BASIS_FREE = h("wickra_funding_basis_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_IMPLIED_APR_NEW = h("wickra_funding_implied_apr_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_FUNDING_IMPLIED_APR_UPDATE = h("wickra_funding_implied_apr_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FUNDING_IMPLIED_APR_RESET = h("wickra_funding_implied_apr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_IMPLIED_APR_FREE = h("wickra_funding_implied_apr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_NEW = h("wickra_funding_rate_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FUNDING_RATE_UPDATE = h("wickra_funding_rate_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FUNDING_RATE_RESET = h("wickra_funding_rate_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_FREE = h("wickra_funding_rate_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_MEAN_NEW = h("wickra_funding_rate_mean_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FUNDING_RATE_MEAN_UPDATE = h("wickra_funding_rate_mean_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FUNDING_RATE_MEAN_RESET = h("wickra_funding_rate_mean_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_MEAN_FREE = h("wickra_funding_rate_mean_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_Z_SCORE_NEW = h("wickra_funding_rate_z_score_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FUNDING_RATE_Z_SCORE_UPDATE = h("wickra_funding_rate_z_score_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_FUNDING_RATE_Z_SCORE_RESET = h("wickra_funding_rate_z_score_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FUNDING_RATE_Z_SCORE_FREE = h("wickra_funding_rate_z_score_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_SHORT_RATIO_NEW = h("wickra_long_short_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_LONG_SHORT_RATIO_UPDATE = h("wickra_long_short_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_LONG_SHORT_RATIO_RESET = h("wickra_long_short_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LONG_SHORT_RATIO_FREE = h("wickra_long_short_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPEN_INTEREST_DELTA_NEW = h("wickra_open_interest_delta_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_OPEN_INTEREST_DELTA_UPDATE = h("wickra_open_interest_delta_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OPEN_INTEREST_DELTA_RESET = h("wickra_open_interest_delta_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPEN_INTEREST_DELTA_FREE = h("wickra_open_interest_delta_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_PRICE_DIVERGENCE_NEW = h("wickra_oi_price_divergence_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_OI_PRICE_DIVERGENCE_UPDATE = h("wickra_oi_price_divergence_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OI_PRICE_DIVERGENCE_RESET = h("wickra_oi_price_divergence_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_PRICE_DIVERGENCE_FREE = h("wickra_oi_price_divergence_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_TO_VOLUME_RATIO_NEW = h("wickra_oi_to_volume_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_OI_TO_VOLUME_RATIO_UPDATE = h("wickra_oi_to_volume_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OI_TO_VOLUME_RATIO_RESET = h("wickra_oi_to_volume_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_TO_VOLUME_RATIO_FREE = h("wickra_oi_to_volume_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_WEIGHTED_NEW = h("wickra_oi_weighted_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_OI_WEIGHTED_UPDATE = h("wickra_oi_weighted_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OI_WEIGHTED_RESET = h("wickra_oi_weighted_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OI_WEIGHTED_FREE = h("wickra_oi_weighted_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPEN_INTEREST_MOMENTUM_NEW = h("wickra_open_interest_momentum_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_OPEN_INTEREST_MOMENTUM_UPDATE = h("wickra_open_interest_momentum_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_OPEN_INTEREST_MOMENTUM_RESET = h("wickra_open_interest_momentum_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPEN_INTEREST_MOMENTUM_FREE = h("wickra_open_interest_momentum_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERPETUAL_PREMIUM_INDEX_NEW = h("wickra_perpetual_premium_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_PERPETUAL_PREMIUM_INDEX_UPDATE = h("wickra_perpetual_premium_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_PERPETUAL_PREMIUM_INDEX_RESET = h("wickra_perpetual_premium_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERPETUAL_PREMIUM_INDEX_FREE = h("wickra_perpetual_premium_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAKER_BUY_SELL_RATIO_NEW = h("wickra_taker_buy_sell_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TAKER_BUY_SELL_RATIO_UPDATE = h("wickra_taker_buy_sell_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TAKER_BUY_SELL_RATIO_RESET = h("wickra_taker_buy_sell_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TAKER_BUY_SELL_RATIO_FREE = h("wickra_taker_buy_sell_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TERM_STRUCTURE_BASIS_NEW = h("wickra_term_structure_basis_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TERM_STRUCTURE_BASIS_UPDATE = h("wickra_term_structure_basis_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_TERM_STRUCTURE_BASIS_RESET = h("wickra_term_structure_basis_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TERM_STRUCTURE_BASIS_FREE = h("wickra_term_structure_basis_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEPTH_SLOPE_NEW = h("wickra_depth_slope_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DEPTH_SLOPE_UPDATE = h("wickra_depth_slope_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_DEPTH_SLOPE_RESET = h("wickra_depth_slope_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEPTH_SLOPE_FREE = h("wickra_depth_slope_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MICROPRICE_NEW = h("wickra_microprice_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MICROPRICE_UPDATE = h("wickra_microprice_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_MICROPRICE_RESET = h("wickra_microprice_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MICROPRICE_FREE = h("wickra_microprice_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_FULL_NEW = h("wickra_order_book_imbalance_full_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_FULL_UPDATE = h("wickra_order_book_imbalance_full_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ORDER_BOOK_IMBALANCE_FULL_RESET = h("wickra_order_book_imbalance_full_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_FULL_FREE = h("wickra_order_book_imbalance_full_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP1_NEW = h("wickra_order_book_imbalance_top1_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP1_UPDATE = h("wickra_order_book_imbalance_top1_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP1_RESET = h("wickra_order_book_imbalance_top1_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP1_FREE = h("wickra_order_book_imbalance_top1_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_NEW = h("wickra_order_book_imbalance_top_n_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_UPDATE = h("wickra_order_book_imbalance_top_n_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_RESET = h("wickra_order_book_imbalance_top_n_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_BOOK_IMBALANCE_TOP_N_FREE = h("wickra_order_book_imbalance_top_n_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_FLOW_IMBALANCE_NEW = h("wickra_order_flow_imbalance_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ORDER_FLOW_IMBALANCE_UPDATE = h("wickra_order_flow_imbalance_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_ORDER_FLOW_IMBALANCE_RESET = h("wickra_order_flow_imbalance_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ORDER_FLOW_IMBALANCE_FREE = h("wickra_order_flow_imbalance_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QUOTED_SPREAD_NEW = h("wickra_quoted_spread_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_QUOTED_SPREAD_UPDATE = h("wickra_quoted_spread_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_QUOTED_SPREAD_RESET = h("wickra_quoted_spread_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QUOTED_SPREAD_FREE = h("wickra_quoted_spread_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABSOLUTE_BREADTH_INDEX_NEW = h("wickra_absolute_breadth_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ABSOLUTE_BREADTH_INDEX_UPDATE = h("wickra_absolute_breadth_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_ABSOLUTE_BREADTH_INDEX_RESET = h("wickra_absolute_breadth_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ABSOLUTE_BREADTH_INDEX_FREE = h("wickra_absolute_breadth_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init16() { + WICKRA_AD_VOLUME_LINE_NEW = h("wickra_ad_volume_line_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_AD_VOLUME_LINE_UPDATE = h("wickra_ad_volume_line_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_AD_VOLUME_LINE_RESET = h("wickra_ad_volume_line_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AD_VOLUME_LINE_FREE = h("wickra_ad_volume_line_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_DECLINE_NEW = h("wickra_advance_decline_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ADVANCE_DECLINE_UPDATE = h("wickra_advance_decline_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_ADVANCE_DECLINE_RESET = h("wickra_advance_decline_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_DECLINE_FREE = h("wickra_advance_decline_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_DECLINE_RATIO_NEW = h("wickra_advance_decline_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_ADVANCE_DECLINE_RATIO_UPDATE = h("wickra_advance_decline_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_ADVANCE_DECLINE_RATIO_RESET = h("wickra_advance_decline_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADVANCE_DECLINE_RATIO_FREE = h("wickra_advance_decline_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BREADTH_THRUST_NEW = h("wickra_breadth_thrust_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_BREADTH_THRUST_UPDATE = h("wickra_breadth_thrust_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_BREADTH_THRUST_RESET = h("wickra_breadth_thrust_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BREADTH_THRUST_FREE = h("wickra_breadth_thrust_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BULLISH_PERCENT_INDEX_NEW = h("wickra_bullish_percent_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_BULLISH_PERCENT_INDEX_UPDATE = h("wickra_bullish_percent_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_BULLISH_PERCENT_INDEX_RESET = h("wickra_bullish_percent_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BULLISH_PERCENT_INDEX_FREE = h("wickra_bullish_percent_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_INDEX_NEW = h("wickra_cumulative_volume_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_INDEX_UPDATE = h("wickra_cumulative_volume_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_CUMULATIVE_VOLUME_INDEX_RESET = h("wickra_cumulative_volume_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CUMULATIVE_VOLUME_INDEX_FREE = h("wickra_cumulative_volume_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_INDEX_NEW = h("wickra_high_low_index_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_HIGH_LOW_INDEX_UPDATE = h("wickra_high_low_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_HIGH_LOW_INDEX_RESET = h("wickra_high_low_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_INDEX_FREE = h("wickra_high_low_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_CLELLAN_OSCILLATOR_NEW = h("wickra_mc_clellan_oscillator_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MC_CLELLAN_OSCILLATOR_UPDATE = h("wickra_mc_clellan_oscillator_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_MC_CLELLAN_OSCILLATOR_RESET = h("wickra_mc_clellan_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_CLELLAN_OSCILLATOR_FREE = h("wickra_mc_clellan_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_CLELLAN_SUMMATION_INDEX_NEW = h("wickra_mc_clellan_summation_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_MC_CLELLAN_SUMMATION_INDEX_UPDATE = h("wickra_mc_clellan_summation_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_MC_CLELLAN_SUMMATION_INDEX_RESET = h("wickra_mc_clellan_summation_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MC_CLELLAN_SUMMATION_INDEX_FREE = h("wickra_mc_clellan_summation_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NEW_HIGHS_NEW_LOWS_NEW = h("wickra_new_highs_new_lows_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_NEW_HIGHS_NEW_LOWS_UPDATE = h("wickra_new_highs_new_lows_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_NEW_HIGHS_NEW_LOWS_RESET = h("wickra_new_highs_new_lows_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NEW_HIGHS_NEW_LOWS_FREE = h("wickra_new_highs_new_lows_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENT_ABOVE_MA_NEW = h("wickra_percent_above_ma_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_PERCENT_ABOVE_MA_UPDATE = h("wickra_percent_above_ma_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_PERCENT_ABOVE_MA_RESET = h("wickra_percent_above_ma_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PERCENT_ABOVE_MA_FREE = h("wickra_percent_above_ma_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TICK_INDEX_NEW = h("wickra_tick_index_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TICK_INDEX_UPDATE = h("wickra_tick_index_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TICK_INDEX_RESET = h("wickra_tick_index_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TICK_INDEX_FREE = h("wickra_tick_index_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIN_NEW = h("wickra_trin_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TRIN_UPDATE = h("wickra_trin_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TRIN_RESET = h("wickra_trin_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TRIN_FREE = h("wickra_trin_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UP_DOWN_VOLUME_RATIO_NEW = h("wickra_up_down_volume_ratio_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_UP_DOWN_VOLUME_RATIO_UPDATE = h("wickra_up_down_volume_ratio_update", FunctionDescriptor.of(JAVA_DOUBLE, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_UP_DOWN_VOLUME_RATIO_RESET = h("wickra_up_down_volume_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_UP_DOWN_VOLUME_RATIO_FREE = h("wickra_up_down_volume_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ACCELERATION_BANDS_NEW = h("wickra_acceleration_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ACCELERATION_BANDS_UPDATE = h("wickra_acceleration_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ACCELERATION_BANDS_RESET = h("wickra_acceleration_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ACCELERATION_BANDS_FREE = h("wickra_acceleration_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADX_NEW = h("wickra_adx_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ADX_UPDATE = h("wickra_adx_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ADX_RESET = h("wickra_adx_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ADX_FREE = h("wickra_adx_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALLIGATOR_NEW = h("wickra_alligator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ALLIGATOR_UPDATE = h("wickra_alligator_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ALLIGATOR_RESET = h("wickra_alligator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ALLIGATOR_FREE = h("wickra_alligator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANDREWS_PITCHFORK_NEW = h("wickra_andrews_pitchfork_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ANDREWS_PITCHFORK_UPDATE = h("wickra_andrews_pitchfork_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ANDREWS_PITCHFORK_RESET = h("wickra_andrews_pitchfork_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ANDREWS_PITCHFORK_FREE = h("wickra_andrews_pitchfork_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AROON_NEW = h("wickra_aroon_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_AROON_UPDATE = h("wickra_aroon_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_AROON_RESET = h("wickra_aroon_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AROON_FREE = h("wickra_aroon_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_BANDS_NEW = h("wickra_atr_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ATR_BANDS_UPDATE = h("wickra_atr_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ATR_BANDS_RESET = h("wickra_atr_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_BANDS_FREE = h("wickra_atr_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_RATCHET_NEW = h("wickra_atr_ratchet_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_ATR_RATCHET_UPDATE = h("wickra_atr_ratchet_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ATR_RATCHET_RESET = h("wickra_atr_ratchet_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ATR_RATCHET_FREE = h("wickra_atr_ratchet_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTO_FIB_NEW = h("wickra_auto_fib_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_AUTO_FIB_UPDATE = h("wickra_auto_fib_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_AUTO_FIB_RESET = h("wickra_auto_fib_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_AUTO_FIB_FREE = h("wickra_auto_fib_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOLLINGER_BANDS_NEW = h("wickra_bollinger_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_BOLLINGER_BANDS_UPDATE = h("wickra_bollinger_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_BOLLINGER_BANDS_RESET = h("wickra_bollinger_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOLLINGER_BANDS_FREE = h("wickra_bollinger_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOMAR_BANDS_NEW = h("wickra_bomar_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_BOMAR_BANDS_UPDATE = h("wickra_bomar_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_BOMAR_BANDS_RESET = h("wickra_bomar_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_BOMAR_BANDS_FREE = h("wickra_bomar_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CAMARILLA_NEW = h("wickra_camarilla_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CAMARILLA_UPDATE = h("wickra_camarilla_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CAMARILLA_RESET = h("wickra_camarilla_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CAMARILLA_FREE = h("wickra_camarilla_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CANDLE_VOLUME_NEW = h("wickra_candle_volume_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_CANDLE_VOLUME_UPDATE = h("wickra_candle_volume_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CANDLE_VOLUME_RESET = h("wickra_candle_volume_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CANDLE_VOLUME_FREE = h("wickra_candle_volume_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CENTRAL_PIVOT_RANGE_NEW = h("wickra_central_pivot_range_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CENTRAL_PIVOT_RANGE_UPDATE = h("wickra_central_pivot_range_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CENTRAL_PIVOT_RANGE_RESET = h("wickra_central_pivot_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CENTRAL_PIVOT_RANGE_FREE = h("wickra_central_pivot_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHANDE_KROLL_STOP_NEW = h("wickra_chande_kroll_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_CHANDE_KROLL_STOP_UPDATE = h("wickra_chande_kroll_stop_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CHANDE_KROLL_STOP_RESET = h("wickra_chande_kroll_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHANDE_KROLL_STOP_FREE = h("wickra_chande_kroll_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHANDELIER_EXIT_NEW = h("wickra_chandelier_exit_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_CHANDELIER_EXIT_UPDATE = h("wickra_chandelier_exit_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CHANDELIER_EXIT_RESET = h("wickra_chandelier_exit_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CHANDELIER_EXIT_FREE = h("wickra_chandelier_exit_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLASSIC_PIVOTS_NEW = h("wickra_classic_pivots_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_CLASSIC_PIVOTS_UPDATE = h("wickra_classic_pivots_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_CLASSIC_PIVOTS_RESET = h("wickra_classic_pivots_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_CLASSIC_PIVOTS_FREE = h("wickra_classic_pivots_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init17() { + WICKRA_COINTEGRATION_NEW = h("wickra_cointegration_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_COINTEGRATION_UPDATE = h("wickra_cointegration_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, ADDRESS)); + WICKRA_COINTEGRATION_RESET = h("wickra_cointegration_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COINTEGRATION_FREE = h("wickra_cointegration_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COMPOSITE_PROFILE_NEW = h("wickra_composite_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_COMPOSITE_PROFILE_UPDATE = h("wickra_composite_profile_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_COMPOSITE_PROFILE_RESET = h("wickra_composite_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_COMPOSITE_PROFILE_FREE = h("wickra_composite_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMARK_PIVOTS_NEW = h("wickra_demark_pivots_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_DEMARK_PIVOTS_UPDATE = h("wickra_demark_pivots_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_DEMARK_PIVOTS_RESET = h("wickra_demark_pivots_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DEMARK_PIVOTS_FREE = h("wickra_demark_pivots_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DONCHIAN_NEW = h("wickra_donchian_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DONCHIAN_UPDATE = h("wickra_donchian_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_DONCHIAN_RESET = h("wickra_donchian_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DONCHIAN_FREE = h("wickra_donchian_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DONCHIAN_STOP_NEW = h("wickra_donchian_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_DONCHIAN_STOP_UPDATE = h("wickra_donchian_stop_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_DONCHIAN_STOP_RESET = h("wickra_donchian_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DONCHIAN_STOP_FREE = h("wickra_donchian_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOUBLE_BOLLINGER_NEW = h("wickra_double_bollinger_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_DOUBLE_BOLLINGER_UPDATE = h("wickra_double_bollinger_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_DOUBLE_BOLLINGER_RESET = h("wickra_double_bollinger_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOUBLE_BOLLINGER_FREE = h("wickra_double_bollinger_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_RAY_NEW = h("wickra_elder_ray_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_ELDER_RAY_UPDATE = h("wickra_elder_ray_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ELDER_RAY_RESET = h("wickra_elder_ray_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_RAY_FREE = h("wickra_elder_ray_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_SAFE_ZONE_NEW = h("wickra_elder_safe_zone_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_ELDER_SAFE_ZONE_UPDATE = h("wickra_elder_safe_zone_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ELDER_SAFE_ZONE_RESET = h("wickra_elder_safe_zone_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ELDER_SAFE_ZONE_FREE = h("wickra_elder_safe_zone_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EQUIVOLUME_NEW = h("wickra_equivolume_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_EQUIVOLUME_UPDATE = h("wickra_equivolume_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_EQUIVOLUME_RESET = h("wickra_equivolume_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_EQUIVOLUME_FREE = h("wickra_equivolume_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_ARCS_NEW = h("wickra_fib_arcs_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_ARCS_UPDATE = h("wickra_fib_arcs_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_ARCS_RESET = h("wickra_fib_arcs_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_ARCS_FREE = h("wickra_fib_arcs_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_CHANNEL_NEW = h("wickra_fib_channel_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_CHANNEL_UPDATE = h("wickra_fib_channel_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_CHANNEL_RESET = h("wickra_fib_channel_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_CHANNEL_FREE = h("wickra_fib_channel_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_CONFLUENCE_NEW = h("wickra_fib_confluence_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_CONFLUENCE_UPDATE = h("wickra_fib_confluence_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_CONFLUENCE_RESET = h("wickra_fib_confluence_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_CONFLUENCE_FREE = h("wickra_fib_confluence_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_EXTENSION_NEW = h("wickra_fib_extension_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_EXTENSION_UPDATE = h("wickra_fib_extension_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_EXTENSION_RESET = h("wickra_fib_extension_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_EXTENSION_FREE = h("wickra_fib_extension_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_FAN_NEW = h("wickra_fib_fan_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_FAN_UPDATE = h("wickra_fib_fan_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_FAN_RESET = h("wickra_fib_fan_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_FAN_FREE = h("wickra_fib_fan_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_PROJECTION_NEW = h("wickra_fib_projection_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_PROJECTION_UPDATE = h("wickra_fib_projection_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_PROJECTION_RESET = h("wickra_fib_projection_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_PROJECTION_FREE = h("wickra_fib_projection_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_RETRACEMENT_NEW = h("wickra_fib_retracement_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_RETRACEMENT_UPDATE = h("wickra_fib_retracement_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_RETRACEMENT_RESET = h("wickra_fib_retracement_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_RETRACEMENT_FREE = h("wickra_fib_retracement_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_TIME_ZONES_NEW = h("wickra_fib_time_zones_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIB_TIME_ZONES_UPDATE = h("wickra_fib_time_zones_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIB_TIME_ZONES_RESET = h("wickra_fib_time_zones_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIB_TIME_ZONES_FREE = h("wickra_fib_time_zones_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIBONACCI_PIVOTS_NEW = h("wickra_fibonacci_pivots_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_FIBONACCI_PIVOTS_UPDATE = h("wickra_fibonacci_pivots_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FIBONACCI_PIVOTS_RESET = h("wickra_fibonacci_pivots_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FIBONACCI_PIVOTS_FREE = h("wickra_fibonacci_pivots_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRACTAL_CHAOS_BANDS_NEW = h("wickra_fractal_chaos_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_FRACTAL_CHAOS_BANDS_UPDATE = h("wickra_fractal_chaos_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_FRACTAL_CHAOS_BANDS_RESET = h("wickra_fractal_chaos_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FRACTAL_CHAOS_BANDS_FREE = h("wickra_fractal_chaos_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GATOR_OSCILLATOR_NEW = h("wickra_gator_oscillator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_GATOR_OSCILLATOR_UPDATE = h("wickra_gator_oscillator_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_GATOR_OSCILLATOR_RESET = h("wickra_gator_oscillator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GATOR_OSCILLATOR_FREE = h("wickra_gator_oscillator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GOLDEN_POCKET_NEW = h("wickra_golden_pocket_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_GOLDEN_POCKET_UPDATE = h("wickra_golden_pocket_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_GOLDEN_POCKET_RESET = h("wickra_golden_pocket_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_GOLDEN_POCKET_FREE = h("wickra_golden_pocket_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEIKIN_ASHI_NEW = h("wickra_heikin_ashi_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HEIKIN_ASHI_UPDATE = h("wickra_heikin_ashi_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_HEIKIN_ASHI_RESET = h("wickra_heikin_ashi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HEIKIN_ASHI_FREE = h("wickra_heikin_ashi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_VOLUME_NODES_NEW = h("wickra_high_low_volume_nodes_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_HIGH_LOW_VOLUME_NODES_UPDATE = h("wickra_high_low_volume_nodes_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_HIGH_LOW_VOLUME_NODES_RESET = h("wickra_high_low_volume_nodes_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HIGH_LOW_VOLUME_NODES_FREE = h("wickra_high_low_volume_nodes_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_PHASOR_NEW = h("wickra_ht_phasor_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_HT_PHASOR_UPDATE = h("wickra_ht_phasor_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_HT_PHASOR_RESET = h("wickra_ht_phasor_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HT_PHASOR_FREE = h("wickra_ht_phasor_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HURST_CHANNEL_NEW = h("wickra_hurst_channel_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_HURST_CHANNEL_UPDATE = h("wickra_hurst_channel_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_HURST_CHANNEL_RESET = h("wickra_hurst_channel_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_HURST_CHANNEL_FREE = h("wickra_hurst_channel_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ICHIMOKU_NEW = h("wickra_ichimoku_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ICHIMOKU_UPDATE = h("wickra_ichimoku_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ICHIMOKU_RESET = h("wickra_ichimoku_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ICHIMOKU_FREE = h("wickra_ichimoku_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INITIAL_BALANCE_NEW = h("wickra_initial_balance_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_INITIAL_BALANCE_UPDATE = h("wickra_initial_balance_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_INITIAL_BALANCE_RESET = h("wickra_initial_balance_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INITIAL_BALANCE_FREE = h("wickra_initial_balance_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KALMAN_HEDGE_RATIO_NEW = h("wickra_kalman_hedge_ratio_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_KALMAN_HEDGE_RATIO_UPDATE = h("wickra_kalman_hedge_ratio_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, ADDRESS)); + WICKRA_KALMAN_HEDGE_RATIO_RESET = h("wickra_kalman_hedge_ratio_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KALMAN_HEDGE_RATIO_FREE = h("wickra_kalman_hedge_ratio_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KASE_DEV_STOP_NEW = h("wickra_kase_dev_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_KASE_DEV_STOP_UPDATE = h("wickra_kase_dev_stop_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_KASE_DEV_STOP_RESET = h("wickra_kase_dev_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KASE_DEV_STOP_FREE = h("wickra_kase_dev_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KASE_PERMISSION_STOCHASTIC_NEW = h("wickra_kase_permission_stochastic_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_KASE_PERMISSION_STOCHASTIC_UPDATE = h("wickra_kase_permission_stochastic_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_KASE_PERMISSION_STOCHASTIC_RESET = h("wickra_kase_permission_stochastic_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KASE_PERMISSION_STOCHASTIC_FREE = h("wickra_kase_permission_stochastic_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init18() { + WICKRA_KELTNER_NEW = h("wickra_keltner_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_KELTNER_UPDATE = h("wickra_keltner_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_KELTNER_RESET = h("wickra_keltner_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KELTNER_FREE = h("wickra_keltner_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KST_NEW = h("wickra_kst_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_KST_UPDATE = h("wickra_kst_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_KST_RESET = h("wickra_kst_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KST_FREE = h("wickra_kst_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LEAD_LAG_CROSS_CORRELATION_NEW = h("wickra_lead_lag_cross_correlation_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_LEAD_LAG_CROSS_CORRELATION_UPDATE = h("wickra_lead_lag_cross_correlation_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, ADDRESS)); + WICKRA_LEAD_LAG_CROSS_CORRELATION_RESET = h("wickra_lead_lag_cross_correlation_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LEAD_LAG_CROSS_CORRELATION_FREE = h("wickra_lead_lag_cross_correlation_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_CHANNEL_NEW = h("wickra_lin_reg_channel_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_LIN_REG_CHANNEL_UPDATE = h("wickra_lin_reg_channel_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_LIN_REG_CHANNEL_RESET = h("wickra_lin_reg_channel_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIN_REG_CHANNEL_FREE = h("wickra_lin_reg_channel_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIQUIDATION_FEATURES_NEW = h("wickra_liquidation_features_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_LIQUIDATION_FEATURES_UPDATE = h("wickra_liquidation_features_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_LIQUIDATION_FEATURES_RESET = h("wickra_liquidation_features_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_LIQUIDATION_FEATURES_FREE = h("wickra_liquidation_features_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MA_ENVELOPE_NEW = h("wickra_ma_envelope_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_MA_ENVELOPE_UPDATE = h("wickra_ma_envelope_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MA_ENVELOPE_RESET = h("wickra_ma_envelope_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MA_ENVELOPE_FREE = h("wickra_ma_envelope_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_INDICATOR_NEW = h("wickra_macd_indicator_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_MACD_INDICATOR_UPDATE = h("wickra_macd_indicator_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MACD_INDICATOR_RESET = h("wickra_macd_indicator_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_INDICATOR_FREE = h("wickra_macd_indicator_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_FIX_NEW = h("wickra_macd_fix_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MACD_FIX_UPDATE = h("wickra_macd_fix_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MACD_FIX_RESET = h("wickra_macd_fix_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_FIX_FREE = h("wickra_macd_fix_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAMA_NEW = h("wickra_mama_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_MAMA_UPDATE = h("wickra_mama_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MAMA_RESET = h("wickra_mama_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MAMA_FREE = h("wickra_mama_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_CHANNEL_NEW = h("wickra_median_channel_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_MEDIAN_CHANNEL_UPDATE = h("wickra_median_channel_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MEDIAN_CHANNEL_RESET = h("wickra_median_channel_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MEDIAN_CHANNEL_FREE = h("wickra_median_channel_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MODIFIED_MA_STOP_NEW = h("wickra_modified_ma_stop_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MODIFIED_MA_STOP_UPDATE = h("wickra_modified_ma_stop_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_MODIFIED_MA_STOP_RESET = h("wickra_modified_ma_stop_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MODIFIED_MA_STOP_FREE = h("wickra_modified_ma_stop_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MURREY_MATH_LINES_NEW = h("wickra_murrey_math_lines_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_MURREY_MATH_LINES_UPDATE = h("wickra_murrey_math_lines_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_MURREY_MATH_LINES_RESET = h("wickra_murrey_math_lines_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MURREY_MATH_LINES_FREE = h("wickra_murrey_math_lines_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NRTR_NEW = h("wickra_nrtr_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_NRTR_UPDATE = h("wickra_nrtr_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_NRTR_RESET = h("wickra_nrtr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_NRTR_FREE = h("wickra_nrtr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPENING_RANGE_NEW = h("wickra_opening_range_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_OPENING_RANGE_UPDATE = h("wickra_opening_range_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_OPENING_RANGE_RESET = h("wickra_opening_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OPENING_RANGE_FREE = h("wickra_opening_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OVERNIGHT_INTRADAY_RETURN_NEW = h("wickra_overnight_intraday_return_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_OVERNIGHT_INTRADAY_RETURN_UPDATE = h("wickra_overnight_intraday_return_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_OVERNIGHT_INTRADAY_RETURN_RESET = h("wickra_overnight_intraday_return_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_OVERNIGHT_INTRADAY_RETURN_FREE = h("wickra_overnight_intraday_return_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROJECTION_BANDS_NEW = h("wickra_projection_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_PROJECTION_BANDS_UPDATE = h("wickra_projection_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_PROJECTION_BANDS_RESET = h("wickra_projection_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_PROJECTION_BANDS_FREE = h("wickra_projection_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QQE_NEW = h("wickra_qqe_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_QQE_UPDATE = h("wickra_qqe_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_QQE_RESET = h("wickra_qqe_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QQE_FREE = h("wickra_qqe_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QUARTILE_BANDS_NEW = h("wickra_quartile_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_QUARTILE_BANDS_UPDATE = h("wickra_quartile_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_QUARTILE_BANDS_RESET = h("wickra_quartile_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_QUARTILE_BANDS_FREE = h("wickra_quartile_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RELATIVE_STRENGTH_AB_NEW = h("wickra_relative_strength_ab_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_RELATIVE_STRENGTH_AB_UPDATE = h("wickra_relative_strength_ab_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, ADDRESS)); + WICKRA_RELATIVE_STRENGTH_AB_RESET = h("wickra_relative_strength_ab_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RELATIVE_STRENGTH_AB_FREE = h("wickra_relative_strength_ab_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RWI_NEW = h("wickra_rwi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RWI_UPDATE = h("wickra_rwi_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_RWI_RESET = h("wickra_rwi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RWI_FREE = h("wickra_rwi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SESSION_HIGH_LOW_NEW = h("wickra_session_high_low_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_SESSION_HIGH_LOW_UPDATE = h("wickra_session_high_low_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_SESSION_HIGH_LOW_RESET = h("wickra_session_high_low_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SESSION_HIGH_LOW_FREE = h("wickra_session_high_low_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SESSION_RANGE_NEW = h("wickra_session_range_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_SESSION_RANGE_UPDATE = h("wickra_session_range_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_SESSION_RANGE_RESET = h("wickra_session_range_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SESSION_RANGE_FREE = h("wickra_session_range_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMOOTHED_HEIKIN_ASHI_NEW = h("wickra_smoothed_heikin_ashi_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_SMOOTHED_HEIKIN_ASHI_UPDATE = h("wickra_smoothed_heikin_ashi_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_SMOOTHED_HEIKIN_ASHI_RESET = h("wickra_smoothed_heikin_ashi_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SMOOTHED_HEIKIN_ASHI_FREE = h("wickra_smoothed_heikin_ashi_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_BOLLINGER_BANDS_NEW = h("wickra_spread_bollinger_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_SPREAD_BOLLINGER_BANDS_UPDATE = h("wickra_spread_bollinger_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, ADDRESS)); + WICKRA_SPREAD_BOLLINGER_BANDS_RESET = h("wickra_spread_bollinger_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SPREAD_BOLLINGER_BANDS_FREE = h("wickra_spread_bollinger_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STANDARD_ERROR_BANDS_NEW = h("wickra_standard_error_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_STANDARD_ERROR_BANDS_UPDATE = h("wickra_standard_error_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_STANDARD_ERROR_BANDS_RESET = h("wickra_standard_error_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STANDARD_ERROR_BANDS_FREE = h("wickra_standard_error_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STARC_BANDS_NEW = h("wickra_starc_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_STARC_BANDS_UPDATE = h("wickra_starc_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_STARC_BANDS_RESET = h("wickra_starc_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STARC_BANDS_FREE = h("wickra_starc_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCHASTIC_NEW = h("wickra_stochastic_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_STOCHASTIC_UPDATE = h("wickra_stochastic_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_STOCHASTIC_RESET = h("wickra_stochastic_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_STOCHASTIC_FREE = h("wickra_stochastic_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SUPER_TREND_NEW = h("wickra_super_trend_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_SUPER_TREND_UPDATE = h("wickra_super_trend_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_SUPER_TREND_RESET = h("wickra_super_trend_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_SUPER_TREND_FREE = h("wickra_super_trend_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_LINES_NEW = h("wickra_td_lines_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_LINES_UPDATE = h("wickra_td_lines_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TD_LINES_RESET = h("wickra_td_lines_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_LINES_FREE = h("wickra_td_lines_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_MOVING_AVERAGE_NEW = h("wickra_td_moving_average_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_MOVING_AVERAGE_UPDATE = h("wickra_td_moving_average_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TD_MOVING_AVERAGE_RESET = h("wickra_td_moving_average_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_MOVING_AVERAGE_FREE = h("wickra_td_moving_average_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init19() { + WICKRA_TD_RANGE_PROJECTION_NEW = h("wickra_td_range_projection_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_TD_RANGE_PROJECTION_UPDATE = h("wickra_td_range_projection_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TD_RANGE_PROJECTION_RESET = h("wickra_td_range_projection_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_RANGE_PROJECTION_FREE = h("wickra_td_range_projection_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_RISK_LEVEL_NEW = h("wickra_td_risk_level_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_RISK_LEVEL_UPDATE = h("wickra_td_risk_level_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TD_RISK_LEVEL_RESET = h("wickra_td_risk_level_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_RISK_LEVEL_FREE = h("wickra_td_risk_level_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_SEQUENTIAL_NEW = h("wickra_td_sequential_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_TD_SEQUENTIAL_UPDATE = h("wickra_td_sequential_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TD_SEQUENTIAL_RESET = h("wickra_td_sequential_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TD_SEQUENTIAL_FREE = h("wickra_td_sequential_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TTM_SQUEEZE_NEW = h("wickra_ttm_squeeze_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_DOUBLE, JAVA_DOUBLE)); + WICKRA_TTM_SQUEEZE_UPDATE = h("wickra_ttm_squeeze_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_TTM_SQUEEZE_RESET = h("wickra_ttm_squeeze_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TTM_SQUEEZE_FREE = h("wickra_ttm_squeeze_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VALUE_AREA_NEW = h("wickra_value_area_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_DOUBLE)); + WICKRA_VALUE_AREA_UPDATE = h("wickra_value_area_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VALUE_AREA_RESET = h("wickra_value_area_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VALUE_AREA_FREE = h("wickra_value_area_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_CONE_NEW = h("wickra_volatility_cone_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VOLATILITY_CONE_UPDATE = h("wickra_volatility_cone_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VOLATILITY_CONE_RESET = h("wickra_volatility_cone_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLATILITY_CONE_FREE = h("wickra_volatility_cone_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_WEIGHTED_MACD_NEW = h("wickra_volume_weighted_macd_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_VOLUME_WEIGHTED_MACD_UPDATE = h("wickra_volume_weighted_macd_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VOLUME_WEIGHTED_MACD_RESET = h("wickra_volume_weighted_macd_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_WEIGHTED_MACD_FREE = h("wickra_volume_weighted_macd_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_WEIGHTED_SR_NEW = h("wickra_volume_weighted_sr_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_WEIGHTED_SR_UPDATE = h("wickra_volume_weighted_sr_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VOLUME_WEIGHTED_SR_RESET = h("wickra_volume_weighted_sr_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_WEIGHTED_SR_FREE = h("wickra_volume_weighted_sr_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VORTEX_NEW = h("wickra_vortex_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_VORTEX_UPDATE = h("wickra_vortex_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VORTEX_RESET = h("wickra_vortex_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VORTEX_FREE = h("wickra_vortex_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWAP_STD_DEV_BANDS_NEW = h("wickra_vwap_std_dev_bands_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_VWAP_STD_DEV_BANDS_UPDATE = h("wickra_vwap_std_dev_bands_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_VWAP_STD_DEV_BANDS_RESET = h("wickra_vwap_std_dev_bands_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VWAP_STD_DEV_BANDS_FREE = h("wickra_vwap_std_dev_bands_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAVE_TREND_NEW = h("wickra_wave_trend_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_WAVE_TREND_UPDATE = h("wickra_wave_trend_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_WAVE_TREND_RESET = h("wickra_wave_trend_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WAVE_TREND_FREE = h("wickra_wave_trend_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WILLIAMS_FRACTALS_NEW = h("wickra_williams_fractals_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WILLIAMS_FRACTALS_UPDATE = h("wickra_williams_fractals_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_WILLIAMS_FRACTALS_RESET = h("wickra_williams_fractals_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WILLIAMS_FRACTALS_FREE = h("wickra_williams_fractals_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WOODIE_PIVOTS_NEW = h("wickra_woodie_pivots_new", FunctionDescriptor.of(ADDRESS)); + WICKRA_WOODIE_PIVOTS_UPDATE = h("wickra_woodie_pivots_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_WOODIE_PIVOTS_RESET = h("wickra_woodie_pivots_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_WOODIE_PIVOTS_FREE = h("wickra_woodie_pivots_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZERO_LAG_MACD_NEW = h("wickra_zero_lag_macd_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG, JAVA_LONG)); + WICKRA_ZERO_LAG_MACD_UPDATE = h("wickra_zero_lag_macd_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_ZERO_LAG_MACD_RESET = h("wickra_zero_lag_macd_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZERO_LAG_MACD_FREE = h("wickra_zero_lag_macd_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZIG_ZAG_NEW = h("wickra_zig_zag_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_ZIG_ZAG_UPDATE = h("wickra_zig_zag_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS)); + WICKRA_ZIG_ZAG_RESET = h("wickra_zig_zag_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_ZIG_ZAG_FREE = h("wickra_zig_zag_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DAY_OF_WEEK_PROFILE_NEW = h("wickra_day_of_week_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_INT)); + WICKRA_DAY_OF_WEEK_PROFILE_UPDATE = h("wickra_day_of_week_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_DAY_OF_WEEK_PROFILE_RESET = h("wickra_day_of_week_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DAY_OF_WEEK_PROFILE_FREE = h("wickra_day_of_week_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INTRADAY_VOLATILITY_PROFILE_NEW = h("wickra_intraday_volatility_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_INT)); + WICKRA_INTRADAY_VOLATILITY_PROFILE_UPDATE = h("wickra_intraday_volatility_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_INTRADAY_VOLATILITY_PROFILE_RESET = h("wickra_intraday_volatility_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_INTRADAY_VOLATILITY_PROFILE_FREE = h("wickra_intraday_volatility_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TIME_OF_DAY_RETURN_PROFILE_NEW = h("wickra_time_of_day_return_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_INT)); + WICKRA_TIME_OF_DAY_RETURN_PROFILE_UPDATE = h("wickra_time_of_day_return_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_TIME_OF_DAY_RETURN_PROFILE_RESET = h("wickra_time_of_day_return_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TIME_OF_DAY_RETURN_PROFILE_FREE = h("wickra_time_of_day_return_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TPO_PROFILE_NEW = h("wickra_tpo_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_TPO_PROFILE_UPDATE = h("wickra_tpo_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_TPO_PROFILE_RESET = h("wickra_tpo_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TPO_PROFILE_FREE = h("wickra_tpo_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_BY_TIME_PROFILE_NEW = h("wickra_volume_by_time_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_INT)); + WICKRA_VOLUME_BY_TIME_PROFILE_UPDATE = h("wickra_volume_by_time_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_BY_TIME_PROFILE_RESET = h("wickra_volume_by_time_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_BY_TIME_PROFILE_FREE = h("wickra_volume_by_time_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_PROFILE_NEW = h("wickra_volume_profile_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_LONG)); + WICKRA_VOLUME_PROFILE_UPDATE = h("wickra_volume_profile_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_PROFILE_RESET = h("wickra_volume_profile_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_PROFILE_FREE = h("wickra_volume_profile_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOLLAR_BARS_NEW = h("wickra_dollar_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_DOLLAR_BARS_UPDATE = h("wickra_dollar_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_DOLLAR_BARS_RESET = h("wickra_dollar_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_DOLLAR_BARS_FREE = h("wickra_dollar_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IMBALANCE_BARS_NEW = h("wickra_imbalance_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_IMBALANCE_BARS_UPDATE = h("wickra_imbalance_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_IMBALANCE_BARS_RESET = h("wickra_imbalance_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_IMBALANCE_BARS_FREE = h("wickra_imbalance_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KAGI_BARS_NEW = h("wickra_kagi_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_KAGI_BARS_UPDATE = h("wickra_kagi_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_KAGI_BARS_RESET = h("wickra_kagi_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_KAGI_BARS_FREE = h("wickra_kagi_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_POINT_AND_FIGURE_BARS_NEW = h("wickra_point_and_figure_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE, JAVA_LONG)); + WICKRA_POINT_AND_FIGURE_BARS_UPDATE = h("wickra_point_and_figure_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_POINT_AND_FIGURE_BARS_RESET = h("wickra_point_and_figure_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_POINT_AND_FIGURE_BARS_FREE = h("wickra_point_and_figure_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RANGE_BARS_NEW = h("wickra_range_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_RANGE_BARS_UPDATE = h("wickra_range_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_RANGE_BARS_RESET = h("wickra_range_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RANGE_BARS_FREE = h("wickra_range_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RENKO_BARS_NEW = h("wickra_renko_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_RENKO_BARS_UPDATE = h("wickra_renko_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_RENKO_BARS_RESET = h("wickra_renko_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RENKO_BARS_FREE = h("wickra_renko_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RUN_BARS_NEW = h("wickra_run_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_RUN_BARS_UPDATE = h("wickra_run_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_RUN_BARS_RESET = h("wickra_run_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_RUN_BARS_FREE = h("wickra_run_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_BREAK_BARS_NEW = h("wickra_three_line_break_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_THREE_LINE_BREAK_BARS_UPDATE = h("wickra_three_line_break_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_THREE_LINE_BREAK_BARS_RESET = h("wickra_three_line_break_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_THREE_LINE_BREAK_BARS_FREE = h("wickra_three_line_break_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TICK_BARS_NEW = h("wickra_tick_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG)); + WICKRA_TICK_BARS_UPDATE = h("wickra_tick_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_TICK_BARS_RESET = h("wickra_tick_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_TICK_BARS_FREE = h("wickra_tick_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + + private static void init20() { + WICKRA_VOLUME_BARS_NEW = h("wickra_volume_bars_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_VOLUME_BARS_UPDATE = h("wickra_volume_bars_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_VOLUME_BARS_RESET = h("wickra_volume_bars_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_VOLUME_BARS_FREE = h("wickra_volume_bars_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_EXT_NEW = h("wickra_macd_ext_new", FunctionDescriptor.of(ADDRESS, JAVA_LONG, JAVA_BYTE, JAVA_LONG, JAVA_BYTE, JAVA_LONG, JAVA_BYTE)); + WICKRA_MACD_EXT_UPDATE = h("wickra_macd_ext_update", FunctionDescriptor.of(JAVA_BYTE, ADDRESS, JAVA_DOUBLE, ADDRESS)); + WICKRA_MACD_EXT_RESET = h("wickra_macd_ext_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_MACD_EXT_FREE = h("wickra_macd_ext_free", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FOOTPRINT_NEW = h("wickra_footprint_new", FunctionDescriptor.of(ADDRESS, JAVA_DOUBLE)); + WICKRA_FOOTPRINT_UPDATE = h("wickra_footprint_update", FunctionDescriptor.of(JAVA_LONG, ADDRESS, JAVA_DOUBLE, JAVA_DOUBLE, JAVA_BYTE, JAVA_LONG, ADDRESS, JAVA_LONG)); + WICKRA_FOOTPRINT_RESET = h("wickra_footprint_reset", FunctionDescriptor.ofVoid(ADDRESS)); + WICKRA_FOOTPRINT_FREE = h("wickra_footprint_free", FunctionDescriptor.ofVoid(ADDRESS)); + } + +} diff --git a/bindings/java/src/main/java/org/wickra/internal/WickraNative.java b/bindings/java/src/main/java/org/wickra/internal/WickraNative.java new file mode 100644 index 00000000..1228f8a0 --- /dev/null +++ b/bindings/java/src/main/java/org/wickra/internal/WickraNative.java @@ -0,0 +1,179 @@ +package org.wickra.internal; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.foreign.Arena; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SymbolLookup; +import java.lang.invoke.MethodHandle; +import java.lang.ref.Cleaner; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.util.Locale; + +/** + * Native library resolution and FFM downcall plumbing for the Wickra C ABI. + * + *

The native library is located in one of two ways. When the binding is + * consumed as a packaged jar the per-platform library ships under + * {@code /native/-/} and is extracted to a temporary file at load + * time. For local development (running against a {@code cargo build}) the + * resolver walks up the directory tree to find {@code target/release} or + * {@code target/debug}. Every candidate is validated to actually export the + * Wickra ABI before it is accepted, so an unrelated library of the same name + * cannot shadow the real one. + * + *

This is internal plumbing; application code uses the generated indicator + * classes in {@code org.wickra}. + */ +public final class WickraNative { + private WickraNative() { + } + + /** Any exported symbol works as a fingerprint; sma_new exists in every build. */ + private static final String SENTINEL = "wickra_sma_new"; + + static final Cleaner CLEANER = Cleaner.create(); + private static final Linker LINKER = Linker.nativeLinker(); + private static final Arena LIB_ARENA = Arena.ofShared(); + private static final SymbolLookup LOOKUP = loadLibrary(); + + /** Build a downcall handle for one C function. Internal use by the generated code. */ + public static MethodHandle downcall(String name, FunctionDescriptor descriptor) { + MemorySegment symbol = LOOKUP.find(name) + .orElseThrow(() -> new UnsatisfiedLinkError("wickra: missing symbol " + name)); + return LINKER.downcallHandle(symbol, descriptor); + } + + /** + * Register an opaque handle for release via its {@code _free} function when the + * owning wrapper becomes unreachable (or is closed). The action holds no + * reference to the owner, so it never keeps it alive. + */ + public static Cleaner.Cleanable register(Object owner, MemorySegment handle, MethodHandle free) { + return CLEANER.register(owner, new FreeAction(handle, free)); + } + + /** Re-throw a {@link MethodHandle#invokeExact} {@link Throwable} as an unchecked exception. */ + public static RuntimeException rethrow(Throwable t) { + if (t instanceof RuntimeException re) { + return re; + } + if (t instanceof Error e) { + throw e; + } + return new RuntimeException(t); + } + + private record FreeAction(MemorySegment handle, MethodHandle free) implements Runnable { + @Override + public void run() { + try { + free.invokeExact(handle); + } catch (Throwable ignored) { + // Best-effort release during finalization; nothing actionable here. + } + } + } + + private static SymbolLookup loadLibrary() { + Path lib = locate(); + if (lib == null) { + throw new UnsatisfiedLinkError( + "wickra: could not locate the native library (" + libraryFileName() + + "). Bundle it under resources/native/" + platformDir() + + "/ or build the C ABI with `cargo build -p wickra-c --release`."); + } + SymbolLookup lookup = SymbolLookup.libraryLookup(lib, LIB_ARENA); + if (lookup.find(SENTINEL).isEmpty()) { + throw new UnsatisfiedLinkError("wickra: " + lib + " does not export the C ABI"); + } + return lookup; + } + + private static Path locate() { + Path bundled = extractBundled(); + if (bundled != null) { + return bundled; + } + return findInCargoTarget(); + } + + private static Path extractBundled() { + String resource = "/native/" + platformDir() + "/" + libraryFileName(); + try (InputStream in = WickraNative.class.getResourceAsStream(resource)) { + if (in == null) { + return null; + } + Path tmp = Files.createTempFile("wickra-", "-" + libraryFileName()); + tmp.toFile().deleteOnExit(); + Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING); + return tmp; + } catch (IOException e) { + return null; + } + } + + private static Path findInCargoTarget() { + String file = libraryFileName(); + Path[] bases = {Paths.get(System.getProperty("user.dir", ".")), codeSourceDir()}; + for (Path base : bases) { + Path dir = base; + for (int i = 0; i < 16 && dir != null; i++) { + for (String profile : new String[] {"release", "debug"}) { + Path candidate = dir.resolve("target").resolve(profile).resolve(file); + if (Files.isRegularFile(candidate)) { + return candidate; + } + } + dir = dir.getParent(); + } + } + return null; + } + + private static Path codeSourceDir() { + try { + Path p = Paths.get(WickraNative.class.getProtectionDomain() + .getCodeSource().getLocation().toURI()); + return Files.isDirectory(p) ? p : p.getParent(); + } catch (Exception e) { + return null; + } + } + + private static String osName() { + String os = System.getProperty("os.name", "").toLowerCase(Locale.ROOT); + if (os.contains("win")) { + return "win"; + } + if (os.contains("mac") || os.contains("darwin")) { + return "osx"; + } + return "linux"; + } + + private static String archName() { + String arch = System.getProperty("os.arch", "").toLowerCase(Locale.ROOT); + if (arch.equals("aarch64") || arch.equals("arm64")) { + return "arm64"; + } + return "x64"; + } + + private static String platformDir() { + return osName() + "-" + archName(); + } + + private static String libraryFileName() { + return switch (osName()) { + case "win" -> "wickra.dll"; + case "osx" -> "libwickra.dylib"; + default -> "libwickra.so"; + }; + } +} diff --git a/bindings/java/src/test/java/org/wickra/ArchetypeTests.java b/bindings/java/src/test/java/org/wickra/ArchetypeTests.java new file mode 100644 index 00000000..e3fde661 --- /dev/null +++ b/bindings/java/src/test/java/org/wickra/ArchetypeTests.java @@ -0,0 +1,153 @@ +package org.wickra; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * One representative per FFI archetype, exercising every marshalling path the + * generator produces (scalar, candle, pairwise, multi-output, bars, profile, + * values-profile, array-input). Garbage marshalling surfaces as NaN, wild + * values, or crashes — so finite/sane assertions are the real check. + */ +class ArchetypeTests { + + private static double[] candle(int i) { + double close = 100.0 + 10.0 * Math.sin(i * 0.3); + double open = 100.0 + 10.0 * Math.sin((i - 1) * 0.3); + double high = Math.max(open, close) + 1.0; + double low = Math.min(open, close) - 1.0; + return new double[] {open, high, low, close, 1_000.0}; + } + + @Test + void scalarEmaIsFiniteAfterWarmup() { + try (Ema ema = new Ema(3)) { + double last = Double.NaN; + for (int i = 1; i <= 10; i++) { + last = ema.update(i); + } + assertTrue(Double.isFinite(last)); + assertTrue(last >= 1.0 && last <= 10.0); + } + } + + @Test + void scalarEmaBatchMatchesStreaming() { + double[] input = new double[50]; + for (int i = 0; i < input.length; i++) { + input[i] = 100.0 + 10.0 * Math.sin(i * 0.2); + } + double streamedLast; + try (Ema ema = new Ema(10)) { + double v = Double.NaN; + for (double x : input) { + v = ema.update(x); + } + streamedLast = v; + } + double[] batched; + try (Ema ema = new Ema(10)) { + batched = ema.batch(input); + } + assertEquals(input.length, batched.length); + assertEquals(streamedLast, batched[batched.length - 1], 1e-9); + } + + @Test + void candleAtrIsFinitePositive() { + try (Atr atr = new Atr(3)) { + double last = Double.NaN; + for (int i = 0; i < 20; i++) { + double[] c = candle(i); + last = atr.update(c[0], c[1], c[2], c[3], c[4], i * 60_000L); + } + assertTrue(Double.isFinite(last)); + assertTrue(last > 0.0); + } + } + + @Test + void pairwiseBetaIsFinite() { + try (Beta beta = new Beta(5)) { + double last = Double.NaN; + for (int i = 0; i < 30; i++) { + double market = 100.0 + 10.0 * Math.sin(i * 0.5); + double asset = 50.0 + 6.0 * Math.sin(i * 0.5 + 0.2); + last = beta.update(market, asset); + } + assertTrue(Double.isFinite(last)); + } + } + + @Test + void multiOutputAdxReturnsFiniteRecord() { + try (Adx adx = new Adx(5)) { + AdxOutput result = null; + for (int i = 0; i < 60; i++) { + double[] c = candle(i); + result = adx.update(c[0], c[1], c[2], c[3], c[4], i * 60_000L); + } + assertNotNull(result); + assertTrue(Double.isFinite(result.adx())); + assertTrue(Double.isFinite(result.plusDi())); + assertTrue(Double.isFinite(result.minusDi())); + } + } + + @Test + void barsDollarBarsEmitsBars() { + try (DollarBars bars = new DollarBars(5_000.0)) { + int total = 0; + for (int i = 0; i < 200; i++) { + double[] c = candle(i); + total += bars.update(c[0], c[1], c[2], c[3], c[4], i * 60_000L).length; + } + assertTrue(total > 0); + } + } + + @Test + void profileVolumeProfileReturnsValues() { + try (VolumeProfile profile = new VolumeProfile(20, 8)) { + VolumeProfileOutputScalars result = null; + for (int i = 0; i < 60; i++) { + double[] c = candle(i); + result = profile.update(c[0], c[1], c[2], c[3], c[4], i * 60_000L); + } + assertNotNull(result); + assertNotNull(result.values()); + assertTrue(result.priceLow() <= result.priceHigh()); + } + } + + @Test + void profileValuesDayOfWeekProfileNoCrash() { + try (DayOfWeekProfile profile = new DayOfWeekProfile(0)) { + double[] result = null; + for (int i = 0; i < 60; i++) { + double close = 100.0 + 5.0 * Math.sin(i * 0.2); + result = profile.update(close, close + 1, close - 1, close, 1_000.0, i * 86_400_000L); + } + if (result != null) { + for (double v : result) { + assertTrue(Double.isFinite(v)); + } + } + } + } + + @Test + void arrayInputDepthSlopeIsFinite() { + try (DepthSlope slope = new DepthSlope()) { + double[] bidPrice = {99.0, 98.0, 97.0}; + double[] bidSize = {10.0, 20.0, 30.0}; + double[] askPrice = {101.0, 102.0, 103.0}; + double[] askSize = {12.0, 22.0, 32.0}; + double result = slope.update(bidPrice, bidSize, askPrice, askSize); + assertTrue(Double.isFinite(result)); + } + } +} diff --git a/bindings/node/README.md b/bindings/node/README.md index 4ebaa54a..6e4e0cd9 100644 --- a/bindings/node/README.md +++ b/bindings/node/README.md @@ -9,7 +9,7 @@ prebuilt native binary, no system dependencies.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R and any +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading bots and historical backtests share the exact same implementation. This package is the Node.js binding (napi-rs); diff --git a/bindings/python/README.md b/bindings/python/README.md index edb59b76..97db5ba1 100644 --- a/bindings/python/README.md +++ b/bindings/python/README.md @@ -9,7 +9,7 @@ system dependencies, no C build tooling.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R and any +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading bots and historical backtests share the exact same implementation. This package is the Python binding (PyO3); it diff --git a/bindings/r/README.md b/bindings/r/README.md index d9bbd5a0..7cf01f9f 100644 --- a/bindings/r/README.md +++ b/bindings/r/README.md @@ -7,7 +7,7 @@ **Streaming-first technical indicators for R, over the Wickra C ABI hub via `.Call`.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading and historical backtests share the exact same implementation. This package is the R binding; it reaches the C ABI hub through diff --git a/bindings/wasm/README.md b/bindings/wasm/README.md index 7d803664..d489e23e 100644 --- a/bindings/wasm/README.md +++ b/bindings/wasm/README.md @@ -9,7 +9,7 @@ wickra-wasm` — pure WebAssembly, runs anywhere a modern JS engine does.** Wickra is a multi-language technical-analysis library with a Rust core and -bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, R and any +bindings for Python, Node.js and WebAssembly, plus a C ABI for C/C++, C#, Go, Java, R and any other C-capable language. Every indicator is an O(1) streaming state machine, so live trading dashboards and historical backtests share the exact same implementation. This package is the WebAssembly binding diff --git a/docs/README.md b/docs/README.md index a9d25118..36660bc0 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,8 @@ That includes: [WASM](https://docs.wickra.org/Quickstart-WASM), [C](https://docs.wickra.org/Quickstart-C), [C#](https://docs.wickra.org/Quickstart-CSharp), - [Go](https://docs.wickra.org/Quickstart-Go), and + [Go](https://docs.wickra.org/Quickstart-Go), + [Java](https://docs.wickra.org/Quickstart-Java), and [R](https://docs.wickra.org/Quickstart-R). - A per-indicator deep dive for every one of the **514 indicators** across the sixteen families (Moving Averages, Momentum Oscillators, Trend & diff --git a/examples/README.md b/examples/README.md index 255deee3..90b15ec7 100644 --- a/examples/README.md +++ b/examples/README.md @@ -113,6 +113,29 @@ The offline examples run on deterministic synthetic data (and under CI on all three OSes); `fetch_btcusdt.R` and `live_binance.R` reach the network and are parse-checked but not run in CI. +## Java — `examples/java/` + +Build the C ABI library first (`cargo build -p wickra-c --release`) and install +the binding (`mvn -f bindings/java install -DskipTests`), then run any example +from this directory. The `exec` goal forks a JVM with +`--enable-native-access=ALL-UNNAMED`. + +| Example | What it does | Run | +| --- | --- | --- | +| `Streaming` | Feed a synthetic price series through SMA / EMA / RSI / MACD tick by tick. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.Streaming` | +| `Backtest` | Basket of indicators over an OHLCV series (CSV arg or synthetic). | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.Backtest` | +| `MultiTimeframe` | Resample a 1-minute series to 5m / 15m and print an indicator per timeframe. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.MultiTimeframe` | +| `ParallelAssets` | SMA(20) batch over a panel, serial vs parallel streams, with speedup. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.ParallelAssets` | +| `StrategyRsiMeanReversion` | RSI(14) mean-reversion with PnL / Sharpe / max-DD summary. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.StrategyRsiMeanReversion` | +| `StrategyMacdAdx` | Trend-follower: MACD crossover entries gated by ADX(14) > 20. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.StrategyMacdAdx` | +| `StrategyBollingerSqueeze` | Bollinger-squeeze breakout with an ATR(14) trailing stop. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.StrategyBollingerSqueeze` | +| `FetchBtcusdt` | Download real BTCUSDT klines from the Binance REST API into a CSV. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.FetchBtcusdt` | +| `LiveBinance` | Stream live Binance klines through EMA(20) over a WebSocket. | `mvn exec:exec -Dexec.mainClass=org.wickra.examples.LiveBinance` | + +The offline examples run on deterministic synthetic data (and under CI on all +three OSes); `FetchBtcusdt` and `LiveBinance` reach the network and are +build-checked but not run in CI. + ## Python — `examples/python/` | Example | What it does | Run | diff --git a/examples/java/.gitignore b/examples/java/.gitignore new file mode 100644 index 00000000..8e618d8f --- /dev/null +++ b/examples/java/.gitignore @@ -0,0 +1,5 @@ +# Maven build output +target/ + +# Data fetched at runtime by fetch_btcusdt +data/ diff --git a/examples/java/README.md b/examples/java/README.md new file mode 100644 index 00000000..32c3ed22 --- /dev/null +++ b/examples/java/README.md @@ -0,0 +1,35 @@ +# Wickra examples — Java + +Runnable examples for the [Wickra Java binding](../../bindings/java). Each +example is a small `main` class that uses the `org.wickra:wickra` artifact and +resolves the native library automatically (from `target/release` during local +development, or the bundled per-platform library when packaged). + +Build the native library and install the binding to your local Maven repo +first, then run any example with the `exec` plugin: + +```bash +cargo build -p wickra-c --release +mvn -f bindings/java install -DskipTests +mvn -f examples/java compile +mvn -f examples/java exec:exec -Dexec.mainClass=org.wickra.examples.Streaming +``` + +(The `exec:exec` goal forks a JVM with `--enable-native-access=ALL-UNNAMED`, the +flag the FFM API needs.) + +| Example | What it does | Main class | +| --- | --- | --- | +| `streaming` | Feed a synthetic price series through SMA / EMA / RSI / MACD tick by tick. | `org.wickra.examples.Streaming` | +| `backtest` | Compute a basket of indicators over an OHLCV series and print a summary. | `org.wickra.examples.Backtest` | +| `multi_timeframe` | Resample a 1-minute series into 5m / 15m and print an indicator per timeframe. | `org.wickra.examples.MultiTimeframe` | +| `parallel_assets` | SMA(20) batch over a panel of assets, serial vs parallel streams, with speedup. | `org.wickra.examples.ParallelAssets` | +| `strategy_rsi_mean_reversion` | RSI(14) mean-reversion with a PnL / Sharpe / max-DD summary. | `org.wickra.examples.StrategyRsiMeanReversion` | +| `strategy_macd_adx` | MACD crossover entries gated by ADX(14) > 20. | `org.wickra.examples.StrategyMacdAdx` | +| `strategy_bollinger_squeeze` | Bollinger-squeeze breakout with an ATR(14) trailing stop. | `org.wickra.examples.StrategyBollingerSqueeze` | +| `fetch_btcusdt` | Download real BTCUSDT klines from the Binance REST API into a CSV. | `org.wickra.examples.FetchBtcusdt` | +| `live_binance` | Stream live Binance klines through EMA(20) over a WebSocket. | `org.wickra.examples.LiveBinance` | + +`fetch_btcusdt` and `live_binance` require network access; the rest run offline +on deterministic synthetic data. Shared helpers (synthetic data, CSV loader, +equity summary) live in `MarketData` and `Equity`. diff --git a/examples/java/pom.xml b/examples/java/pom.xml new file mode 100644 index 00000000..87f7aa84 --- /dev/null +++ b/examples/java/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + org.wickra.examples + wickra-examples + 0.7.8 + jar + + Wickra Java examples + Runnable examples for the Wickra Java binding. + + + UTF-8 + 22 + + + + + org.wickra + wickra + 0.7.8 + + + + com.fasterxml.jackson.core + jackson-databind + 2.17.1 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + + + + org.codehaus.mojo + exec-maven-plugin + 3.2.0 + + ${java.home}/bin/java + + --enable-native-access=ALL-UNNAMED + -classpath + + ${exec.mainClass} + + + + + + diff --git a/examples/java/src/main/java/org/wickra/examples/Backtest.java b/examples/java/src/main/java/org/wickra/examples/Backtest.java new file mode 100644 index 00000000..36ffaddb --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/Backtest.java @@ -0,0 +1,43 @@ +package org.wickra.examples; + +import org.wickra.Atr; +import org.wickra.Ema; +import org.wickra.Rsi; +import org.wickra.Sma; +import org.wickra.examples.MarketData.Bar; + +/** + * Compute a basket of indicators over an OHLCV series and print a summary. + * Pass a CSV path (timestamp,open,high,low,close,volume) or run on synthetic data. + */ +public final class Backtest { + public static void main(String[] args) throws Exception { + String source = args.length > 0 ? args[0] : "synthetic"; + Bar[] bars = args.length > 0 ? MarketData.loadOhlcvCsv(args[0]) : MarketData.syntheticCandles(1000); + + System.out.printf("Backtest over %d bars (%s):%n", bars.length, source); + + try (Sma sma = new Sma(20); + Ema ema = new Ema(50); + Rsi rsi = new Rsi(14); + Atr atr = new Atr(14)) { + + double lastSma = 0, lastEma = 0, lastRsi = 0, lastAtr = 0; + int oversold = 0; + for (Bar b : bars) { + lastSma = sma.update(b.close()); + lastEma = ema.update(b.close()); + lastRsi = rsi.update(b.close()); + lastAtr = atr.update(b.open(), b.high(), b.low(), b.close(), b.volume(), b.timestamp()); + if (Double.isFinite(lastRsi) && lastRsi < 30.0) { + oversold++; + } + } + + System.out.printf(" SMA(20) last = %.4f%n", lastSma); + System.out.printf(" EMA(50) last = %.4f%n", lastEma); + System.out.printf(" RSI(14) last = %.4f (%d oversold bars)%n", lastRsi, oversold); + System.out.printf(" ATR(14) last = %.4f%n", lastAtr); + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/Equity.java b/examples/java/src/main/java/org/wickra/examples/Equity.java new file mode 100644 index 00000000..cd4e8fe0 --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/Equity.java @@ -0,0 +1,63 @@ +package org.wickra.examples; + +import java.util.List; + +/** + * Minimal long-only backtest helper: turn a stream of per-bar fractional returns + * into a PnL / Sharpe / max-drawdown summary. The strategy examples produce the + * returns; this aggregates them. + */ +public final class Equity { + private Equity() { + } + + /** Summary statistics for a long-only equity curve. */ + public record Result(double totalReturnPct, double sharpe, double maxDrawdownPct, int trades, double finalEquity) { + } + + /** + * @param periodReturns per-bar fractional returns (0.01 == +1%) + * @param trades number of position entries + */ + public static Result summarize(List periodReturns, int trades) { + return summarize(periodReturns, trades, 252.0); + } + + public static Result summarize(List periodReturns, int trades, double periodsPerYear) { + double equity = 1.0; + double peak = 1.0; + double maxDrawdown = 0.0; + for (double r : periodReturns) { + equity *= 1.0 + r; + peak = Math.max(peak, equity); + if (peak > 0) { + maxDrawdown = Math.max(maxDrawdown, (peak - equity) / peak); + } + } + + double mean = 0.0; + for (double r : periodReturns) { + mean += r; + } + mean = periodReturns.isEmpty() ? 0.0 : mean / periodReturns.size(); + + double variance = 0.0; + if (periodReturns.size() > 1) { + for (double r : periodReturns) { + variance += (r - mean) * (r - mean); + } + variance /= periodReturns.size() - 1; + } + double stdDev = Math.sqrt(variance); + double sharpe = stdDev > 1e-12 ? mean / stdDev * Math.sqrt(periodsPerYear) : 0.0; + + return new Result((equity - 1.0) * 100.0, sharpe, maxDrawdown * 100.0, trades, equity); + } + + /** Prints a one-line summary. */ + public static void print(String name, Result r) { + System.out.printf( + "%-26s return=%8.2f%% sharpe=%6.2f maxDD=%6.2f%% trades=%d%n", + name, r.totalReturnPct(), r.sharpe(), r.maxDrawdownPct(), r.trades()); + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/FetchBtcusdt.java b/examples/java/src/main/java/org/wickra/examples/FetchBtcusdt.java new file mode 100644 index 00000000..e8c65af6 --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/FetchBtcusdt.java @@ -0,0 +1,48 @@ +package org.wickra.examples; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.BufferedWriter; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * Download real BTCUSDT hourly klines from the Binance REST API into a CSV that the + * other examples can consume. Requires network access (build-only in CI). + */ +public final class FetchBtcusdt { + public static void main(String[] args) throws Exception { + String url = "https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1h&limit=500"; + System.out.println("Fetching " + url); + + HttpClient http = HttpClient.newHttpClient(); + HttpRequest request = HttpRequest.newBuilder(URI.create(url)).GET().build(); + HttpResponse response = http.send(request, HttpResponse.BodyHandlers.ofString()); + + JsonNode klines = new ObjectMapper().readTree(response.body()); + Path dir = Path.of("data"); + Files.createDirectories(dir); + Path path = dir.resolve("btcusdt_1h.csv"); + + int count = 0; + try (BufferedWriter writer = Files.newBufferedWriter(path)) { + writer.write("timestamp,open,high,low,close,volume"); + writer.newLine(); + for (JsonNode kline : klines) { + // Binance kline array: [openTime, open, high, low, close, volume, ...] + writer.write(kline.get(0).asLong() + "," + kline.get(1).asText() + "," + + kline.get(2).asText() + "," + kline.get(3).asText() + "," + + kline.get(4).asText() + "," + kline.get(5).asText()); + writer.newLine(); + count++; + } + } + + System.out.printf("Wrote %d klines to %s%n", count, path.toAbsolutePath()); + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/LiveBinance.java b/examples/java/src/main/java/org/wickra/examples/LiveBinance.java new file mode 100644 index 00000000..0df46a79 --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/LiveBinance.java @@ -0,0 +1,73 @@ +package org.wickra.examples; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.wickra.Ema; + +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.WebSocket; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/** + * Stream live BTCUSDT 1-minute klines from Binance and feed each close through EMA(20). + * Requires network access (build-only in CI). Runs for up to 60 seconds. + */ +public final class LiveBinance { + public static void main(String[] args) throws Exception { + URI uri = URI.create("wss://stream.binance.com:9443/ws/btcusdt@kline_1m"); + System.out.println("Connecting to " + uri + " (up to 60s)..."); + + ObjectMapper mapper = new ObjectMapper(); + CountDownLatch done = new CountDownLatch(1); + + try (Ema ema = new Ema(20)) { + WebSocket.Listener listener = new WebSocket.Listener() { + private final StringBuilder buffer = new StringBuilder(); + + @Override + public void onOpen(WebSocket webSocket) { + webSocket.request(1); + } + + @Override + public java.util.concurrent.CompletionStage onText(WebSocket webSocket, CharSequence data, boolean last) { + buffer.append(data); + if (last) { + try { + JsonNode root = mapper.readTree(buffer.toString()); + JsonNode k = root.get("k"); + if (k != null) { + double close = Double.parseDouble(k.get("c").asText()); + double value = ema.update(close); + System.out.printf("close=%.2f EMA(20)=%.2f%n", close, value); + } + } catch (Exception e) { + System.err.println("parse error: " + e.getMessage()); + } + buffer.setLength(0); + } + webSocket.request(1); + return null; + } + + @Override + public void onError(WebSocket webSocket, Throwable error) { + System.err.println("websocket error: " + error.getMessage()); + done.countDown(); + } + }; + + WebSocket ws = HttpClient.newHttpClient() + .newWebSocketBuilder() + .buildAsync(uri, listener) + .join(); + + if (!done.await(60, TimeUnit.SECONDS)) { + System.out.println("Done (time limit reached)."); + } + ws.sendClose(WebSocket.NORMAL_CLOSURE, "done"); + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/MarketData.java b/examples/java/src/main/java/org/wickra/examples/MarketData.java new file mode 100644 index 00000000..5a5d514d --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/MarketData.java @@ -0,0 +1,91 @@ +package org.wickra.examples; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +/** + * Deterministic synthetic market data plus a small OHLCV CSV loader, shared by + * the offline examples so they run without network access. + */ +public final class MarketData { + private MarketData() { + } + + /** One OHLCV bar with a millisecond timestamp. */ + public record Bar(double open, double high, double low, double close, double volume, long timestamp) { + } + + /** A reproducible price path (trend + two cycles), no randomness. */ + public static double[] syntheticPrices(int count) { + return syntheticPrices(count, 100.0); + } + + public static double[] syntheticPrices(int count, double start) { + double[] prices = new double[count]; + for (int i = 0; i < count; i++) { + prices[i] = start + 12.0 * Math.sin(i * 0.05) + 5.0 * Math.sin(i * 0.013) + i * 0.01; + } + return prices; + } + + /** A reproducible OHLCV series derived from {@link #syntheticPrices(int)}. */ + public static Bar[] syntheticCandles(int count) { + return syntheticCandles(count, 0L, 3_600_000L); + } + + public static Bar[] syntheticCandles(int count, long startTimestamp, long stepMs) { + double[] prices = syntheticPrices(count + 1); + Bar[] bars = new Bar[count]; + for (int i = 0; i < count; i++) { + double open = prices[i]; + double close = prices[i + 1]; + double high = Math.max(open, close) + 0.5 + Math.abs(Math.sin(i * 0.7)); + double low = Math.min(open, close) - 0.5 - Math.abs(Math.cos(i * 0.7)); + double volume = 1_000.0 + 500.0 * (1.0 + Math.sin(i * 0.1)); + bars[i] = new Bar(open, high, low, close, volume, startTimestamp + (long) i * stepMs); + } + return bars; + } + + /** + * Loads an OHLCV CSV. Accepts rows of {@code timestamp,open,high,low,close,volume} + * or {@code open,high,low,close,volume}; a non-numeric first row is treated as a header. + */ + public static Bar[] loadOhlcvCsv(String path) throws IOException { + List bars = new ArrayList<>(); + for (String rawLine : Files.readAllLines(Path.of(path))) { + String line = rawLine.trim(); + if (line.isEmpty()) { + continue; + } + String[] cols = line.split(","); + if (!isNumeric(cols[0])) { + continue; // header row + } + if (cols.length >= 6) { + bars.add(new Bar( + Double.parseDouble(cols[1]), Double.parseDouble(cols[2]), + Double.parseDouble(cols[3]), Double.parseDouble(cols[4]), + Double.parseDouble(cols[5]), Long.parseLong(cols[0]))); + } else { + bars.add(new Bar( + Double.parseDouble(cols[0]), Double.parseDouble(cols[1]), + Double.parseDouble(cols[2]), Double.parseDouble(cols[3]), + Double.parseDouble(cols[4]), bars.size())); + } + } + return bars.toArray(new Bar[0]); + } + + private static boolean isNumeric(String s) { + try { + Double.parseDouble(s); + return true; + } catch (NumberFormatException e) { + return false; + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/MultiTimeframe.java b/examples/java/src/main/java/org/wickra/examples/MultiTimeframe.java new file mode 100644 index 00000000..03d5fc1a --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/MultiTimeframe.java @@ -0,0 +1,46 @@ +package org.wickra.examples; + +import org.wickra.Ema; +import org.wickra.examples.MarketData.Bar; + +import java.util.ArrayList; +import java.util.List; + +/** Resample a 1-minute series into higher timeframes and run an indicator per timeframe. */ +public final class MultiTimeframe { + public static void main(String[] args) { + Bar[] oneMinute = MarketData.syntheticCandles(1200, 0L, 60_000L); + + System.out.println("EMA(20) of close across timeframes (resampled from 1-minute bars):"); + for (int factor : new int[] {1, 5, 15}) { + Bar[] bars = resample(oneMinute, factor); + try (Ema ema = new Ema(20)) { + double last = 0; + for (Bar b : bars) { + last = ema.update(b.close()); + } + System.out.printf(" %2dm: %5d bars EMA(20) last = %.4f%n", factor, bars.length, last); + } + } + } + + private static Bar[] resample(Bar[] source, int factor) { + if (factor <= 1) { + return source; + } + List output = new ArrayList<>(); + for (int i = 0; i < source.length; i += factor) { + int end = Math.min(i + factor, source.length); + double high = Double.MIN_VALUE; + double low = Double.MAX_VALUE; + double volume = 0; + for (int j = i; j < end; j++) { + high = Math.max(high, source[j].high()); + low = Math.min(low, source[j].low()); + volume += source[j].volume(); + } + output.add(new Bar(source[i].open(), high, low, source[end - 1].close(), volume, source[i].timestamp())); + } + return output.toArray(new Bar[0]); + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/ParallelAssets.java b/examples/java/src/main/java/org/wickra/examples/ParallelAssets.java new file mode 100644 index 00000000..0b222c2a --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/ParallelAssets.java @@ -0,0 +1,50 @@ +package org.wickra.examples; + +import org.wickra.Sma; + +import java.util.stream.IntStream; + +/** Run SMA(20) batch over a panel of assets, serial vs parallel, and report the speedup. */ +public final class ParallelAssets { + public static void main(String[] args) { + int assets = args.length > 0 ? Integer.parseInt(args[0]) : 500; + int bars = args.length > 1 ? Integer.parseInt(args[1]) : 20_000; + + double[][] panel = new double[assets][]; + for (int a = 0; a < assets; a++) { + panel[a] = MarketData.syntheticPrices(bars, 50.0 + a * 0.1); + } + + // Warm up the JIT and thread pool so the comparison is fair. + try (Sma warm = new Sma(20)) { + warm.batch(panel[0]); + } + + double sink = 0.0; + long t0 = System.nanoTime(); + for (int a = 0; a < assets; a++) { + try (Sma sma = new Sma(20)) { + double[] result = sma.batch(panel[a]); + sink += result[result.length - 1]; + } + } + double serialMs = (System.nanoTime() - t0) / 1e6; + + double[] lasts = new double[assets]; + long t1 = System.nanoTime(); + IntStream.range(0, assets).parallel().forEach(a -> { + try (Sma sma = new Sma(20)) { + double[] result = sma.batch(panel[a]); + lasts[a] = result[result.length - 1]; + } + }); + double parallelMs = (System.nanoTime() - t1) / 1e6; + + System.out.printf("%d assets x %d bars, SMA(20) batch:%n", assets, bars); + System.out.printf(" serial %8.1f ms%n", serialMs); + System.out.printf(" parallel %8.1f ms (%.1fx speedup)%n", parallelMs, serialMs / Math.max(parallelMs, 1e-9)); + if (sink == Double.NaN || lasts.length < 0) { + System.out.println(sink); // keep `sink` live + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/StrategyBollingerSqueeze.java b/examples/java/src/main/java/org/wickra/examples/StrategyBollingerSqueeze.java new file mode 100644 index 00000000..bed0caa7 --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/StrategyBollingerSqueeze.java @@ -0,0 +1,56 @@ +package org.wickra.examples; + +import org.wickra.Atr; +import org.wickra.BollingerBands; +import org.wickra.BollingerOutput; +import org.wickra.examples.MarketData.Bar; + +import java.util.ArrayList; +import java.util.List; + +/** + * Breakout: when Bollinger bandwidth is tight (a "squeeze") and price closes above the + * upper band, go long with an ATR(14) trailing stop. + */ +public final class StrategyBollingerSqueeze { + public static void main(String[] args) throws Exception { + Bar[] bars = args.length > 0 ? MarketData.loadOhlcvCsv(args[0]) : MarketData.syntheticCandles(2000); + + try (BollingerBands bollinger = new BollingerBands(20, 2.0); + Atr atr = new Atr(14)) { + + List returns = new ArrayList<>(); + int trades = 0; + boolean inPosition = false; + double entry = 0.0; + double stop = 0.0; + + for (Bar b : bars) { + BollingerOutput band = bollinger.update(b.close()); + double atrValue = atr.update(b.open(), b.high(), b.low(), b.close(), b.volume(), b.timestamp()); + if (band == null || !Double.isFinite(atrValue)) { + continue; + } + + double bandwidth = band.middle() != 0.0 + ? (band.upper() - band.lower()) / band.middle() + : Double.MAX_VALUE; + + if (!inPosition && bandwidth < 0.06 && b.close() > band.upper()) { + inPosition = true; + entry = b.close(); + stop = b.close() - 2.0 * atrValue; + trades++; + } else if (inPosition) { + stop = Math.max(stop, b.close() - 2.0 * atrValue); // trail the stop up + if (b.close() < stop) { + returns.add((b.close() - entry) / entry); + inPosition = false; + } + } + } + + Equity.print("Bollinger squeeze", Equity.summarize(returns, trades)); + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/StrategyMacdAdx.java b/examples/java/src/main/java/org/wickra/examples/StrategyMacdAdx.java new file mode 100644 index 00000000..43f6c50c --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/StrategyMacdAdx.java @@ -0,0 +1,53 @@ +package org.wickra.examples; + +import org.wickra.Adx; +import org.wickra.AdxOutput; +import org.wickra.MacdIndicator; +import org.wickra.MacdOutput; +import org.wickra.examples.MarketData.Bar; + +import java.util.ArrayList; +import java.util.List; + +/** + * Trend follower: enter long on a MACD histogram cross up, but only when ADX(14) > 20 + * confirms a trend; exit when the histogram crosses back below zero. + */ +public final class StrategyMacdAdx { + public static void main(String[] args) throws Exception { + Bar[] bars = args.length > 0 ? MarketData.loadOhlcvCsv(args[0]) : MarketData.syntheticCandles(2000); + + try (MacdIndicator macd = new MacdIndicator(12, 26, 9); + Adx adx = new Adx(14)) { + + List returns = new ArrayList<>(); + int trades = 0; + boolean inPosition = false; + double entry = 0.0; + double prevHistogram = Double.NaN; + + for (Bar b : bars) { + MacdOutput m = macd.update(b.close()); + AdxOutput a = adx.update(b.open(), b.high(), b.low(), b.close(), b.volume(), b.timestamp()); + if (m == null || a == null) { + continue; + } + + boolean trending = a.adx() > 20.0; + if (!inPosition && trending && Double.isFinite(prevHistogram) + && prevHistogram <= 0.0 && m.histogram() > 0.0) { + inPosition = true; + entry = b.close(); + trades++; + } else if (inPosition && m.histogram() < 0.0) { + returns.add((b.close() - entry) / entry); + inPosition = false; + } + + prevHistogram = m.histogram(); + } + + Equity.print("MACD + ADX trend", Equity.summarize(returns, trades)); + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/StrategyRsiMeanReversion.java b/examples/java/src/main/java/org/wickra/examples/StrategyRsiMeanReversion.java new file mode 100644 index 00000000..c9c85d75 --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/StrategyRsiMeanReversion.java @@ -0,0 +1,38 @@ +package org.wickra.examples; + +import org.wickra.Rsi; +import org.wickra.examples.MarketData.Bar; + +import java.util.ArrayList; +import java.util.List; + +/** Mean reversion: go long when RSI(14) drops below 30, exit when it recovers above 50. */ +public final class StrategyRsiMeanReversion { + public static void main(String[] args) throws Exception { + Bar[] bars = args.length > 0 ? MarketData.loadOhlcvCsv(args[0]) : MarketData.syntheticCandles(2000); + + try (Rsi rsi = new Rsi(14)) { + List returns = new ArrayList<>(); + int trades = 0; + boolean inPosition = false; + double entry = 0.0; + + for (Bar b : bars) { + double value = rsi.update(b.close()); + if (!Double.isFinite(value)) { + continue; + } + if (!inPosition && value < 30.0) { + inPosition = true; + entry = b.close(); + trades++; + } else if (inPosition && value > 50.0) { + returns.add((b.close() - entry) / entry); + inPosition = false; + } + } + + Equity.print("RSI mean-reversion", Equity.summarize(returns, trades)); + } + } +} diff --git a/examples/java/src/main/java/org/wickra/examples/Streaming.java b/examples/java/src/main/java/org/wickra/examples/Streaming.java new file mode 100644 index 00000000..2530073b --- /dev/null +++ b/examples/java/src/main/java/org/wickra/examples/Streaming.java @@ -0,0 +1,38 @@ +package org.wickra.examples; + +import org.wickra.Ema; +import org.wickra.MacdIndicator; +import org.wickra.MacdOutput; +import org.wickra.Rsi; +import org.wickra.Sma; + +/** Feed a synthetic price series through several indicators tick by tick (O(1) each). */ +public final class Streaming { + public static void main(String[] args) { + double[] prices = MarketData.syntheticPrices(500); + + try (Sma sma = new Sma(20); + Ema ema = new Ema(20); + Rsi rsi = new Rsi(14); + MacdIndicator macd = new MacdIndicator(12, 26, 9)) { + + double lastSma = 0, lastEma = 0, lastRsi = 0; + MacdOutput lastMacd = null; + for (double price : prices) { + lastSma = sma.update(price); + lastEma = ema.update(price); + lastRsi = rsi.update(price); + lastMacd = macd.update(price); + } + + System.out.printf("Streamed %d prices through SMA(20), EMA(20), RSI(14), MACD(12,26,9):%n", prices.length); + System.out.printf(" SMA = %.4f%n", lastSma); + System.out.printf(" EMA = %.4f%n", lastEma); + System.out.printf(" RSI = %.4f%n", lastRsi); + if (lastMacd != null) { + System.out.printf(" MACD = %.4f signal=%.4f hist=%.4f%n", + lastMacd.macd(), lastMacd.signal(), lastMacd.histogram()); + } + } + } +}