import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.stat.descriptive.moment.StandardDeviation;
import org.apache.commons.math3.stat.descriptive.rank.Percentile;
import org.apache.commons.math3.stat.ranking.NaNStrategy;
import org.apache.commons.math3.util.KthSelector;
import org.apache.commons.math3.util.MedianOf3PivotingStrategy;
import org.apache.logging.log4j.Logger;
import com.financebt.orderbook.OrderBook;
import com.financebt.strategy.pojo.Order;
import com.financebt.util.ServletUtil;
public class MomentumVolatiltyPercentile extends StrategyImpl {
// JDBC driver name and database URL
static final String JDBC_DRIVER = “oracle.jdbc.OracleDriver”;
static final String DB_URL = “jdbc:oracle:thin:@127.0.0.1:1521:fbt”;
//outs
// ASUZU
// AVISA
// ERBOS
// HURGZ
// ICBCT
// MNDRS
// SASA
// SKBNK
// TRCAS
// Database credentials
static final String USER = “fbtdevelopment”;
static final String PASS = “IN1VJ7sR7”;
public static final List<String> symbols = Arrays.asList(“ADEL”, “AFYON”,
“AKENR”, “AKSA”, “AKSEN”, “ALARK”, “ALBRK”, “ALKIM”, “ANACM”,
“AEFES”, “ASELS”, “AYGAZ”, “BAGFS”, “BJKAS”,
“BIZIM”, “BRSAN”, “BRISA”, “CCOLA”, “CLEBI”, “CIMSA”, “ECILC”,
“ECZYT”, “EGEEN”, “FENER”, “GSRAY”, “ALGYO”, “GOZDE”,
“HLGYO”, “ISGYO”, “SAFGY”, “SNGYO”, “TRGYO”, “VKGYO”, “GLYHO”,
//”GOODY”,
“GOLTS”, “GSDHO”, “GUBRF”, “IPEKE”,
“KARSN”, “KARTN”, “KONYA”, “KOZAA”, “METRO”, “NTHOL”,
“NETAS”, “ODAS”, “PRKME”, “SODA”, “TATGD”,
“TKNSA”, “TSKB”, “TMSN”, “TTRAK”, “VESTL”,”CRFSA”,”DEVA”,”DOCO”,”IZMDC”,”KIPA”,”KORDS”,”LOGO”,”PARSN”,
“VESBE”, “YAZIC”, “ZOREN”,”IHLAS”);
//”ALCTL”,
private Logger logger;
private String name;
private String executionDay;
private boolean isSimulation;
private boolean isCummilative;
private Map<String, List<Integer>> executions;
private Map<String, String> depths;
private List<Order> orderList;
private long money;
private Map<String, Double> allocMap;
private Map<String, Integer> amountPriceMap;
private int idCounter;
private Set<String> dublicateCancelSet;
private Map<String,OrderBook> books;
private String report;