-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dca-form): implement IndicatorValue field for Entry Conditions
- Loading branch information
Showing
4 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from "./candle.js"; | ||
export * from "./indicators.js"; | ||
export * from "./indicator-value.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { BarSize } from "../common/index.js"; | ||
|
||
/** | ||
* Used in forms in custom fields with React Query Builder | ||
*/ | ||
export type IndicatorValue = { | ||
/** | ||
* Numeric string. | ||
*/ | ||
indicatorValue: string; | ||
/** | ||
* Numeric string. | ||
*/ | ||
periods: string; | ||
timeframe: BarSize; | ||
}; | ||
|
||
export const isIndicatorValue = (value: any): value is IndicatorValue => { | ||
return value?.indicatorValue !== undefined && value?.periods !== undefined && value?.timeframe !== undefined; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { BarSize } from "../common/enums.js"; | ||
|
||
export type IndicatorName = "SMA5" | "SMA10" | "SMA15" | "SMA30" | "RSI"; | ||
export type IndicatorBarSize = Extract< | ||
BarSize, | ||
"1m" | "5m" | "10m" | "15m" | "30m" | "1h" | "4h" | "1d" | ||
>; | ||
export type IndicatorBarSize = Extract<BarSize, "1m" | "5m" | "10m" | "15m" | "30m" | "1h" | "4h" | "1d">; | ||
export type IndicatorsResult<I extends IndicatorName> = { | ||
[K in I]: number; | ||
}; |
Submodule pro
updated
from b0869a to 009a63