Warning: session_start(): open(/var/lib/php/sessions/sess_8suu8ph0g2nkvhkklgo1ufkj31, 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 G22StrategyRun {
settable G22TradingStrategy strategy;
settable TickerSequence ticker;
settable new TickerSequence profitTicker;
settable double finalProfit;
double totalProfit() { ret finalProfit; }
run {
strategy(strategy.emptyClone());
strategy.primed(true);
strategy.active(true);
for (pricePoint : ticker.pricePoints()) {
if (!strategy.active()) break;
strategy.feed(pricePoint);
double profit = strategy.coinProfit();
profitTicker.addIfPriceChanged(profit, pricePoint.timestamp);
}
strategy.closeAllPositions();
finalProfit(strategy.coinProfit());
}
}