@gainsnetwork/sdk 0.1.10-rc1 → 0.1.11-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/markets/forex.d.ts +2 -1
- package/lib/markets/forex.js +5 -3
- package/package.json +1 -1
package/lib/markets/forex.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { Pair } from "src/trade";
|
|
1
2
|
export declare const isForexOpen: (dateToCheck: Date) => boolean;
|
|
2
|
-
export declare const isForexLowLiquidity: (timestampToCheck: number,
|
|
3
|
+
export declare const isForexLowLiquidity: (timestampToCheck: number, pair?: Pair) => boolean;
|
package/lib/markets/forex.js
CHANGED
|
@@ -27,13 +27,15 @@ const isForexOpen = (dateToCheck) => {
|
|
|
27
27
|
return !isClosed;
|
|
28
28
|
};
|
|
29
29
|
exports.isForexOpen = isForexOpen;
|
|
30
|
-
const
|
|
30
|
+
const chfMinorPairIds = [28, 116, 120, 123, 125, 127];
|
|
31
|
+
const isForexLowLiquidity = (timestampToCheck, pair) => {
|
|
31
32
|
const now = luxon_1.DateTime.fromMillis(timestampToCheck).setZone(FOREX_MARKETS_TIME_ZONE_IANA);
|
|
32
33
|
const hour = now.hour;
|
|
33
34
|
const minute = now.minute;
|
|
34
35
|
const isInDST = now.isInDST;
|
|
35
|
-
//
|
|
36
|
-
|
|
36
|
+
// CHF minor pairs: increase low liquidity window by additional 30 mins
|
|
37
|
+
const pairIndex = pair === null || pair === void 0 ? void 0 : pair.pairIndex;
|
|
38
|
+
if (pairIndex && chfMinorPairIds.includes(+pairIndex)) {
|
|
37
39
|
return ((isInDST && ((hour == 15 && minute >= 15) || (hour >= 16 && hour < 19))) ||
|
|
38
40
|
(!isInDST && ((hour == 16 && minute >= 15) || (hour >= 17 && hour < 20))));
|
|
39
41
|
}
|