Plugin types

This commit is contained in:
2026-07-28 06:28:51 +02:00
parent 969a778a3e
commit ab4826dcca
2 changed files with 122 additions and 1 deletions
+39 -1
View File
@@ -15,6 +15,23 @@ class LogKind:
class Err: pass
class Debug: pass
@pwp_enum
class CandleInterval:
class OneMinute: pass
class ThreeMinutes: pass
class FiveMinutes: pass
class FifteenMinutes: pass
class ThirtyMinutes: pass
class OneHour: pass
class TwoHours: pass
class FourHours: pass
class EightHours: pass
class TwelveHours: pass
class OneDay: pass
class ThreeDays: pass
class OneWeek: pass
class OneMonth: pass
@pwp
class Signal:
symbol: str
@@ -31,8 +48,29 @@ class EventLog:
name: str
message: str
@pwp
class Position:
symbol: units.Symbol
size: f64
entry_price: units.USD
profit: units.USD
profit: units.USD
@pwp
class MarketItem:
symbol: units.Symbol
price: units.USD
trend: f64
volume_24h: units.USD
@pwp
class Candle:
open_time: u64
close_time: u64
coin: str
interval: str
open: f64
high: f64
low: f64
close: f64
volume: f64
num_trades: u64
+83
View File
@@ -0,0 +1,83 @@
from pwp import pwp, pwp_enum
from adv_types import *
import units
import general
from typing import Optional
@pwp
class StrategySignal:
symbol: str
side: units.Direction
confidence: f32
price: Optional[f64]
@pwp_enum
class StrategyMessage:
class Log:
log: general.EventLog
class GetWatchList: pass
class RequestCandlestick:
symbol: str
interval: u8
count: u32
class Subscribe:
subscription: u8
class Unsubscribe:
subscription: u8
class UnsubscribeAll: pass
class Signal:
signal: StrategySignal
@pwp_enum
class RiskMessage:
class Log:
log: general.EventLog
class GetWatchList: pass
class Approve:
signal: general.Signal
class Reject:
reason: str
@pwp_enum
class StrategyEngineMessage:
class Initialize: pass
class WatchList:
watchlist: list[general.MarketItem]
class Command:
command: str
args: list[str]
class CandleUpdate:
symbol: str
interval: general.CandleInterval
candle: general.Candle
class CandleStick:
symbol: str
interval: general.CandleInterval
candles: list[general.Candle]
@pwp_enum
class RiskEngineMessage:
class Initialize: pass
class WatchList:
watchlist: list[general.MarketItem]
class Command:
command: str
args: list[str]
class Signal:
signal: general.Signal