package SQ.Columns.Databanks; import com.strategyquant.lib.*; import com.strategyquant.datalib.*; import com.strategyquant.tradinglib.*; public class CAGRExp extends DatabankColumn { public CAGRExp() { super("CAGR/Exp", DatabankColumn.Decimal2Pct, // value display format ValueTypes.Maximize, // whether value should be maximized / minimized / approximated to a value 0, // target value if approximation was chosen 0, // average minimum of this value 100); // average maximum of this value setWidth(80); // defaultcolumn width in pixels setTooltip("CAGR / Exposure"); setDependencies("CAGR", "Exposure"); } @Override public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort) throws Exception { double cagr = stats.getDouble("CAGR"); double exposure = stats.getDouble("Exposure"); double cagr_exp = SQUtils.safeDivide(cagr, exposure); /* round and return the value. It will be saved into stats under the key "CAGRExp" */ return round2(cagr_exp * 100); } }
CAGR/ Exposure can be 0 for some strategies.
You can use DebugConsole to get more info
https://strategyquant.com/doc/programming-for-sq/logging-and-debugcolsole/
If you still need some help please attach the problematic strategies to dig deeper.
Sincerely,
Tamas