//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

/* tslint:disable */
/* eslint-disable */
// ReSharper disable InconsistentNaming



export interface Account {
    name: string;
    exchange: TradingExchanges;
    type: AccountType;
    key?: string | null;
    secret?: string | null;
    user?: User | null;
    balances?: Balance[] | null;
}

export enum TradingExchanges {
    Binance = "Binance",
    Kraken = "Kraken",
    Ftx = "Ftx",
    Evm = "Evm",
    GmxV2 = "GmxV2",
}

export enum AccountType {
    Cex = "Cex",
    Trader = "Trader",
    Watch = "Watch",
    Auth = "Auth",
    Privy = "Privy",
}

export interface User {
    name?: string | null;
    accounts?: Account[] | null;
}

export interface Balance {
    tokenImage?: string | null;
    tokenName?: string | null;
    amount?: number;
    price?: number;
    value?: number;
    tokenAdress?: string | null;
    chain?: Chain | null;
}

export interface Chain {
    id?: string | null;
    rpcUrl?: string | null;
    name?: string | null;
    chainId?: number;
}

export interface Backtest {
    id: string;
    finalPnl: number;
    winRate: number;
    growthPercentage: number;
    hodlPercentage: number;
    ticker: Ticker;
    scenario: string;
    positions: Position[];
    signals: Signal[];
    timeframe: Timeframe;
    botType: BotType;
    accountName: string;
    candles: Candle[];
    startDate: Date;
    endDate: Date;
    statistics: PerformanceMetrics;
    fees: number;
    walletBalances: KeyValuePairOfDateTimeAndDecimal[];
    optimizedMoneyManagement: MoneyManagement;
    moneyManagement: MoneyManagement;
    user: User;
    strategiesValues: { [key in keyof typeof StrategyType]?: StrategiesResultBase; };
    score: number;
}

export enum Ticker {
    AAVE = "AAVE",
    ADA = "ADA",
    APE = "APE",
    ALGO = "ALGO",
    ARB = "ARB",
    ATOM = "ATOM",
    AVAX = "AVAX",
    BNB = "BNB",
    BTC = "BTC",
    BAL = "BAL",
    CHZ = "CHZ",
    COMP = "COMP",
    CRO = "CRO",
    CRV = "CRV",
    DOGE = "DOGE",
    DOT = "DOT",
    DYDX = "DYDX",
    ENS = "ENS",
    ETC = "ETC",
    ETH = "ETH",
    FIL = "FIL",
    FLM = "FLM",
    FTM = "FTM",
    GALA = "GALA",
    GMX = "GMX",
    GRT = "GRT",
    IMX = "IMX",
    JASMY = "JASMY",
    KSM = "KSM",
    LDO = "LDO",
    LINK = "LINK",
    LRC = "LRC",
    LTC = "LTC",
    MANA = "MANA",
    MATIC = "MATIC",
    MKR = "MKR",
    NEAR = "NEAR",
    OP = "OP",
    PEPE = "PEPE",
    QTUM = "QTUM",
    REN = "REN",
    ROSE = "ROSE",
    RSR = "RSR",
    RUNE = "RUNE",
    SAND = "SAND",
    SOL = "SOL",
    SRM = "SRM",
    SUSHI = "SUSHI",
    THETA = "THETA",
    UNI = "UNI",
    USDC = "USDC",
    USDT = "USDT",
    WIF = "WIF",
    XMR = "XMR",
    XRP = "XRP",
    XTZ = "XTZ",
    SHIB = "SHIB",
    STX = "STX",
    ORDI = "ORDI",
    Unknown = "Unknown",
}

export interface Position {
    accountName: string;
    date: Date;
    originDirection: TradeDirection;
    ticker: Ticker;
    moneyManagement: MoneyManagement;
    open: Trade;
    stopLoss: Trade;
    takeProfit1: Trade;
    takeProfit2?: Trade | null;
    profitAndLoss?: ProfitAndLoss | null;
    status: PositionStatus;
    signalIdentifier?: string | null;
    identifier: string;
    initiator: PositionInitiator;
    user?: User | null;
}

export enum TradeDirection {
    None = "None",
    Short = "Short",
    Long = "Long",
}

export interface MoneyManagement {
    name: string;
    timeframe: Timeframe;
    balanceAtRisk: number;
    stopLoss: number;
    takeProfit: number;
    leverage: number;
    user?: User | null;
}

export enum Timeframe {
    FiveMinutes = "FiveMinutes",
    FifteenMinutes = "FifteenMinutes",
    ThirtyMinutes = "ThirtyMinutes",
    OneHour = "OneHour",
    FourHour = "FourHour",
    OneDay = "OneDay",
}

export interface Trade {
    fee?: number;
    date: Date;
    direction: TradeDirection;
    status: TradeStatus;
    tradeType: TradeType;
    ticker: Ticker;
    quantity: number;
    price: number;
    leverage?: number;
    exchangeOrderId: string;
    message?: string | null;
}

export enum TradeStatus {
    PendingOpen = "PendingOpen",
    Requested = "Requested",
    Cancelled = "Cancelled",
    Filled = "Filled",
}

export enum TradeType {
    Limit = "Limit",
    Market = "Market",
    StopMarket = "StopMarket",
    StopLimit = "StopLimit",
    StopLoss = "StopLoss",
    TakeProfit = "TakeProfit",
    StopLossProfit = "StopLossProfit",
    StopLossProfitLimit = "StopLossProfitLimit",
    StopLossLimit = "StopLossLimit",
    TakeProfitLimit = "TakeProfitLimit",
    TrailingStop = "TrailingStop",
    TrailingStopLimit = "TrailingStopLimit",
    StopLossAndLimit = "StopLossAndLimit",
    SettlePosition = "SettlePosition",
}

export interface ProfitAndLoss {
    realized?: number;
    net?: number;
    averageOpenPrice?: number;
}

export enum PositionStatus {
    New = "New",
    Canceled = "Canceled",
    Rejected = "Rejected",
    Updating = "Updating",
    PartiallyFilled = "PartiallyFilled",
    Filled = "Filled",
    Flipped = "Flipped",
    Finished = "Finished",
}

export enum PositionInitiator {
    PaperTrading = "PaperTrading",
    Bot = "Bot",
    User = "User",
    CopyTrading = "CopyTrading",
}

export interface ValueObject {
}

export interface Signal extends ValueObject {
    status: SignalStatus;
    direction: TradeDirection;
    confidence: Confidence;
    timeframe: Timeframe;
    date: Date;
    candle: Candle;
    identifier: string;
    ticker: Ticker;
    exchange: TradingExchanges;
    strategyType: StrategyType;
    signalType: SignalType;
    user?: User | null;
}

export enum SignalStatus {
    WaitingForPosition = "WaitingForPosition",
    PositionOpen = "PositionOpen",
    Expired = "Expired",
}

export enum Confidence {
    Low = "Low",
    Medium = "Medium",
    High = "High",
    None = "None",
}

export interface Candle {
    exchange: TradingExchanges;
    ticker: string;
    openTime: Date;
    date: Date;
    open: number;
    close: number;
    volume?: number;
    high: number;
    low: number;
    baseVolume?: number;
    quoteVolume?: number;
    tradeCount?: number;
    takerBuyBaseVolume?: number;
    takerBuyQuoteVolume?: number;
    timeframe: Timeframe;
}

export enum StrategyType {
    RsiDivergence = "RsiDivergence",
    RsiDivergenceConfirm = "RsiDivergenceConfirm",
    MacdCross = "MacdCross",
    EmaCross = "EmaCross",
    ThreeWhiteSoldiers = "ThreeWhiteSoldiers",
    SuperTrend = "SuperTrend",
    ChandelierExit = "ChandelierExit",
    EmaTrend = "EmaTrend",
    Composite = "Composite",
    StochRsiTrend = "StochRsiTrend",
    Stc = "Stc",
    StDev = "StDev",
    LaggingStc = "LaggingStc",
    SuperTrendCrossEma = "SuperTrendCrossEma",
}

export enum SignalType {
    Signal = "Signal",
    Trend = "Trend",
    Context = "Context",
}

export enum BotType {
    SimpleBot = "SimpleBot",
    ScalpingBot = "ScalpingBot",
    FlippingBot = "FlippingBot",
}

export interface PerformanceMetrics {
    count?: number;
    sharpeRatio?: number;
    maxDrawdown?: number;
    maxDrawdownPc?: number;
    maxDrawdownRecoveryTime?: string;
    winningTrades?: number;
    loosingTrades?: number;
    totalPnL?: number;
}

export interface KeyValuePairOfDateTimeAndDecimal {
    key?: Date;
    value?: number;
}

export interface StrategiesResultBase {
    ema?: EmaResult[] | null;
    macd?: MacdResult[] | null;
    rsi?: RsiResult[] | null;
    stoch?: StochResult[] | null;
    stochRsi?: StochRsiResult[] | null;
    bollingerBands?: BollingerBandsResult[] | null;
    chandelierShort?: ChandelierResult[] | null;
    stc?: StcResult[] | null;
    stdDev?: StdDevResult[] | null;
    superTrend?: SuperTrendResult[] | null;
    chandelierLong?: ChandelierResult[] | null;
}

export interface ResultBase {
    date?: Date;
}

export interface EmaResult extends ResultBase {
    ema?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface MacdResult extends ResultBase {
    macd?: number | null;
    signal?: number | null;
    histogram?: number | null;
    fastEma?: number | null;
    slowEma?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface RsiResult extends ResultBase {
    rsi?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

/** Stochastic indicator results includes aliases for those who prefer the simpler K,D,J outputs.  See  documentation  for more information. */
export interface StochResult extends ResultBase {
    oscillator?: number | null;
    signal?: number | null;
    percentJ?: number | null;
    k?: number | null;
    d?: number | null;
    j?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StochRsiResult extends ResultBase {
    stochRsi?: number | null;
    signal?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface BollingerBandsResult extends ResultBase {
    sma?: number | null;
    upperBand?: number | null;
    lowerBand?: number | null;
    percentB?: number | null;
    zScore?: number | null;
    width?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface ChandelierResult extends ResultBase {
    chandelierExit?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StcResult extends ResultBase {
    stc?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface StdDevResult extends ResultBase {
    stdDev?: number | null;
    mean?: number | null;
    zScore?: number | null;
    stdDevSma?: number | null;
    "skender.Stock.Indicators.IReusableResult.Value"?: number | null;
}

export interface SuperTrendResult extends ResultBase {
    superTrend?: number | null;
    upperBand?: number | null;
    lowerBand?: number | null;
}

export interface StartBotRequest {
    botType: BotType;
    botName: string;
    ticker: Ticker;
    timeframe: Timeframe;
    isForWatchOnly: boolean;
    scenario: string;
    accountName: string;
    moneyManagementName: string;
}

export interface TradingBot {
    name: string;
    status: string;
    signals: Signal[];
    positions: Position[];
    candles: Candle[];
    winRate: number;
    profitAndLoss: number;
    timeframe: Timeframe;
    ticker: Ticker;
    scenario: string;
    isForWatchingOnly: boolean;
    botType: BotType;
    accountName: string;
    moneyManagement: MoneyManagement;
}

export interface SpotlightOverview {
    spotlights: Spotlight[];
    dateTime: Date;
    identifier?: string;
    scenarioCount?: number;
}

export interface Spotlight {
    scenario: Scenario;
    tickerSignals: TickerSignal[];
}

export interface Scenario {
    name?: string | null;
    strategies?: Strategy[] | null;
    loopbackPeriod?: number | null;
    user?: User | null;
}

export interface Strategy {
    name?: string | null;
    type?: StrategyType;
    signalType?: SignalType;
    minimumHistory?: number;
    period?: number | null;
    fastPeriods?: number | null;
    slowPeriods?: number | null;
    signalPeriods?: number | null;
    multiplier?: number | null;
    smoothPeriods?: number | null;
    stochPeriods?: number | null;
    cyclePeriods?: number | null;
    user?: User | null;
}

export interface TickerSignal {
    ticker: Ticker;
    fiveMinutes: Signal[];
    fifteenMinutes: Signal[];
    oneHour: Signal[];
    fourHour: Signal[];
    oneDay: Signal[];
}

export enum RiskLevel {
    Low = "Low",
    Medium = "Medium",
    High = "High",
    Adaptive = "Adaptive",
}

export interface LoginRequest {
    name: string;
    address: string;
    signature: string;
    message: string;
}

export interface Workflow {
    name: string;
    usage: WorkflowUsage;
    flows: IFlow[];
    description: string;
}

export enum WorkflowUsage {
    Trading = "Trading",
    Task = "Task",
}

export interface IFlow {
    id: string;
    name: string;
    type: FlowType;
    description: string;
    acceptedInputs: FlowOutput[];
    children?: IFlow[] | null;
    parameters: FlowParameter[];
    parentId?: string;
    output?: string | null;
    outputTypes: FlowOutput[];
}

export enum FlowType {
    RsiDivergence = "RsiDivergence",
    FeedTicker = "FeedTicker",
    OpenPosition = "OpenPosition",
}

export enum FlowOutput {
    Signal = "Signal",
    Candles = "Candles",
    Position = "Position",
    MoneyManagement = "MoneyManagement",
}

export interface FlowParameter {
    value?: any | null;
    name?: string | null;
}

export interface SyntheticWorkflow {
    name: string;
    usage: WorkflowUsage;
    description: string;
    flows: SyntheticFlow[];
}

export interface SyntheticFlow {
    id: string;
    parentId?: string | null;
    type: FlowType;
    parameters: SyntheticFlowParameter[];
}

export interface SyntheticFlowParameter {
    value: string;
    name: string;
}

export interface FileResponse {
    data: Blob;
    status: number;
    fileName?: string;
    headers?: { [name: string]: any };
}