package com.strategyquant.extend.MonteCarloValues;

import com.strategyquant.lib.fitness.FitnessFunction;
import com.strategyquant.lib.language.L;
import com.strategyquant.lib.snippets.MonteCarloSim.MCStatsConst;
import com.strategyquant.lib.snippets.MonteCarloSim.MCValueComputer;
import com.strategyquant.lib.snippets.MonteCarloSim.MonteCarloStatValues;

public class MCNumberOfTraders extends MCValueComputer {

	public MCNumberOfTraders() {
		super(MCStatsConst.NUMBER_OF_TRADES, FitnessFunction.MAXIMIZE);
		
		setColumnName(L.t("Number of trades"));		
		setColumnWidth(100);
		setTooltip(L.t("Number of trades"));
	}

	@Override
	protected double compute(MonteCarloStatValues statValues, double initialCapital, double[] orders, double avgTradesPerMonth) throws Exception {
		return orders.length;
	}

	@Override
	public String formatValue(double value) {
		return String.valueOf(value);
	}
}
