sclass G22StrategyRun { settable G22TradingStrategy strategy; settable TickerSequence ticker; settable new TickerSequence profitTicker; settable double finalProfit; settable transient IIteratorMonitor iteratorMonitor = dummyIteratorMonitor(); double totalProfit() { ret finalProfit; } run { strategy(strategy.emptyClone()); strategy.logToPrint(false); strategy.actualTicker(ticker); strategy.primed(true); strategy.active(true); temp it = iteratorMonitor.monitorIterator("Backtest", ticker.pricePoints()); for (pricePoint : it) { if (!strategy.active()) break; strategy.feed(pricePoint); double profit = strategy.coinProfit(); profitTicker.addIfPriceChanged(profit, pricePoint.timestamp); } strategy.closeMyself(); finalProfit(strategy.coinProfit()); } }