...
This commit is contained in:
@@ -470,7 +470,9 @@ object TradingLogStore {
|
||||
val stockName: String,
|
||||
val decision: String,
|
||||
val confidence: Double,
|
||||
val reason: String
|
||||
val reason: String,
|
||||
var stockCode: String? = null,
|
||||
var qty: Int? = 0,
|
||||
)
|
||||
|
||||
fun addLog(decision: TradingDecision) {
|
||||
@@ -519,15 +521,17 @@ object TradingLogStore {
|
||||
fun addAnalyzer(name : String, code : String, log: String, positive : Boolean = false) {
|
||||
synchronized(this) {
|
||||
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
|
||||
decisionLogs.add(
|
||||
LogEntry(
|
||||
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
|
||||
stockName = "$name[$code] 분석",
|
||||
decision = if(positive) "ANALYZER" else "PASS",
|
||||
confidence = 100.0,
|
||||
reason = log
|
||||
if (positive) {
|
||||
decisionLogs.add(
|
||||
LogEntry(
|
||||
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
|
||||
stockName = "$name[$code] 분석",
|
||||
decision = if (positive) "ANALYZER" else "PASS",
|
||||
confidence = 100.0,
|
||||
reason = log
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -546,6 +550,24 @@ object TradingLogStore {
|
||||
}
|
||||
}
|
||||
|
||||
fun addNotice(name : String, code : String, log: String, qty: Int? = null) {
|
||||
synchronized(this) {
|
||||
if (decisionLogs.size > 1000) decisionLogs.removeAt(0)
|
||||
decisionLogs.add(
|
||||
LogEntry(
|
||||
time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss")),
|
||||
stockName = "$name[$code] 분석",
|
||||
decision = "NOTICE",
|
||||
confidence = 100.0,
|
||||
reason = log,
|
||||
stockCode = code,
|
||||
qty = qty
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun addAfterMarketLog(name : String, code : String, log: String) {
|
||||
synchronized(this) {
|
||||
|
||||
Reference in New Issue
Block a user