You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(148) |
Jun
(48) |
Jul
(107) |
Aug
(292) |
Sep
(301) |
Oct
(530) |
Nov
(142) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: xanaot <xa...@us...> - 2007-10-08 22:35:22
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22800/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Classe que gera Set de Strategies default Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NewReportFrame.java 8 Oct 2007 21:45:46 -0000 1.14 --- NewReportFrame.java 8 Oct 2007 22:35:24 -0000 1.15 *************** *** 1,3 **** ! package net.sf.tails.swing.frame.report; import java.awt.Dimension; --- 1,3 ---- ! package net.sf.tails.swing.frame.report; import java.awt.Dimension; *************** *** 18,28 **** import net.sf.tail.dsl.ruby.RubyDSL; import net.sf.tails.swing.frame.Index; /** ! * ! * @author Marcio */ public class NewReportFrame extends javax.swing.JFrame { ! private static final ResourceBundle messageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Messages"); private static final long serialVersionUID = 4704921929974302846L; --- 18,31 ---- import net.sf.tail.dsl.ruby.RubyDSL; import net.sf.tails.swing.frame.Index; + import net.sf.tails.swing.helper.DefaultStrategiesGenerator; + import net.sf.tails.swing.helper.EnumIndicator; /** ! * ! * @author Marcio */ public class NewReportFrame extends javax.swing.JFrame { ! private static final ResourceBundle messageBundle = ResourceBundle ! .getBundle("net.sf.tails.i18n.Messages"); private static final long serialVersionUID = 4704921929974302846L; *************** *** 35,39 **** private javax.swing.JPanel defaultReportPanel; private javax.swing.JPanel radioGroupPanel; ! private javax.swing.JRadioButton jRadioButton8; private javax.swing.JScrollPane customStrategyPane; private javax.swing.JScrollPane radioGroupScrollPane; --- 38,42 ---- private javax.swing.JPanel defaultReportPanel; private javax.swing.JPanel radioGroupPanel; ! private javax.swing.JRadioButton jRadioButtonSMA; private javax.swing.JScrollPane customStrategyPane; private javax.swing.JScrollPane radioGroupScrollPane; *************** *** 45,56 **** private Index index; public NewReportFrame(Index index, StockAnalysis stockAnalysis) { this.index = index; this.stockAnalysis = stockAnalysis; initComponents(); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ! this.setResizable(false); ! this.setLocationByPlatform(true); ! this.setTitle(messageBundle.getString("REPORT_TITLE")); } --- 48,61 ---- private Index index; + protected EnumIndicator selectedEnum; + public NewReportFrame(Index index, StockAnalysis stockAnalysis) { this.index = index; this.stockAnalysis = stockAnalysis; initComponents(); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ! this.setResizable(false); ! this.setLocationByPlatform(true); ! this.setTitle(messageBundle.getString("REPORT_TITLE")); } *************** *** 63,67 **** radioGroupScrollPane = new javax.swing.JScrollPane(); radioGroupPanel = new javax.swing.JPanel(); ! jRadioButton8 = new javax.swing.JRadioButton(); customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); --- 68,72 ---- radioGroupScrollPane = new javax.swing.JScrollPane(); radioGroupPanel = new javax.swing.JPanel(); ! jRadioButtonSMA = new javax.swing.JRadioButton(); customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); *************** *** 75,158 **** reportNameField.setSize(170, 20); reportNameField.setMaximumSize(new Dimension(170, 20)); ! createButtonDefaultPanel.setText("Create"); ! createButtonDefaultPanel.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCreateButtonActionPerformed(evt); ! } ! }); cancelButtonDefaultPanel.setText("Cancel"); ! cancelButtonDefaultPanel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCancelButtonActionPerformed(evt); } }); ! ! radioGroupScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ! indicatorsButtonGroup.add(jRadioButton8); ! jRadioButton8.setText("SMA"); ! jRadioButton8.setBorder(javax.swing.BorderFactory.createTitledBorder("")); ! jRadioButton8.setBorderPainted(true); ! jRadioButton8.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! ! javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout(radioGroupPanel); radioGroupPanel.setLayout(radioGroupPanelLayout); ! radioGroupPanelLayout.setHorizontalGroup( ! radioGroupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(radioGroupPanelLayout.createSequentialGroup() ! .addGroup(radioGroupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent(jRadioButton8)) ! .addGap(314, 314, 314)) ! ); ! radioGroupPanelLayout.setVerticalGroup( ! radioGroupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(radioGroupPanelLayout.createSequentialGroup() ! .addComponent(jRadioButton8) ! .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 82, Short.MAX_VALUE) ! .addContainerGap()) ! ); radioGroupScrollPane.setViewportView(radioGroupPanel); ! javax.swing.GroupLayout defaultTabPanel = new javax.swing.GroupLayout(defaultReportPanel); defaultReportPanel.setLayout(defaultTabPanel); ! defaultTabPanel.setHorizontalGroup( ! defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(defaultTabPanel.createSequentialGroup() ! .addGap(12) ! .addGroup(defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, defaultTabPanel.createSequentialGroup() ! .addComponent(cancelButtonDefaultPanel) ! .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent(createButtonDefaultPanel)) ! .addComponent(radioGroupScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)) ! .addContainerGap()) ! ); ! defaultTabPanel.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {createButtonDefaultPanel, cancelButtonDefaultPanel}); ! defaultTabPanel.setVerticalGroup( ! defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, defaultTabPanel.createSequentialGroup() ! .addGap(12) ! .addComponent(radioGroupScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addGap(6) ! .addGroup(defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent(createButtonDefaultPanel) ! .addComponent(cancelButtonDefaultPanel)) ! ) ! ); newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! //customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); ! ! customStrategyTextArea.addKeyListener(new KeyListener(){ @Override public void keyPressed(KeyEvent e) { textAreaTextChanged(e); } @Override public void keyReleased(KeyEvent e) { } @Override public void keyTyped(KeyEvent e) { --- 80,217 ---- reportNameField.setSize(170, 20); reportNameField.setMaximumSize(new Dimension(170, 20)); ! createButtonDefaultPanel.setText("Create"); ! createButtonDefaultPanel ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCreateButtonActionPerformed(evt); ! } ! }); cancelButtonDefaultPanel.setText("Cancel"); ! cancelButtonDefaultPanel ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCancelButtonActionPerformed(evt); ! } ! }); ! ! radioGroupScrollPane ! .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ! indicatorsButtonGroup.add(jRadioButtonSMA); ! jRadioButtonSMA.setText("SMA"); ! jRadioButtonSMA.setBorder(javax.swing.BorderFactory ! .createTitledBorder("")); ! jRadioButtonSMA.setBorderPainted(true); ! jRadioButtonSMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! jRadioButtonSMA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ! selectedEnum = EnumIndicator.SMA; } }); ! javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout( ! radioGroupPanel); radioGroupPanel.setLayout(radioGroupPanelLayout); ! radioGroupPanelLayout ! .setHorizontalGroup(radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! radioGroupPanelLayout ! .createSequentialGroup() ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! jRadioButtonSMA)) ! .addGap(314, 314, 314))); ! radioGroupPanelLayout ! .setVerticalGroup(radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! radioGroupPanelLayout ! .createSequentialGroup() ! .addComponent(jRadioButtonSMA) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED, ! 82, Short.MAX_VALUE) ! .addContainerGap())); radioGroupScrollPane.setViewportView(radioGroupPanel); ! javax.swing.GroupLayout defaultTabPanel = new javax.swing.GroupLayout( ! defaultReportPanel); defaultReportPanel.setLayout(defaultTabPanel); ! defaultTabPanel ! .setHorizontalGroup(defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! defaultTabPanel ! .createSequentialGroup() ! .addGap(12) ! .addGroup( ! defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel ! .createSequentialGroup() ! .addComponent( ! cancelButtonDefaultPanel) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent( ! createButtonDefaultPanel)) ! .addComponent( ! radioGroupScrollPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 385, ! Short.MAX_VALUE)) ! .addContainerGap())); ! defaultTabPanel.linkSize(javax.swing.SwingConstants.HORIZONTAL, ! new java.awt.Component[] { createButtonDefaultPanel, ! cancelButtonDefaultPanel }); ! defaultTabPanel ! .setVerticalGroup(defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel ! .createSequentialGroup() ! .addGap(12) ! .addComponent( ! radioGroupScrollPane, ! javax.swing.GroupLayout.PREFERRED_SIZE, ! 251, ! javax.swing.GroupLayout.PREFERRED_SIZE) ! .addGap(6) ! .addGroup( ! defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent( ! createButtonDefaultPanel) ! .addComponent( ! cancelButtonDefaultPanel)))); newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! // customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); ! ! customStrategyTextArea.addKeyListener(new KeyListener() { @Override public void keyPressed(KeyEvent e) { textAreaTextChanged(e); } + @Override public void keyReleased(KeyEvent e) { } + @Override public void keyTyped(KeyEvent e) { *************** *** 163,239 **** customStrategyCreateButton.setText("Create"); ! customStrategyCreateButton.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCreateButtonActionPerformed(evt); ! } ! }); customStrategyCancelButton.setText("Cancel"); ! customStrategyCancelButton.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCancelButtonActionPerformed(evt); ! } ! }); ! javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(customReportPanel); customReportPanel.setLayout(jPanel1Layout); ! jPanel1Layout.setHorizontalGroup( ! jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(jPanel1Layout.createSequentialGroup() ! .addContainerGap() ! .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent(customStrategyPane, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE) ! .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() ! .addComponent(customStrategyCancelButton) ! .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent(customStrategyCreateButton))) ! .addContainerGap()) ! ); ! jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {customStrategyCreateButton, customStrategyCancelButton}); ! jPanel1Layout.setVerticalGroup( ! jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(jPanel1Layout.createSequentialGroup() ! .addContainerGap() ! .addComponent(customStrategyPane, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE) ! .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent(customStrategyCreateButton) ! .addComponent(customStrategyCancelButton)) ! .addGap(18)) ! ); newReportTabbedPane.addTab("Custom Report", customReportPanel); ! newReportTabbedPane.getAccessibleContext().setAccessibleName("Default Report"); ! javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); ! layout.setHorizontalGroup( ! layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(10) ! .addComponent(reportNameLabel) ! .addComponent(reportNameField)) ! .addGroup(layout.createSequentialGroup() ! .addGap(10) ! .addComponent(newReportTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) ! .addGap(10)) ! ); ! layout.setVerticalGroup( ! layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(10) ! .addComponent(reportNameLabel) ! .addGap(10) ! .addContainerGap() ! .addComponent(newReportTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE) ! .addGap(10)) ! .addGroup(layout.createSequentialGroup() ! .addGap(10) ! .addComponent(reportNameField)) ! ); pack(); ! } private void textAreaTextChanged(KeyEvent keyEvent) { --- 222,327 ---- customStrategyCreateButton.setText("Create"); ! customStrategyCreateButton ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCreateButtonActionPerformed(evt); ! } ! }); customStrategyCancelButton.setText("Cancel"); ! customStrategyCancelButton ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCancelButtonActionPerformed(evt); ! } ! }); ! javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout( ! customReportPanel); customReportPanel.setLayout(jPanel1Layout); ! jPanel1Layout ! .setHorizontalGroup(jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! jPanel1Layout ! .createSequentialGroup() ! .addContainerGap() ! .addGroup( ! jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! customStrategyPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 375, ! Short.MAX_VALUE) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! jPanel1Layout ! .createSequentialGroup() ! .addComponent( ! customStrategyCancelButton) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent( ! customStrategyCreateButton))) ! .addContainerGap())); ! jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, ! new java.awt.Component[] { customStrategyCreateButton, ! customStrategyCancelButton }); ! jPanel1Layout ! .setVerticalGroup(jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! jPanel1Layout ! .createSequentialGroup() ! .addContainerGap() ! .addComponent( ! customStrategyPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 251, Short.MAX_VALUE) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addGroup( ! jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent( ! customStrategyCreateButton) ! .addComponent( ! customStrategyCancelButton)) ! .addGap(18))); newReportTabbedPane.addTab("Custom Report", customReportPanel); ! newReportTabbedPane.getAccessibleContext().setAccessibleName( ! "Default Report"); ! javax.swing.GroupLayout layout = new javax.swing.GroupLayout( ! getContentPane()); getContentPane().setLayout(layout); ! layout.setHorizontalGroup(layout.createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameLabel).addComponent(reportNameField)) ! .addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! newReportTabbedPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, 400, ! Short.MAX_VALUE).addGap(10))); ! layout.setVerticalGroup(layout.createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameLabel).addGap(10).addContainerGap() ! .addComponent(newReportTabbedPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, 327, ! Short.MAX_VALUE).addGap(10)).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameField))); pack(); ! } private void textAreaTextChanged(KeyEvent keyEvent) { *************** *** 251,263 **** } ! private void defaultPanelCreateButtonActionPerformed(java.awt.event.ActionEvent evt) { ! // TODO adicione seu c�digo de manipula��o aqui: ! } ! private void defaultPanelCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); ! } ! private void customStrategyCreateButtonActionPerformed(java.awt.event.ActionEvent evt) { try { --- 339,360 ---- } ! private void defaultPanelCreateButtonActionPerformed( ! java.awt.event.ActionEvent evt) { ! DefaultStrategiesGenerator defaulStrategies = new DefaultStrategiesGenerator(); ! Set<Strategy> strategies = defaulStrategies.generate(stockAnalysis ! .getStock().getSeries(), selectedEnum, 4, 60); ! // TODO: Acertas os parametros assim que a tela for finalizada ! stockAnalysis.createReport(reportNameField.getText(), strategies); ! index.loadStockAnalysis(stockAnalysis); ! this.dispose(); ! } ! private void defaultPanelCancelButtonActionPerformed( ! java.awt.event.ActionEvent evt) { this.dispose(); ! } ! private void customStrategyCreateButtonActionPerformed( ! java.awt.event.ActionEvent evt) { try { *************** *** 265,274 **** try { String dslHeader = read("/rubyDSLutils.rb"); ! dsl = new RubyDSL( dslHeader ,stockAnalysis.getStock().getSeries()); } catch (Exception e) { ! JOptionPane.showMessageDialog(null, "File not found: rubyDSLutils.rb .", "Error", 2); } Set<Strategy> strategies; ! strategies = dsl.evalStrategies(customStrategyTextArea.getText()); stockAnalysis.createReport(reportNameField.getText(), strategies); index.loadStockAnalysis(stockAnalysis); --- 362,373 ---- try { String dslHeader = read("/rubyDSLutils.rb"); ! dsl = new RubyDSL(dslHeader, stockAnalysis.getStock() ! .getSeries()); } catch (Exception e) { ! JOptionPane.showMessageDialog(null, ! "File not found: rubyDSLutils.rb .", "Error", 2); } Set<Strategy> strategies; ! strategies = dsl.evalStrategies(customStrategyTextArea.getText()); stockAnalysis.createReport(reportNameField.getText(), strategies); index.loadStockAnalysis(stockAnalysis); *************** *** 278,296 **** } ! } ! private static String read(String name) { String text = ""; ! Scanner scanner = new Scanner(NewReportFrame.class.getResourceAsStream(name)); while (scanner.hasNextLine()) { text += scanner.nextLine() + "\n"; } return text; ! } ! private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); ! } ! } --- 377,396 ---- } ! } ! private static String read(String name) { String text = ""; ! Scanner scanner = new Scanner(NewReportFrame.class ! .getResourceAsStream(name)); while (scanner.hasNextLine()) { text += scanner.nextLine() + "\n"; } return text; ! } ! private void customStrategyCancelButtonActionPerformed( ! java.awt.event.ActionEvent evt) { this.dispose(); ! } } |
|
From: xanaot <xa...@us...> - 2007-10-08 22:35:21
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22800/src/java/net/sf/tails/swing/helper Added Files: EnumIndicator.java DefaultStrategiesGenerator.java Log Message: Classe que gera Set de Strategies default --- NEW FILE: EnumIndicator.java --- package net.sf.tails.swing.helper; public enum EnumIndicator { SMA, EMA; } --- NEW FILE: DefaultStrategiesGenerator.java --- package net.sf.tails.swing.helper; import java.util.HashSet; import java.util.Set; import net.sf.tail.Indicator; import net.sf.tail.Strategy; import net.sf.tail.TimeSeries; import net.sf.tail.indicator.simple.ClosePriceIndicator; import net.sf.tail.indicator.tracker.EMAIndicator; import net.sf.tail.indicator.tracker.SMAIndicator; import net.sf.tail.strategy.IndicatorCrossedIndicatorStrategy; public class DefaultStrategiesGenerator { public Set<Strategy> generate(TimeSeries series, EnumIndicator indicatorName, int initial, int end) { Set<Strategy> strategies = new HashSet<Strategy>(); Indicator<? extends Number> close = new ClosePriceIndicator(series); Indicator<? extends Number> indicator; Strategy strategy; switch (indicatorName) { case SMA: for (int i = initial; i < end; i++) { indicator = new SMAIndicator(close, i); strategy = new IndicatorCrossedIndicatorStrategy(close, indicator); strategies.add(strategy); } break; case EMA: for (int i = initial; i < end; i++) { indicator = new EMAIndicator(close, initial); strategy = new IndicatorCrossedIndicatorStrategy(close, indicator); strategies.add(strategy); } break; } return strategies; } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:45:43
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1710/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NewReportFrame.java 8 Oct 2007 19:53:11 -0000 1.13 --- NewReportFrame.java 8 Oct 2007 21:45:46 -0000 1.14 *************** *** 4,10 **** import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Scanner; import java.util.Set; - import java.util.ResourceBundle; import javax.script.ScriptException; --- 4,10 ---- import java.awt.event.KeyEvent; import java.awt.event.KeyListener; + import java.util.ResourceBundle; import java.util.Scanner; import java.util.Set; import javax.script.ScriptException; *************** *** 238,246 **** private void textAreaTextChanged(KeyEvent keyEvent) { ! System.out.println("dnwidnwinwdindwidwni"); ! if(keyEvent.isControlDown() == true && keyEvent.getKeyChar() == 'c'){ ! System.out.println("kokokok"); } ! customStrategyTextArea.paste(); } --- 238,252 ---- private void textAreaTextChanged(KeyEvent keyEvent) { ! if(keyEvent.isControlDown() == true){ ! switch (keyEvent.getKeyCode()) { ! case KeyEvent.VK_SPACE: ! System.out.println("omomomoom"); ! break; ! ! default: ! break; ! } } ! //customStrategyTextArea.paste(); } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:02:33
|
Update of /cvsroot/tail/TailS/dsl In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16422/dsl Modified Files: rubyDSLutils.rb Log Message: Index: rubyDSLutils.rb =================================================================== RCS file: /cvsroot/tail/TailS/dsl/rubyDSLutils.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rubyDSLutils.rb 24 Sep 2007 22:21:32 -0000 1.1 --- rubyDSLutils.rb 8 Oct 2007 21:02:35 -0000 1.2 *************** *** 11,19 **** end ! def ema (number) ! Tail::EMAIndicator.new($close, number) end def cross (indicator1, indicator2) Tail::IndicatorCrossedIndicatorStrategy.new(indicator1, indicator2) ! end \ No newline at end of file --- 11,99 ---- end ! def averageGain(timeFrame) ! Tail::AverageGainIndicator.new($close, timeFrame) ! end ! ! def averageGain ! Tail::AverageGainIndicator.new($close, $series.getSize()) ! end ! ! def averageLoss(timeFrame) ! Tail::AverageLossIndicator.new($close, timeFrame) ! end ! ! def averageLoss ! Tail::AverageLossIndicator.new($close, $series.getSize()) ! end ! ! def max(indicator) ! Tail::HighestValueIndicator.new(indicator, $series.getSize()) ! end ! ! def min(indicator) ! Tail::LowestValueIndicator.new(indicator, $series.getSize()) ! end ! ! def averageDirectionalMovement(timeFrame) ! Tail::AverageDirectionalMovementIndicator.new($series, timeFrame) ! end ! ! def directionalMovement(timeFrame) ! Tail::DirectionalMovementIndicator.new($series, timeFrame) ! end ! ! def onBalanceVolume ! Tail::OnBalanceVolumeIndicator.new($series) ! end ! ! def standartDeviation(indicator, timeFrame) ! Tail::StandartDeviationIndicator.new(indicator, timeFrame) ! end ! ! def ema(timeFrame) ! Tail::EMAIndicator.new($close, timeFrame) ! end ! ! def parabolicSAR ! Tail::ParabolicSarIndicator.new($series) ! end ! ! def RSI(timeFrame) ! Tail::RSIIndicator.new(close, timeFrame) ! end ! ! def close ! Tail::ClosePriceIndicator.new($series) ! end ! ! def amount ! Tail::AmountIndicator.new($series) ! end ! ! def maxPrice ! Tail::MaxPriceIndicator.new($series) ! end ! ! def minPrice ! Tail::MinPriceIndicator.new($series) ! end ! ! def openPrice ! Tail::OpenPriceIndicator.new($series) ! end ! ! def volume ! Tail::VolumeIndicator.new($series) ! end ! ! def sma (timeFrame) ! Tail::SMAIndicator.new($close, timeFrame) ! end ! ! def WilliamsR(timeFrame) ! Tail::WilliamsRIndicator.new($close, timeFrame) end def cross (indicator1, indicator2) Tail::IndicatorCrossedIndicatorStrategy.new(indicator1, indicator2) ! end |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:02:30
|
Update of /cvsroot/tail/Tail In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16396 Modified Files: .classpath Log Message: Index: .classpath =================================================================== RCS file: /cvsroot/tail/Tail/.classpath,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** .classpath 8 Oct 2007 19:38:15 -0000 1.21 --- .classpath 8 Oct 2007 21:02:31 -0000 1.22 *************** *** 23,28 **** <classpathentry kind="lib" path="lib/dsl/ruby/jarjar-0.7.jar"/> <classpathentry kind="lib" path="lib/dsl/ruby/jline-0.9.91.jar"/> ! <classpathentry kind="lib" path="lib/dsl/ruby/jruby.jar"/> ! <classpathentry kind="lib" path="lib/dsl/ruby/jruby-engine.jar" sourcepath="/TailS/lib/jruby-src-1.0.1.zip"/> <classpathentry kind="lib" path="lib/jython.jar"/> <classpathentry kind="lib" path="lib/jython-engine-1.0-jdk14.jar"/> --- 23,28 ---- <classpathentry kind="lib" path="lib/dsl/ruby/jarjar-0.7.jar"/> <classpathentry kind="lib" path="lib/dsl/ruby/jline-0.9.91.jar"/> ! <classpathentry kind="lib" path="lib/dsl/ruby/jruby.jar" sourcepath="/TailS/lib/jruby-src-1.0.1.zip"/> ! <classpathentry kind="lib" path="lib/dsl/ruby/jruby-engine.jar" sourcepath="/home/marcio/workspace/TailS/lib/jruby-src-1.0.1.zip"/> <classpathentry kind="lib" path="lib/jython.jar"/> <classpathentry kind="lib" path="lib/jython-engine-1.0-jdk14.jar"/> |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:02:30
|
Update of /cvsroot/tail/Tail/dsl In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16396/dsl Modified Files: rubyDSLutils.rb Log Message: Index: rubyDSLutils.rb =================================================================== RCS file: /cvsroot/tail/Tail/dsl/rubyDSLutils.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rubyDSLutils.rb 8 Oct 2007 19:38:14 -0000 1.5 --- rubyDSLutils.rb 8 Oct 2007 21:02:31 -0000 1.6 *************** *** 11,20 **** end ! def ema (number) ! Tail::EMAIndicator.new($close, number) end ! def sma (number) ! Tail::SMAIndicator.new($close, number) end --- 11,96 ---- end ! def averageGain(timeFrame) ! Tail::AverageGainIndicator.new($close, timeFrame) end ! def averageGain ! Tail::AverageGainIndicator.new($close, $series.getSize()) ! end ! ! def averageLoss(timeFrame) ! Tail::AverageLossIndicator.new($close, timeFrame) ! end ! ! def averageLoss ! Tail::AverageLossIndicator.new($close, $series.getSize()) ! end ! ! def max(indicator) ! Tail::HighestValueIndicator.new(indicator, $series.getSize()) ! end ! ! def min(indicator) ! Tail::LowestValueIndicator.new(indicator, $series.getSize()) ! end ! ! def averageDirectionalMovement(timeFrame) ! Tail::AverageDirectionalMovementIndicator.new($series, timeFrame) ! end ! ! def directionalMovement(timeFrame) ! Tail::DirectionalMovementIndicator.new($series, timeFrame) ! end ! ! def onBalanceVolume ! Tail::OnBalanceVolumeIndicator.new($series) ! end ! ! def standartDeviation(indicator, timeFrame) ! Tail::StandartDeviationIndicator.new(indicator, timeFrame) ! end ! ! def ema(timeFrame) ! Tail::EMAIndicator.new($close, timeFrame) ! end ! ! def parabolicSAR ! Tail::ParabolicSarIndicator.new($series) ! end ! ! def RSI(timeFrame) ! Tail::RSIIndicator.new(close, timeFrame) ! end ! ! def close ! Tail::ClosePriceIndicator.new($series) ! end ! ! def amount ! Tail::AmountIndicator.new($series) ! end ! ! def maxPrice ! Tail::MaxPriceIndicator.new($series) ! end ! ! def minPrice ! Tail::MinPriceIndicator.new($series) ! end ! ! def openPrice ! Tail::OpenPriceIndicator.new($series) ! end ! ! def volume ! Tail::VolumeIndicator.new($series) ! end ! ! def sma (timeFrame) ! Tail::SMAIndicator.new($close, timeFrame) ! end ! ! def WilliamsR(timeFrame) ! Tail::WilliamsRIndicator.new($close, timeFrame) end |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:02:30
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16396/src/java/net/sf/tail/dsl/ruby Modified Files: RubyDSL.java Log Message: Index: RubyDSL.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby/RubyDSL.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RubyDSL.java 8 Oct 2007 19:38:15 -0000 1.5 --- RubyDSL.java 8 Oct 2007 21:02:31 -0000 1.6 *************** *** 50,54 **** engine.put("close", new ClosePriceIndicator(series)); System.out.println(header+ code); ! engine.eval(header + code); --- 50,54 ---- engine.put("close", new ClosePriceIndicator(series)); System.out.println(header+ code); ! engine.eval(header + code ); |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 21:02:30
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/dsl/ruby In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16396/src/test/net/sf/tail/dsl/ruby Modified Files: EMAStrategies3.rb Log Message: Index: EMAStrategies3.rb =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/dsl/ruby/EMAStrategies3.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EMAStrategies3.rb 3 Oct 2007 22:30:33 -0000 1.4 --- EMAStrategies3.rb 8 Oct 2007 21:02:31 -0000 1.5 *************** *** 1,5 **** - (1..50).collect{|numero| ! $strategies.add(cross(close, ema(numero))) } - --- 1,3 ---- (1..50).collect{|numero| ! $strategies.add(cross( close, ema(numero))) } |
|
From: Carlos <ma...@us...> - 2007-10-08 20:04:52
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24418/src/java/net/sf/tails/swing/frame/report Removed Files: NewReportFrame.form Log Message: Tirando os forms de netbeans. --- NewReportFrame.form DELETED --- |
|
From: Carlos <ma...@us...> - 2007-10-08 20:04:52
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24418/src/java/net/sf/tails/swing/frame/stockAnalysis Removed Files: NewStockAnalysis2.form NewStockAnalysis.form NewStockAnalysis3.form Log Message: Tirando os forms de netbeans. --- NewStockAnalysis3.form DELETED --- --- NewStockAnalysis2.form DELETED --- --- NewStockAnalysis.form DELETED --- |
|
From: Carlos <ma...@us...> - 2007-10-08 20:04:52
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24418/src/java/net/sf/tails/swing/frame Removed Files: Index.form Log Message: Tirando os forms de netbeans. --- Index.form DELETED --- |
|
From: Thies <tg...@us...> - 2007-10-08 20:02:21
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23172/src/java/net/sf/tails/swing/helper Modified Files: FrameHelper.java Log Message: Removendo warnings Index: FrameHelper.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/FrameHelper.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FrameHelper.java 8 Oct 2007 19:56:57 -0000 1.14 --- FrameHelper.java 8 Oct 2007 20:01:47 -0000 1.15 *************** *** 13,18 **** import java.io.File; import java.io.FileReader; - import java.util.ArrayList; - import java.util.List; import java.util.ResourceBundle; --- 13,16 ---- |
|
From: Carlos <ma...@us...> - 2007-10-08 20:00:23
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22363/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis.java Log Message: Atualizando again. Index: NewStockAnalysis.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewStockAnalysis.java 3 Oct 2007 22:04:10 -0000 1.4 --- NewStockAnalysis.java 8 Oct 2007 20:00:25 -0000 1.5 *************** *** 139,143 **** seriesFormatLabel.setText("Series Format: "); ! seriesFormatComboBox.setModel(new javax.swing.DefaultComboBoxModel(FrameHelper.getLoaderFiles().toArray())); javax.swing.GroupLayout stockPanelLayout = new javax.swing.GroupLayout(stockPanel); --- 139,143 ---- seriesFormatLabel.setText("Series Format: "); ! seriesFormatComboBox.setModel(new javax.swing.DefaultComboBoxModel(FrameHelper.getLoaderFiles())); javax.swing.GroupLayout stockPanelLayout = new javax.swing.GroupLayout(stockPanel); |
|
From: Carlos <ma...@us...> - 2007-10-08 19:57:09
|
Update of /cvsroot/tail/TailS/src/test/net In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20926/src/test/net Removed Files: Tteste.java Log Message: Atualizando tela. --- Tteste.java DELETED --- |
|
From: Carlos <ma...@us...> - 2007-10-08 19:56:56
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20926/src/java/net/sf/tails/swing/helper Modified Files: FrameHelper.java Log Message: Atualizando tela. Index: FrameHelper.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/FrameHelper.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FrameHelper.java 5 Oct 2007 20:55:40 -0000 1.13 --- FrameHelper.java 8 Oct 2007 19:56:57 -0000 1.14 *************** *** 13,17 **** import java.io.File; import java.io.FileReader; - import java.net.URL; import java.util.ArrayList; import java.util.List; --- 13,16 ---- *************** *** 36,84 **** private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); private static final ResourceBundle packageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Packages"); ! ! public static List<String> getCriteriaFiles() { ! List<String> criteria = new ArrayList<String>(); ! generateFolders(folderBundle.getString("CRITERIA_DIR")); ! File[] files = new File(folderBundle.getString("CRITERIA_DIR")).listFiles(); ! ! for (int i = 0; i < files.length; i++) { ! String fileName = files[i].getName(); ! if (fileName.endsWith(".java")) { ! criteria.add(fileName.split(".java")[0]); ! } ! } return criteria; } - - public static List<String> getCriteriaFilesTeste() throws ClassNotFoundException { - List<String> classes = new ArrayList<String>(); - ClassLoader cld = Thread.currentThread().getContextClassLoader(); - String path = '/' + packageBundle.getString("CRITERIA_PACKAGE") - .replace('.', '/'); - URL resource = cld.getResource(path); - File directory = new File(resource.getFile()); - if (directory.exists()) { - String[] files = directory.list(); - for (int i = 0; i < files.length; i++) { - if (files[i].endsWith(".class")) { - classes.add(files[i].split(".class")[0]); - } - } - } - return classes; - } ! public static List<String> getLoaderFiles() { ! List<String> loaders = new ArrayList<String>(); ! new File(folderBundle.getString("LOADER_DIR")).mkdirs(); ! File[] files = new File(folderBundle.getString("LOADER_DIR")).listFiles(); ! ! for (int i = 0; i < files.length; i++) { ! String fileName = files[i].getName(); ! if (fileName.endsWith(".java")) { ! loaders.add(fileName.substring(0, (fileName.length() - 5))); ! } ! } ! return loaders; } --- 35,52 ---- private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); private static final ResourceBundle packageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Packages"); ! private static final ResourceBundle classBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Classes"); ! ! public static String[] getCriteriaFiles() { ! String analysisCriteria = classBundle.getString("ANALYSIS_CRITERIA"); ! String[] criteria = analysisCriteria.split(";"); ! return criteria; } ! public static String[] getLoaderFiles() { ! String loaders = classBundle.getString("LOADERS"); ! String[] loaderArray = loaders.split(";"); ! ! return loaderArray; } |
|
From: Carlos <ma...@us...> - 2007-10-08 19:56:56
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20926/src/java/net/sf/tails/i18n Modified Files: Messages.properties Added Files: Classes.properties Log Message: Atualizando tela. Index: Messages.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/Messages.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Messages.properties 3 Oct 2007 22:04:10 -0000 1.2 --- Messages.properties 8 Oct 2007 19:56:56 -0000 1.3 *************** *** 1,4 **** ! DEFAULT_TITLE =TailS : Technical Analysis Library Software STOCKANALYSIS_TITLE =New Stock Analysis REPORT_XLS =Please select the report you want to export to XLS. REPORT_HTML =Please select the report you want to export to HTML. --- 1,5 ---- ! DEFAULT_TITLE =TailS : Technical Analysis Library Simulator STOCKANALYSIS_TITLE =New Stock Analysis + REPORT_TITLE =New Report REPORT_XLS =Please select the report you want to export to XLS. REPORT_HTML =Please select the report you want to export to HTML. *************** *** 12,16 **** SELECTED_CRITERIA =doesn't exists in library, list may be incomplete. START_DATE =Please enter a valid start date (dd/mm/yyyy). PERIOD_FIELDS =Please fill all Slices Period fields (zero if not using it). POSITIVE_PERIOD_FIELDS =One or more Slices Period field must be greater than zero. ! NEGATIVE_PERIOD_FIELDS =All Slices Period field must be equal or greater than zero. \ No newline at end of file --- 13,21 ---- SELECTED_CRITERIA =doesn't exists in library, list may be incomplete. START_DATE =Please enter a valid start date (dd/mm/yyyy). + INVALID_PERIOD_FIELDS =Please enter only numbers on all Slices Period fields. PERIOD_FIELDS =Please fill all Slices Period fields (zero if not using it). POSITIVE_PERIOD_FIELDS =One or more Slices Period field must be greater than zero. ! NEGATIVE_PERIOD_FIELDS =All Slices Period field must be equal or greater than zero. ! EMPTY_SLICESNUMBER_FIELD =Please fill Number of Slices field. ! INVALID_SLICESNUMBER_FIELD =Please enter only numbers on Number of Slices field. ! NEGATIVE_SLICESNUMBER_FIELD =Number of Slices field must be greater than zero. \ No newline at end of file --- NEW FILE: Classes.properties --- ANALYSIS_CRITERIA =AverageProfitCriterion;BuyAndHoldCriterion;MaximumDrawDownCriterion;NumbersOfTicksCriterion;NumberOfTradesCriterion;RewardRiskRadioCriterion;TotalProfitCriterion;BrazilianTotalProfitCriterion;BrazilianTransactionCostsCriterion GENERIC_CRITERIA =VersusBuyAndHoldCriterion LOADERS =CedroTimeSeriesLoader |
|
From: Carlos <ma...@us...> - 2007-10-08 19:56:21
|
Update of /cvsroot/tail/TailS/Data/Loaders In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20893/Data/Loaders Removed Files: CedroTimeSeriesLoader.java Log Message: tirando os .java da pasta. --- CedroTimeSeriesLoader.java DELETED --- |
|
From: Carlos <ma...@us...> - 2007-10-08 19:56:21
|
Update of /cvsroot/tail/TailS/Data/Criteria In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20893/Data/Criteria Removed Files: AverageProfitCriterion.java VersusBuyAndHoldCriterion.java NumberOfTicksCriterion.java RewardRiskRatioCriterion.java TotalProfitCriterion.java NumberOfTradesCriterion.java MaximumDrawDownCriterion.java BuyAndHoldCriterion.java Log Message: tirando os .java da pasta. --- MaximumDrawDownCriterion.java DELETED --- --- RewardRiskRatioCriterion.java DELETED --- --- TotalProfitCriterion.java DELETED --- --- NumberOfTradesCriterion.java DELETED --- --- NumberOfTicksCriterion.java DELETED --- --- BuyAndHoldCriterion.java DELETED --- --- VersusBuyAndHoldCriterion.java DELETED --- --- AverageProfitCriterion.java DELETED --- |
|
From: Carlos <ma...@us...> - 2007-10-08 19:55:28
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20468/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis2.java NewStockAnalysis3.java Log Message: Atualizando tela. Index: NewStockAnalysis2.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NewStockAnalysis2.java 3 Oct 2007 22:04:10 -0000 1.3 --- NewStockAnalysis2.java 8 Oct 2007 19:55:29 -0000 1.4 *************** *** 32,36 **** private static final long serialVersionUID = 1L; private Stock stock; ! private List<String> criteria; private javax.swing.JComboBox analysisComboBox; private javax.swing.JLabel analysisLabel; --- 32,36 ---- private static final long serialVersionUID = 1L; private Stock stock; ! private String[] criteria; private javax.swing.JComboBox analysisComboBox; private javax.swing.JLabel analysisLabel; *************** *** 57,61 **** analysisLabel = new javax.swing.JLabel(); analysisComboBox = new javax.swing.JComboBox(); ! criteria = new ArrayList<String>(); nextButton.setText("Next"); --- 57,61 ---- analysisLabel = new javax.swing.JLabel(); analysisComboBox = new javax.swing.JComboBox(); ! criteria = FrameHelper.getCriteriaFiles(); nextButton.setText("Next"); *************** *** 73,77 **** }); - criteria = FrameHelper.getCriteriaFiles(); criterionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Additional Criteria", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 14))); criterionPanel.setLayout(new GridLayout(0, 3, 15, 15)); --- 73,76 ---- *************** *** 88,92 **** analysisLabel.setText("Analisys Criterion: "); ! analysisComboBox.setModel(new javax.swing.DefaultComboBoxModel(criteria.toArray())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); --- 87,91 ---- analysisLabel.setText("Analisys Criterion: "); ! analysisComboBox.setModel(new javax.swing.DefaultComboBoxModel(criteria)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); *************** *** 128,132 **** ); pack(); - this.setSize(700, 280); } --- 127,130 ---- Index: NewStockAnalysis3.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis3.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewStockAnalysis3.java 8 Oct 2007 19:38:19 -0000 1.4 --- NewStockAnalysis3.java 8 Oct 2007 19:55:29 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- package net.sf.tails.swing.frame.stockAnalysis; + import java.awt.event.ActionEvent; import java.util.List; import java.util.ResourceBundle; *************** *** 22,25 **** --- 23,27 ---- import net.sf.tail.runner.HistoryRunner; import net.sf.tail.series.FullyMemorizedSlicer; + import net.sf.tail.series.PartialMemorizedSlicer; import net.sf.tail.series.RegularSlicer; import net.sf.tails.swing.frame.Index; *************** *** 57,60 **** --- 59,64 ---- private javax.swing.JTextField yearsField; private javax.swing.JLabel yearsLabel; + private javax.swing.JTextField slicesNumberField; + private javax.swing.JLabel slicesNumberLabel; private Index index; *************** *** 89,93 **** --- 93,104 ---- finishButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); + slicesNumberField = new javax.swing.JTextField(); + slicesNumberLabel = new javax.swing.JLabel(); + slicesNumberField.setText("1"); + slicesNumberField.setVisible(false); + slicesNumberLabel.setText("Number of Slices:"); + slicesNumberLabel.setVisible(false); + DateTime date = stock.getSeries().getTick(stock.getSeries().getBegin()).getDate(); startDateField.setText(date.getDayOfMonth() + "/" + date.getMonthOfYear() + "/" + date.getYear()); *************** *** 184,190 **** slicerTypeLabel.setText("Slicer Type:"); ! slicerTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ "Memorized", "Regular" })); slicerTypeComboBox.setMinimumSize(new java.awt.Dimension(178, 23)); slicerTypeComboBox.setPreferredSize(new java.awt.Dimension(178, 23)); finishButton.setText("Finish"); --- 195,206 ---- slicerTypeLabel.setText("Slicer Type:"); ! slicerTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ "Regular", "Fully", "Partial" })); slicerTypeComboBox.setMinimumSize(new java.awt.Dimension(178, 23)); slicerTypeComboBox.setPreferredSize(new java.awt.Dimension(178, 23)); + slicerTypeComboBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + slicerChangedActionPerformed(evt); + } + }); finishButton.setText("Finish"); *************** *** 216,223 **** .addComponent(startDateLabel) .addComponent(slicerTypeLabel)) ! .addGap(31, 31, 31) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(startDateField, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(slicesPeriodPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) --- 232,245 ---- .addComponent(startDateLabel) .addComponent(slicerTypeLabel)) ! .addGap(20, 20, 20) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(startDateField, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) ! .addGap(28, 28, 28) ! .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent(slicesNumberLabel)) ! .addGap(20, 20, 20) ! .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent(slicesNumberField))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(slicesPeriodPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) *************** *** 240,244 **** .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(slicerTypeLabel) ! .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(14, 14, 14) .addComponent(slicesPeriodPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) --- 262,268 ---- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(slicerTypeLabel) ! .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addComponent(slicesNumberLabel) ! .addComponent(slicesNumberField)) .addGap(14, 14, 14) .addComponent(slicesPeriodPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) *************** *** 252,256 **** } ! private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } --- 276,293 ---- } ! protected void slicerChangedActionPerformed(ActionEvent evt) { ! if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { ! slicesNumberField.setVisible(true); ! slicesNumberLabel.setVisible(true); ! } ! else ! { ! slicesNumberField.setVisible(false); ! slicesNumberLabel.setVisible(false); ! } ! } ! ! private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } *************** *** 271,279 **** return; } ! int year = Integer.parseInt(yearsField.getText()); ! int month = Integer.parseInt(monthsField.getText()); ! int day = Integer.parseInt(daysField.getText()); ! int hour = Integer.parseInt(hoursField.getText()); ! int minute = Integer.parseInt(minutesField.getText()); if(year<=0 && month<=0 && day<=0 && hour<=0 && minute<=0) --- 308,323 ---- return; } ! ! int year = 0, month = 0, day = 0, hour = 0, minute = 0; ! try { ! year = Integer.parseInt(yearsField.getText()); ! month = Integer.parseInt(monthsField.getText()); ! day = Integer.parseInt(daysField.getText()); ! hour = Integer.parseInt(hoursField.getText()); ! minute = Integer.parseInt(minutesField.getText()); ! } catch (Exception e) { ! JOptionPane.showMessageDialog(null, messageBundle.getString("INVALID_PERIOD_FIELDS"), "Error", 2); ! } ! if(year<=0 && month<=0 && day<=0 && hour<=0 && minute<=0) *************** *** 297,301 **** TimeSeriesSlicer slicer; Period period = new Period(year, month, 0, day, hour, minute, 0, 0); ! if (slicerTypeComboBox.getSelectedItem().toString().equals("Memorized")) { slicer = new FullyMemorizedSlicer(stock.getSeries(), period, startDate); --- 341,369 ---- TimeSeriesSlicer slicer; Period period = new Period(year, month, 0, day, hour, minute, 0, 0); ! if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { ! if (slicesNumberField.getText().equals("")) ! { ! JOptionPane.showMessageDialog(null, messageBundle.getString("EMPTY_SLICESNUMBER_FIELD"), "Error", 2); ! return; ! } ! int slicesNumber = 1; ! try { ! slicesNumber = Integer.parseInt(slicesNumberField.getText()); ! } ! catch (Exception e) { ! JOptionPane.showMessageDialog(null, messageBundle.getString("INVALID_SLICESNUMBER_FIELD"), "Error", 2); ! return; ! } ! ! if (slicesNumber <= 0) ! { ! JOptionPane.showMessageDialog(null, messageBundle.getString("NEGATIVE_SLICESNUMBER_FIELD"), "Error", 2); ! return; ! } ! ! slicer = new PartialMemorizedSlicer(stock.getSeries(), period, startDate, slicesNumber); ! } ! else if (slicerTypeComboBox.getSelectedItem().toString().equals("Fully")) { slicer = new FullyMemorizedSlicer(stock.getSeries(), period, startDate); |
|
From: Carlos <ma...@us...> - 2007-10-08 19:53:09
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19524/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Atualização para usar properties. Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NewReportFrame.java 8 Oct 2007 19:38:19 -0000 1.12 --- NewReportFrame.java 8 Oct 2007 19:53:11 -0000 1.13 *************** *** 6,9 **** --- 6,10 ---- import java.util.Scanner; import java.util.Set; + import java.util.ResourceBundle; import javax.script.ScriptException; *************** *** 23,26 **** --- 24,28 ---- */ public class NewReportFrame extends javax.swing.JFrame { + private static final ResourceBundle messageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Messages"); private static final long serialVersionUID = 4704921929974302846L; *************** *** 50,54 **** this.setResizable(false); this.setLocationByPlatform(true); ! this.setTitle("New Report"); } --- 52,56 ---- this.setResizable(false); this.setLocationByPlatform(true); ! this.setTitle(messageBundle.getString("REPORT_TITLE")); } *************** *** 279,283 **** } return text; ! } private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { --- 281,285 ---- } return text; ! } private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { |
|
From: xanaot <xa...@us...> - 2007-10-08 19:45:23
|
Update of /cvsroot/tail/TailS In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16040 Modified Files: .classpath Log Message: Acerto no .classpath Index: .classpath =================================================================== RCS file: /cvsroot/tail/TailS/.classpath,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** .classpath 8 Oct 2007 19:38:19 -0000 1.12 --- .classpath 8 Oct 2007 19:45:25 -0000 1.13 *************** *** 9,14 **** <classpathentry kind="lib" path="lib/joda-time-1.4-src-ide.zip"/> <classpathentry kind="lib" path="lib/poi-3.0.1-FINAL-20070705.jar"/> <classpathentry kind="src" path="dsl"/> - <classpathentry combineaccessrules="false" kind="src" path="/JEditSyntaxPackage"/> <classpathentry combineaccessrules="false" kind="src" path="/Tail"/> <classpathentry kind="output" path="bin"/> --- 9,14 ---- <classpathentry kind="lib" path="lib/joda-time-1.4-src-ide.zip"/> <classpathentry kind="lib" path="lib/poi-3.0.1-FINAL-20070705.jar"/> + <classpathentry kind="lib" path="lib/jeditsyntaxpackage.jar"/> <classpathentry kind="src" path="dsl"/> <classpathentry combineaccessrules="false" kind="src" path="/Tail"/> <classpathentry kind="output" path="bin"/> |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 19:38:21
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/evaluator In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12839/src/java/net/sf/tail/analysis/evaluator Added Files: HigherValueEvaluator.java Removed Files: BestStrategyEvaluator.java Log Message: --- BestStrategyEvaluator.java DELETED --- --- NEW FILE: HigherValueEvaluator.java --- package net.sf.tail.analysis.evaluator; import java.util.Iterator; import java.util.Set; import org.apache.log4j.Logger; import net.sf.tail.AnalysisCriterion; import net.sf.tail.StrategyEvaluator; import net.sf.tail.OperationType; import net.sf.tail.Runner; import net.sf.tail.Strategy; import net.sf.tail.TimeSeries; import net.sf.tail.runner.HistoryRunner; public class HigherValueEvaluator implements StrategyEvaluator { private static final Logger LOG = Logger.getLogger(HigherValueEvaluator.class); private Runner runner; public HigherValueEvaluator(Runner runner) { this.runner = runner; } public Decision evaluate(Set<Strategy> strategies, TimeSeries series, AnalysisCriterion criterion) { Iterator<Strategy> iter = strategies.iterator(); Strategy bestStrategy = iter.next(); Decision bestDecision = new Decision(bestStrategy, series, criterion, runner.run(bestStrategy, series .getBegin(), series.getEnd()), runner); while (iter.hasNext()) { Strategy strategy = iter.next(); Decision decision = new Decision(strategy, series, criterion, runner.run(strategy, series.getBegin(), series.getEnd()), new HistoryRunner(OperationType.BUY)); double value = decision.evaluateCriterion(); LOG.info(String.format("For %s, criterion %s, gave %.3f", strategy, criterion.getClass().getSimpleName(), value)); if (value > bestDecision.evaluateCriterion()) { //TODO O que fazer com o empate entre criterions?? bestDecision = decision; } } return bestDecision; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((runner == null) ? 0 : runner.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final HigherValueEvaluator other = (HigherValueEvaluator) obj; if (runner == null) { if (other.runner != null) return false; } else if (!runner.equals(other.runner)) return false; return true; } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 19:38:17
|
Update of /cvsroot/tail/TailS In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12968 Modified Files: .classpath Log Message: Index: .classpath =================================================================== RCS file: /cvsroot/tail/TailS/.classpath,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** .classpath 5 Oct 2007 20:55:40 -0000 1.11 --- .classpath 8 Oct 2007 19:38:19 -0000 1.12 *************** *** 10,15 **** <classpathentry kind="lib" path="lib/poi-3.0.1-FINAL-20070705.jar"/> <classpathentry kind="src" path="dsl"/> - <classpathentry combineaccessrules="false" kind="src" path="/Tail"/> <classpathentry combineaccessrules="false" kind="src" path="/JEditSyntaxPackage"/> <classpathentry kind="output" path="bin"/> </classpath> --- 10,15 ---- <classpathentry kind="lib" path="lib/poi-3.0.1-FINAL-20070705.jar"/> <classpathentry kind="src" path="dsl"/> <classpathentry combineaccessrules="false" kind="src" path="/JEditSyntaxPackage"/> + <classpathentry combineaccessrules="false" kind="src" path="/Tail"/> <classpathentry kind="output" path="bin"/> </classpath> |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 19:38:17
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12968/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NewReportFrame.java 5 Oct 2007 20:55:40 -0000 1.11 --- NewReportFrame.java 8 Oct 2007 19:38:19 -0000 1.12 *************** *** 4,7 **** --- 4,8 ---- import java.awt.event.KeyEvent; import java.awt.event.KeyListener; + import java.util.Scanner; import java.util.Set; *************** *** 9,12 **** --- 10,14 ---- import javax.swing.JFrame; import javax.swing.JOptionPane; + import javax.swing.JTextArea; import net.sf.tail.Strategy; *************** *** 14,22 **** import net.sf.tail.dsl.TailDSL; import net.sf.tail.dsl.ruby.RubyDSL; - import net.sf.tails.dsl.TailSTokenMarker; import net.sf.tails.swing.frame.Index; - import net.sf.tails.swing.helper.FrameHelper; - - import org.gjt.sp.jedit.syntax.JEditTextArea; /** --- 16,20 ---- *************** *** 39,43 **** private javax.swing.JScrollPane radioGroupScrollPane; private javax.swing.JTabbedPane newReportTabbedPane; ! private JEditTextArea customStrategyTextArea; private javax.swing.JLabel reportNameLabel; private javax.swing.JTextField reportNameField; --- 37,41 ---- private javax.swing.JScrollPane radioGroupScrollPane; private javax.swing.JTabbedPane newReportTabbedPane; ! private JTextArea customStrategyTextArea; private javax.swing.JLabel reportNameLabel; private javax.swing.JTextField reportNameField; *************** *** 66,70 **** customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); ! customStrategyTextArea = new JEditTextArea(); customStrategyCreateButton = new javax.swing.JButton(); customStrategyCancelButton = new javax.swing.JButton(); --- 64,68 ---- customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); ! customStrategyTextArea = new JTextArea(); customStrategyCreateButton = new javax.swing.JButton(); customStrategyCancelButton = new javax.swing.JButton(); *************** *** 145,149 **** newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); customStrategyTextArea.addKeyListener(new KeyListener(){ --- 143,147 ---- newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! //customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); customStrategyTextArea.addKeyListener(new KeyListener(){ *************** *** 258,262 **** TailDSL dsl = null; try { ! dsl = new RubyDSL(FrameHelper.readFile("/rubyDSLutils.rb"),stockAnalysis.getStock().getSeries()); } catch (Exception e) { JOptionPane.showMessageDialog(null, "File not found: rubyDSLutils.rb .", "Error", 2); --- 256,261 ---- TailDSL dsl = null; try { ! String dslHeader = read("/rubyDSLutils.rb"); ! dsl = new RubyDSL( dslHeader ,stockAnalysis.getStock().getSeries()); } catch (Exception e) { JOptionPane.showMessageDialog(null, "File not found: rubyDSLutils.rb .", "Error", 2); *************** *** 271,275 **** } ! } private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { --- 270,283 ---- } ! } ! ! private static String read(String name) { ! String text = ""; ! Scanner scanner = new Scanner(NewReportFrame.class.getResourceAsStream(name)); ! while (scanner.hasNextLine()) { ! text += scanner.nextLine() + "\n"; ! } ! return text; ! } private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-08 19:38:17
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12968/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis3.java Log Message: Index: NewStockAnalysis3.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis3.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NewStockAnalysis3.java 3 Oct 2007 23:04:39 -0000 1.3 --- NewStockAnalysis3.java 8 Oct 2007 19:38:19 -0000 1.4 *************** *** 19,23 **** import net.sf.tail.analysis.Stock; import net.sf.tail.analysis.StockAnalysis; ! import net.sf.tail.analysis.evaluator.BestStrategyEvaluator; import net.sf.tail.runner.HistoryRunner; import net.sf.tail.series.FullyMemorizedSlicer; --- 19,23 ---- import net.sf.tail.analysis.Stock; import net.sf.tail.analysis.StockAnalysis; ! import net.sf.tail.analysis.evaluator.HigherValueEvaluator; import net.sf.tail.runner.HistoryRunner; import net.sf.tail.series.FullyMemorizedSlicer; *************** *** 307,311 **** ! StockAnalysis stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new BestStrategyEvaluator(new HistoryRunner(OperationType.BUY))); stockAnalysis.addCriteria(additionalCriteria); index.loadStockAnalysis(stockAnalysis); --- 307,311 ---- ! StockAnalysis stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluator(new HistoryRunner(OperationType.BUY))); stockAnalysis.addCriteria(additionalCriteria); index.loadStockAnalysis(stockAnalysis); |