Warning: session_start(): open(/var/lib/php/sessions/sess_j988m1iq98er0quvcv30fght94, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass TradingSignal extends Meta {
settable S coin;
settable bool isLong;
settable Timestamp timestamp;
settable TradingRun afterRun;
toString {
S text = (isLong ? "Long" : "Short") + " signal "
+ (empty(coin) ? "" : "for " + coin + " ") + "at "
+ timestamp;
if (afterRun != null)
text += " after " + formatDouble2X(afterRun.changePercent()) + "% run";
ret text;
}
// last candle before signal
TradingCandle candle() { ret afterRun == null ?: last(afterRun.candles); }
// Price at signal
double price() {
var candle = candle();
ret candle == null ? Double.NaN : candle.end();
}
}