Skip to content

Commit

Permalink
stage
Browse files Browse the repository at this point in the history
  • Loading branch information
rylorin committed Mar 13, 2024
1 parent f75397f commit b9266a5
Show file tree
Hide file tree
Showing 5 changed files with 1,201 additions and 716 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:

steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"
with:
ref: ${{ github.ref }}

# Setup Node.js
- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
node-version: 20.11.1
cache: "yarn" # caches the yarn cache folder not node_modules

# Automated Version Bump
- name: "Automated Version Bump"
Expand All @@ -33,10 +33,10 @@ jobs:
# Install packages
# - name: "Installing"
# run: npm install
- run: npm ci
- run: yarn ci

# Publish the package
- name: "Publishing to Npm registry"
run: npm publish
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
132 changes: 66 additions & 66 deletions dist/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ declare class VWAP extends Indicator {
nextValue(price: CandleData): number;
}
declare function vwap(input: VWAPInput): number[];
declare class AvgGainInput extends IndicatorInput {
period: number;
values: number[];
}
declare class AverageGain extends Indicator {
generator: IterableIterator<number | undefined>;
constructor(input: AvgGainInput);
static calculate: typeof averagegain;
nextValue(price: number): number | undefined;
}
declare function averagegain(input: AvgGainInput): number[];
declare class VolumeProfileInput extends IndicatorInput {
high: number[];
open: number[];
Expand All @@ -47,17 +58,6 @@ declare class VolumeProfile extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function volumeprofile(input: VolumeProfileInput): number[];
declare class AvgGainInput extends IndicatorInput {
period: number;
values: number[];
}
declare class AverageGain extends Indicator {
generator: IterableIterator<number | undefined>;
constructor(input: AvgGainInput);
static calculate: typeof averagegain;
nextValue(price: number): number | undefined;
}
declare function averagegain(input: AvgGainInput): number[];
declare class AvgLossInput extends IndicatorInput {
values: number[];
period: number;
Expand All @@ -84,6 +84,25 @@ declare class RenkoInput extends IndicatorInput {
timestamp?: number[];
}
declare function renko(input: RenkoInput): CandleList;
/**
* Created by AAravindan on 5/4/16.
*/
declare class HeikinAshiInput extends IndicatorInput {
low?: number[];
open?: number[];
volume?: number[];
high?: number[];
close?: number[];
timestamp?: number[];
}
declare class HeikinAshi extends Indicator {
result: CandleList;
generator: IterableIterator<CandleData | undefined>;
constructor(input: HeikinAshiInput);
static calculate: typeof heikinashi;
nextValue(price: CandleData): CandleData | undefined;
}
declare function heikinashi(input: HeikinAshiInput): CandleList;
/**
* Calcaultes the fibonacci retracements for given start and end points
*
Expand Down Expand Up @@ -119,25 +138,6 @@ declare class IchimokuCloud extends Indicator {
nextValue(price: CandleData): IchimokuCloudOutput;
}
declare function ichimokucloud(input: IchimokuCloudInput): IchimokuCloudOutput[];
/**
* Created by AAravindan on 5/4/16.
*/
declare class HeikinAshiInput extends IndicatorInput {
low?: number[];
open?: number[];
volume?: number[];
high?: number[];
close?: number[];
timestamp?: number[];
}
declare class HeikinAshi extends Indicator {
result: CandleList;
generator: IterableIterator<CandleData | undefined>;
constructor(input: HeikinAshiInput);
static calculate: typeof heikinashi;
nextValue(price: CandleData): CandleData | undefined;
}
declare function heikinashi(input: HeikinAshiInput): CandleList;
declare class KeltnerChannelsInput extends IndicatorInput {
maPeriod: number;
atrPeriod: number;
Expand Down Expand Up @@ -202,6 +202,16 @@ declare class CandleList {
volume?: number[];
timestamp?: number[];
}
declare class EMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof ema;
nextValue(price: number): number;
}
declare function ema(input: MAInput): number[];
/**
* Created by AAravindan on 5/7/16.
*/
Expand All @@ -222,31 +232,6 @@ declare class CandleList {
calculatePeriodHigh(): void;
calculatePeriodLow(): void;
}
declare class EMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof ema;
nextValue(price: number): number;
}
declare function ema(input: MAInput): number[];
declare class MAInput extends IndicatorInput {
period: number;
values: number[];
constructor(period: number, values: number[]);
}
declare class SMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof sma;
nextValue(price: number): number | undefined;
}
declare function sma(input: MAInput): number[];
declare class IndicatorInput {
reversedInput?: boolean;
format?: (data: number) => number;
Expand All @@ -267,6 +252,21 @@ declare class Indicator {
static reverseInputs(input: any): void;
getResult(): any;
}
declare class MAInput extends IndicatorInput {
period: number;
values: number[];
constructor(period: number, values: number[]);
}
declare class SMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof sma;
nextValue(price: number): number | undefined;
}
declare function sma(input: MAInput): number[];
declare class ATRInput extends IndicatorInput {
low: number[];
high: number[];
Expand All @@ -281,7 +281,6 @@ declare class ATR extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function atr(input: ATRInput): number[];
declare function format(v: number): number;
declare class LinkedList {
private _head;
private _tail;
Expand All @@ -302,16 +301,6 @@ declare class LinkedList {
resetCursor(): this;
next(): any;
}
declare class WEMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof wema;
nextValue(price: number): number | undefined;
}
declare function wema(input: MAInput): number[];
declare class TrueRangeInput extends IndicatorInput {
low: number[];
high: number[];
Expand All @@ -325,5 +314,16 @@ declare class TrueRange extends Indicator {
nextValue(price: CandleData): number | undefined;
}
declare function truerange(input: TrueRangeInput): number[];
declare function format(v: number): number;
declare class WEMA extends Indicator {
period: number;
price: number[];
result: number[];
generator: IterableIterator<number | undefined>;
constructor(input: MAInput);
static calculate: typeof wema;
nextValue(price: number): number | undefined;
}
declare function wema(input: MAInput): number[];
declare function setConfig(key: any, value: any): void;
declare function getConfig(key: any): any;
62 changes: 32 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
"name": "@rylorin/technicalindicators",
"version": "3.1.14",
"description": "Techincal Indicators written in javascript",
"main": "dist/index.js",
"module": "lib/index.js",
"types": "./declarations/index.d.ts",
"jsnext:main": "lib/index.js",
"scripts": {
"cover": "babel-istanbul --include-all-sources cover -x dist/**/*.* ./node_modules/mocha/bin/_mocha -- -R spec && open coverage/lcov-report/index.html",
"test": "mocha --require babel-core/register --require babel-polyfill",
"test:watch": "mocha --watch --require babel-core/register --require babel-polyfill",
"generateDts": "./generateTsDefinitions.sh",
"build": "tsc -p . && babel-node --presets es2015 rollup.js",
"start": "sh test.sh"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rylorin/technicalindicators.git"
},
"keywords": [
"Technical indicators",
"Technical analysis",
Expand Down Expand Up @@ -102,14 +86,37 @@
"Cross Down",
"Cross Over"
],
"author": "rylorin@protonmail.com",
"license": "MIT",
"homepage": "https://github.com/rylorin/technicalindicators#readme",
"bugs": {
"url": "https://github.com/rylorin/technicalindicators/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rylorin/technicalindicators.git"
},
"license": "MIT",
"author": "rylorin@protonmail.com",
"sideEffects": false,
"homepage": "https://github.com/rylorin/technicalindicators#readme",
"main": "dist/index.js",
"module": "lib/index.js",
"jsnext:main": "lib/index.js",
"types": "./declarations/index.d.ts",
"scripts": {
"build": "tsc -p . && babel-node --presets es2015 rollup.js",
"cover": "babel-istanbul --include-all-sources cover -x dist/**/*.* ./node_modules/mocha/bin/_mocha -- -R spec && open coverage/lcov-report/index.html",
"generateDts": "./generateTsDefinitions.sh",
"start": "sh test.sh",
"test": "mocha --require babel-core/register --require babel-polyfill",
"test:watch": "mocha --watch --require babel-core/register --require babel-polyfill"
},
"dependencies": {
"@tensorflow/tfjs": "0.10.0",
"@types/node": "^20.11.27"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@types/chai": "^4.3.12",
"@types/mocha": "^2.0.0",
"babel-cli": "^6.8.0",
Expand Down Expand Up @@ -137,26 +144,21 @@
"rollup": "^1.26.3",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-babel-minify": "^3.1.2",
"rollup-plugin-commonjs": "^8.3.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-ignore": "^1.0.3",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-typescript2": "^0.31.2",
"rollup-plugin-uglify": "^1.0.2",
"rollup-watch": "^3.2.2",
"rollup-plugin-typescript2": "^0.36.0",
"rollup-watch": "^4.3.1",
"ts-node": "^10.9.2",
"tslint": "^6.1.3",
"typescript": "^5.4.2"
},
"dependencies": {
"@tensorflow/tfjs": "0.10.0",
"@types/node": "^20.11.27"
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=20"
}
}
2 changes: 2 additions & 0 deletions rollup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// import babel from "@rollup/plugin-babel";
// import minify from "@rollup/plugin-terser";
import { rollup } from "rollup";
import babel from "rollup-plugin-babel";
import minify from "rollup-plugin-babel-minify";
Expand Down
Loading

0 comments on commit b9266a5

Please sign in to comment.