sclass PullbackToProfit { settable double pullback; settable double profit; settable long startTime; settable long timestamp; settable bool isShort; double cleanness() { ret profit() <= 0 ? 0 : profit()/pullback(); } // Are we going backwards in time? bool isBackwards() { ret timestamp < startTime; } toString { var duration = formatMinutes(absDiff(timestamp(), startTime())); ret shortenNumbers(2, concat( isShort != isBackwards() ? "Short" : "Long", " with callback ", pullback(), "% yields ", profit(), "% profit in ", duration, " (cleanness ", formatDouble1(cleanness()), ")")); } bool replaces(PullbackToProfit ptp) { ret pullback() <= ptp.pullback() && profit() >= ptp.profit(); } }