Class StrategyState

java.lang.Object
com.qtsurfer.api.client.model.StrategyState

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.14.0") public class StrategyState extends Object
What is known about a registered strategy: that it compiled, and what validating it found. **`validation: passed` does not mean the strategy is correct.** It means the class loaded and survived the first event of a short synthetic run — a floor, not a guarantee. When `dryRunIncomplete` is true it is a lower floor still, because the run did not finish.
  • Field Details

  • Constructor Details

    • StrategyState

      public StrategyState()
  • Method Details

    • strategyId

      public StrategyState strategyId(@Nonnull String strategyId)
    • getStrategyId

      @Nonnull public String getStrategyId()
      Unique identifier for a compiled strategy, derived from the source itself: the same code always yields the same id, for every caller, whatever its formatting. See `POST /strategy` for exactly which rewrites preserve it and which do not.
      Returns:
      strategyId
    • setStrategyId

      public void setStrategyId(@Nonnull String strategyId)
    • validation

      public StrategyState validation(@Nonnull StrategyState.ValidationEnum validation)
    • getValidation

      @Nonnull public StrategyState.ValidationEnum getValidation()
      * `not_validated` — registered, never checked. `POST /strategy/{strategyId}/validate` checks it. * `pending` — a check was asked for and has not answered yet. * `passed` — the class loaded and survived its first event. * `failed` — it did not; `detail` says how.
      Returns:
      validation
    • setValidation

      public void setValidation(@Nonnull StrategyState.ValidationEnum validation)
    • compiledAt

      public StrategyState compiledAt(@Nullable OffsetDateTime compiledAt)
    • getCompiledAt

      @Nullable public OffsetDateTime getCompiledAt()
      When the live compilation was produced.
      Returns:
      compiledAt
    • setCompiledAt

      public void setCompiledAt(@Nullable OffsetDateTime compiledAt)
    • requiredSources

      public StrategyState requiredSources(@Nullable List<StrategyState.RequiredSourcesEnum> requiredSources)
    • addRequiredSourcesItem

      public StrategyState addRequiredSourcesItem(StrategyState.RequiredSourcesEnum requiredSourcesItem)
    • getRequiredSources

      @Nullable public List<StrategyState.RequiredSourcesEnum> getRequiredSources()
      The market data a strategy needs, read off the compiled class rather than off anything you sent — `TickerStrategy`, `KlineStrategy` and `FundingRateStrategy` each declare one, and a `MultiSourceStrategy` declares a set. **Absent is not \"needs nothing\".** A strategy always needs market data, so an absent field never means an empty requirement — it means the platform could not establish the answer without constructing your strategy, which it will not do to fill in a field. That happens for a `MultiSourceStrategy`, for a class that overrides `getMarketDataSource()`, and for anything registered before this field existed; re-registering the source fills it in.
      Returns:
      requiredSources
    • setRequiredSources

      public void setRequiredSources(@Nullable List<StrategyState.RequiredSourcesEnum> requiredSources)
    • validatedAt

      public StrategyState validatedAt(@Nullable OffsetDateTime validatedAt)
    • getValidatedAt

      @Nullable public OffsetDateTime getValidatedAt()
      When the verdict was recorded. Absent until there is one.
      Returns:
      validatedAt
    • setValidatedAt

      public void setValidatedAt(@Nullable OffsetDateTime validatedAt)
    • detail

      public StrategyState detail(@Nullable String detail)
    • getDetail

      @Nullable public String getDetail()
      Why validation failed, or why a queued check has not reported. Present on `failed`, and alongside `validationStalled`.
      Returns:
      detail
    • setDetail

      public void setDetail(@Nullable String detail)
    • notices

      public StrategyState notices(@Nullable List<Notice> notices)
    • addNoticesItem

      public StrategyState addNoticesItem(Notice noticesItem)
    • getNotices

      @Nullable public List<Notice> getNotices()
      What the run surfaced. An empty or absent list is not a clean bill of health when `dryRunIncomplete` is true — see that field.
      Returns:
      notices
    • setNotices

      public void setNotices(@Nullable List<Notice> notices)
    • noticesTruncated

      public StrategyState noticesTruncated(@Nullable Integer noticesTruncated)
    • getNoticesTruncated

      @Nullable public Integer getNoticesTruncated()
      How many notices were dropped past the cap. Absent when none were.
      Returns:
      noticesTruncated
    • setNoticesTruncated

      public void setNoticesTruncated(@Nullable Integer noticesTruncated)
    • dryRunIncomplete

      public StrategyState dryRunIncomplete(@Nullable Boolean dryRunIncomplete)
    • getDryRunIncomplete

      @Nullable public Boolean getDryRunIncomplete()
      The check did not finish its budget — it ran out of time, was refused because the platform was already holding too many unfinishable runs, or hit a failure attributable to the synthetic instrument rather than to your strategy. The verdict stands as far as it went; it simply reached less than a full run would.
      Returns:
      dryRunIncomplete
    • setDryRunIncomplete

      public void setDryRunIncomplete(@Nullable Boolean dryRunIncomplete)
    • validationStalled

      public StrategyState validationStalled(@Nullable Boolean validationStalled)
    • getValidationStalled

      @Nullable public Boolean getValidationStalled()
      A queued check has not reported for far longer than one takes. Nothing is disproved about the strategy — the check has not run. Stop waiting and re-request it later.
      Returns:
      validationStalled
    • setValidationStalled

      public void setValidationStalled(@Nullable Boolean validationStalled)
    • equals

      public boolean equals(Object o)
      Return true if this StrategyState object is equal to o.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUrlQueryString

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string