@barchart/portfolio-api-common 1.0.216 → 1.0.217

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.
@@ -118,6 +118,20 @@ module.exports = (() => {
118
118
  return even;
119
119
  }
120
120
  }
121
+
122
+ /**
123
+ * Returns true of the direction switched (from long to short, or
124
+ * short to long).
125
+ *
126
+ * @public
127
+ * @static
128
+ * @param {PositionDirection} a
129
+ * @param {PositionDirection} b
130
+ * @returns {Boolean}
131
+ */
132
+ static switched(a, b) {
133
+ return !a.closed && !b.closed && a.positive !== b.positive;
134
+ }
121
135
  }
122
136
 
123
137
  const long = new PositionDirection('LONG', 'Long', 'positive');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.216",
3
+ "version": "1.0.217",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",