sch17 / truetrade

Automatically exported from code.google.com/p/truetrade
0 stars 0 forks source link

Selecting early executions causes an error #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Run the NR7Strategy with the ES 5min dataset and then select the first few
executions.  The second execution generates an error.  Log file shows:

java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.get(Unknown Source)
    at com.ats.platform.BarSeries.ago(BarSeries.java:123)
    at com.ats.platform.BarSeries.highestHigh(BarSeries.java:152)
    at
com.ats.client.charting.figures.BarSeriesFigure.resetConstraints(BarSeriesFigure
.java:70)
    at com.ats.client.views.ChartView$6.propertyChange(ChartView.java:223)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at org.eclipse.draw2d.Figure.firePropertyChange(Figure.java:503)
    at org.eclipse.draw2d.Viewport.propertyChange(Viewport.java:187)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
    at
org.eclipse.draw2d.DefaultRangeModel.firePropertyChange(DefaultRangeModel.java:6
0)
    at org.eclipse.draw2d.DefaultRangeModel.setValue(DefaultRangeModel.java:185)
    at org.eclipse.draw2d.Viewport.setViewLocation(Viewport.java:312)
    at org.eclipse.draw2d.Viewport.setHorizontalLocation(Viewport.java:254)
    at org.eclipse.draw2d.ScrollPane.scrollHorizontalTo(ScrollPane.java:182)
    at com.ats.client.views.ChartView.selectExecution(ChartView.java:318)
    at com.ats.client.views.ChartView.setSelection(ChartView.java:418)

Original issue reported on code.google.com by tyrotra...@gmail.com on 29 Apr 2007 at 1:38

GoogleCodeExporter commented 8 years ago
Added a check in BarSeries for highestHigh and lowestLow to check for range
conditions.  The root cause was in BarSeriesFigure.resetConstraints() which 
wasn't
indexing into highestHigh() properly (used a 1-based index instead of 0-based).

Fixed now.

Original comment by tyrotra...@gmail.com on 29 Apr 2007 at 1:49