private static CustomButton doIndividualTickerButtonForPanel(
			ArrayList<String> bundle, final String ticker,
			final String buttonData, final JFrame closeMe, int type) {

		boolean filterResults = meetsFilter(ticker);

		if (!filterResults)
			return null;
		final CustomButton a = new CustomButton((ticker));
		a.setPreferredSize(new Dimension(60, 20));
		final int tickerLocation = Database.dbSet.indexOf(ticker);
		double marketCap = Database.DB_ARRAY.lastEntry().getValue()[tickerLocation][38];
		addButtonDetails(a, marketCap, tickerLocation, buttonData);

		if (filterResults) {
			bundle.add(ticker);
			if (type == EARNINGS_REPORT) {
				colorButtonByPercentChangeAfterEarningsReport(a, buttonData, a
						.getText().split(" ")[0]);
			} else if (type == NON_EARNINGS_REPORT) {
				colorButtonByOverallChange(a, ticker);
			}
		} else {
			a.setBackground(Color.DARK_GRAY);
		}
		a.setHorizontalAlignment(SwingConstants.LEFT);
		a.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				// negative time for most recent listed first
				EarningsTest.programSettings.myHistory.put(
						-System.currentTimeMillis(), ticker);
				MemoryManager.saveSettings();
				final JFrame jf = new JFrame(a.getText());
				jf.setSize(1300, 650);
				jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
			
				jf.setExtendedState(jf.getExtendedState()
						| JFrame.MAXIMIZED_BOTH);
				jf.setVisible(true);
				// closeMe.dispose();
				if (EarningsTest.singleton.showFFT.isSelected()) {
					// FFT fft = new
					// FFT(Database.spawnTimeSeriesForFFT(ticker));
					FFT fft = new FFT(Database.spawnAveragesArrayFromPricePair(
							ticker, EarningsTest.singleton.daysChoice
									.getSelectedIndex()));
					fft.showFrequencyGraph();
				}
				ProfileCanvas pc = new ProfileCanvas((buttonData),
						tickerLocation, jf.getWidth(), jf.getHeight());
				// /////////////
				addTickerMangerPanel(jf, ticker, tickerLocation);
				// ////////////MEMORYLEAKFIX
				final ComponentListener refForRemoval = JComponentFactory
						.doWindowRescaleListener(pc);
				jf.addComponentListener(refForRemoval);
				jf.addWindowListener(new WindowAdapter(){
							  @Override 
					            public void windowClosing(WindowEvent e) { 
					                 jf.removeComponentListener(refForRemoval);
							  }
						});
				jf.add(JComponentFactory.makeJScrollPane(pc));
			}

			private void addTickerMangerPanel(JFrame jf, String ticker,
					int tickerLocation) {

				String[] tradeOptions = { "buy", "sell" };
				JComboBox<String> buySell = new JComboBox<String>(tradeOptions);
				Integer[] rateOptions = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
				JComboBox<Integer> myRating = new JComboBox<Integer>(
						rateOptions);

				CustomButton saveTicker = new CustomButton("trade this stock");
				addSaveTickerListener(saveTicker, ticker, buySell, myRating);
				JPanel topPanel = JComponentFactory
						.makePanel(JComponentFactory.HORIZONTAL);
				topPanel.add(saveTicker);
				topPanel.add(myRating);
				topPanel.add(buySell);

				jf.add(topPanel, BorderLayout.NORTH);
			}

			private void addSaveTickerListener(CustomButton saveTicker,
					final String ticker, final JComboBox<String> tradeOpns,
					final JComboBox<Integer> rating) {
				saveTicker.addActionListener(new ActionListener() {

					@Override
					public void actionPerformed(ActionEvent arg0) {
						EarningsTest.singleton.programSettings.myTrades.put(
								System.currentTimeMillis(),
								new Trade((String) tradeOpns.getSelectedItem(),
										ticker, ((Integer) rating
												.getSelectedItem()).intValue()));
					}

				});
			}

		});
		return a;
	}