@backtest-kit/ollama 0.1.2 → 0.1.4

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/build/index.cjs CHANGED
@@ -466,7 +466,7 @@ class OutlinePrivateService {
466
466
  priceStopLoss: +data.price_stop_loss,
467
467
  priceTakeProfit: +data.price_take_profit,
468
468
  note: await toPlainString(data.risk_note),
469
- priceOpen: +data.price_open,
469
+ priceOpen: data.price_open ? +data.price_open : undefined,
470
470
  };
471
471
  };
472
472
  }
@@ -5132,11 +5132,12 @@ agentSwarmKit.addOutline({
5132
5132
  },
5133
5133
  {
5134
5134
  validate: ({ data }) => {
5135
- if (!data.price_open || data.price_open <= 0) {
5136
- throw new Error("The price_open field must contain a positive price");
5135
+ if (data.position !== "wait" &&
5136
+ (!data.price_open || data.price_open <= 0)) {
5137
+ throw new Error("When position='long' or 'short', the price_open field is required and must be positive");
5137
5138
  }
5138
5139
  },
5139
- docDescription: "Validates that opening price is specified and positive.",
5140
+ docDescription: "Validates that opening price is specified and positive when opening a position.",
5140
5141
  },
5141
5142
  {
5142
5143
  validate: ({ data }) => {
@@ -5158,7 +5159,7 @@ agentSwarmKit.addOutline({
5158
5159
  },
5159
5160
  {
5160
5161
  validate: ({ data }) => {
5161
- if (data.position === "long") {
5162
+ if (data.position === "long" && data.price_open && data.price_stop_loss && data.price_take_profit) {
5162
5163
  if (data.price_stop_loss >= data.price_open) {
5163
5164
  throw new Error("For LONG position, price_stop_loss must be below price_open");
5164
5165
  }
@@ -5171,7 +5172,7 @@ agentSwarmKit.addOutline({
5171
5172
  },
5172
5173
  {
5173
5174
  validate: ({ data }) => {
5174
- if (data.position === "short") {
5175
+ if (data.position === "short" && data.price_open && data.price_stop_loss && data.price_take_profit) {
5175
5176
  if (data.price_stop_loss <= data.price_open) {
5176
5177
  throw new Error("For SHORT position, price_stop_loss must be above price_open");
5177
5178
  }
package/build/index.mjs CHANGED
@@ -464,7 +464,7 @@ class OutlinePrivateService {
464
464
  priceStopLoss: +data.price_stop_loss,
465
465
  priceTakeProfit: +data.price_take_profit,
466
466
  note: await toPlainString(data.risk_note),
467
- priceOpen: +data.price_open,
467
+ priceOpen: data.price_open ? +data.price_open : undefined,
468
468
  };
469
469
  };
470
470
  }
@@ -5130,11 +5130,12 @@ addOutline({
5130
5130
  },
5131
5131
  {
5132
5132
  validate: ({ data }) => {
5133
- if (!data.price_open || data.price_open <= 0) {
5134
- throw new Error("The price_open field must contain a positive price");
5133
+ if (data.position !== "wait" &&
5134
+ (!data.price_open || data.price_open <= 0)) {
5135
+ throw new Error("When position='long' or 'short', the price_open field is required and must be positive");
5135
5136
  }
5136
5137
  },
5137
- docDescription: "Validates that opening price is specified and positive.",
5138
+ docDescription: "Validates that opening price is specified and positive when opening a position.",
5138
5139
  },
5139
5140
  {
5140
5141
  validate: ({ data }) => {
@@ -5156,7 +5157,7 @@ addOutline({
5156
5157
  },
5157
5158
  {
5158
5159
  validate: ({ data }) => {
5159
- if (data.position === "long") {
5160
+ if (data.position === "long" && data.price_open && data.price_stop_loss && data.price_take_profit) {
5160
5161
  if (data.price_stop_loss >= data.price_open) {
5161
5162
  throw new Error("For LONG position, price_stop_loss must be below price_open");
5162
5163
  }
@@ -5169,7 +5170,7 @@ addOutline({
5169
5170
  },
5170
5171
  {
5171
5172
  validate: ({ data }) => {
5172
- if (data.position === "short") {
5173
+ if (data.position === "short" && data.price_open && data.price_stop_loss && data.price_take_profit) {
5173
5174
  if (data.price_stop_loss <= data.price_open) {
5174
5175
  throw new Error("For SHORT position, price_stop_loss must be above price_open");
5175
5176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backtest-kit/ollama",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Multi-provider LLM inference library for AI-powered trading strategies. Supports 10+ providers including OpenAI, Claude, DeepSeek, Grok, Mistral with unified API and automatic token rotation.",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",