@gbozee/ultimate 0.0.2-13 → 0.0.2-15

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38729,7 +38729,7 @@ class ExchangeAccount {
38729
38729
  async windDownSymbol(symbol, risk_reward = 199) {
38730
38730
  const positions = await this.syncAccount({
38731
38731
  symbol,
38732
- as_view: true
38732
+ update: true
38733
38733
  });
38734
38734
  let long_position = positions.find((x) => x.kind === "long");
38735
38735
  let short_position = positions.find((x) => x.kind === "short");
@@ -38835,6 +38835,7 @@ class ExchangeAccount {
38835
38835
  risk: bullish_instance.risk,
38836
38836
  symbol
38837
38837
  });
38838
+ let changed = false;
38838
38839
  if (!position2?.config) {
38839
38840
  await this.buildAppConfig({
38840
38841
  entry: long_config.entry,
@@ -38845,7 +38846,11 @@ class ExchangeAccount {
38845
38846
  profit_percent: 1,
38846
38847
  update_db: true
38847
38848
  });
38849
+ changed = true;
38848
38850
  } else {
38851
+ if (position2.expand.config.entry !== long_config.entry || position2.expand.config.stop !== long_config.stop || position2.expand.config.risk !== long_config.risk) {
38852
+ changed = true;
38853
+ }
38849
38854
  await this.getPositionConfig({
38850
38855
  symbol,
38851
38856
  kind: "long",
@@ -38868,10 +38873,13 @@ class ExchangeAccount {
38868
38873
  symbol
38869
38874
  });
38870
38875
  }
38871
- return this.triggerTradeFromConfig({
38872
- symbol,
38873
- kind: "long"
38874
- });
38876
+ if (changed) {
38877
+ return this.triggerTradeFromConfig({
38878
+ symbol,
38879
+ kind: "long"
38880
+ });
38881
+ }
38882
+ return false;
38875
38883
  }
38876
38884
  }
38877
38885
  function getExchangeKlass(exchange) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-13",
4
+ "version": "0.0.2-15",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",