Class Study
java.lang.Object
com.motivewave.platform.sdk.study.Study
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
VolumeProfileStudy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe Alt key modifier constant.static final intThe Control key modifier constant.static final intThe Meta key modifier constant (Mac Command Key).static final intThe Shift key modifier constant. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidAdds a figure to the start of the figure list for the default plot.protected final voidAdds a figure to the end of the figure list (for the default plot).protected final voidAdds a figure to the start of the figure list for the plot associated with the given plot name.protected final voidAdds a figure to the end of the figure list for the plot associated with the given plot name.protected final voidaddFigureFront(Figure figure) Adds a figure to the start of the figure list (for the default plot).protected final voidaddFigureFront(String plotName, Figure figure) Adds a figure to the start of the figure list for the plot associated with the given plot name.protected final voidaddFigures(String plotName, Collection<? extends Figure> figures) Adds a figure to the end of the figure list for the plot associated with the given plot name.protected final voidaddFigures(Collection<? extends Figure> figures) Adds a figure to the end of the figure list for the plot associated with the given plot name.voidAdds the given property change listener.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Adds the given property change listener.voidprotected voidcalculate(int index, DataContext ctx) Override this method to calculate the values at a specific index in the data series.protected voidBy default, this method is called on events where the data series has been affected.protected final voidClears the figures associated with this study (all figures).protected final voidclearFigures(String plotName) Clears the figures associated with the given plot.voidOverride this method to clear any internal state that may be kept within the study.clone()Creates a clone (copy) of this study.final RuntimeDescriptorcreateRD()Convenience Method.final SettingsDescriptorcreateSD()Convenience Method.final booleancrossedAbove(DataSeries series, int index, Object key1, double val) Convenience Method.final booleancrossedAbove(DataSeries series, int index, Object key1, Object key2) Convenience Method.final booleancrossedAbove(Object key1, double val) Convenience Method.final booleancrossedAbove(Object key1, Object key2) Convenience Method.final booleancrossedBelow(DataSeries series, int index, Object key1, double val) Convenience Method.final booleancrossedBelow(DataSeries series, int index, Object key1, Object key2) Convenience Method.final booleancrossedBelow(Object key1, double val) Convenience Method.final booleancrossedBelow(Object key1, Object key2) Convenience Method.final voidLogs a debug message to the study log.voiddestroy()This method is called when the study is being disposed.voidfinal voidLogs an error message to the study log.protected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Fires a property change event for the given property name if the newValue is different from the oldValuefinal Stringformat(double d) Formats the give value as a displayable value on the graph.final StringRetrieves the locale dependent string from the resource bundle identified in the StudyHeader annotation.Gets the list of bar sizes required by this study.final Enums.EntryStateGets the current entry state of this strategy.Gets the list of figures associated with the default plot.getFigures(String plotName) Gets the list of figures associated with the plot with the given name.final StudyHeaderThis convenience method gets the StudyHeader annotation defined for this study.Gets the list of instruments required by this study.getLabel()Gets the display label for the default plot including setting values.Gets the display label for the given plot including setting values.intGets the minimum number of bars required to display this study.intgetMinBars(DataContext ctx) Gets the minimum number of bars required to display this study.intgetMinBars(DataContext ctx, BarSize bs) Gets the minimum number of bars required to display this study for the given bar size.Gets the minimum start time (milliseconds since 1970) required to display this study (null if no minimum is required)Gets the minimum start time (milliseconds since 1970) required to display this study (null if no minimum is required)getPopupMessage(double x, double y, DrawContext ctx) Returns a message to display to the user when the mouse "hovers" over the study.final RuntimeDescriptorGets the 'runtime' descriptor.final SettingsGets the user defined settings.final SettingsDescriptorGets the settings descriptor.final Enums.StrategyStategetState()Gets the current state of this strategy.final FloatGets the current stop price for an active strategy.final FloatGets the current target price (exit price) for an active strategy.booleanfinal voidLogs an info message to the study log.voidinitialize(Defaults defaults) This method is called to initialize the design and runtime settings.final booleanreturns true if the strategy is currently being cancelled.final booleanisLong()returns true if this strategy is 'long'.booleanIndicates if a full repaint of the graph is necessary when the latest bar is updated.final booleanisShort()returns true if this strategy is 'short'.protected voidSends a notification that the range for the study has been updated and the range for graph may need to be recomputed.protected voidSends a notification that the study needs to be redrawn.protected voidSends a notification that the values for the study have been updated and any dependent studies may need to get recomputed.voidonActivate(OrderContext ctx) This method is called when the strategy is activated.voidonBarClose(DataContext ctx) This method is called when the latest bar in the data series has been closed.voidonBarClose(OrderContext ctx) This method is called when the current bar has been closed.voidonBarOpen(DataContext ctx) This method is called when the latest bar in the data series is first opened.voidonBarOpen(OrderContext ctx) This method is called when the current bar is first opened.voidonBarUpdate(DataContext ctx) This method is called when the latest bar in the data series has been updated.voidonBarUpdate(OrderContext ctx) This method is called when the current bar has been updated.voidonBeginDrag(Point2D p, int flags, DrawContext ctx) This method is called when a user starts a drag operation on the study.voidonBeginResize(ResizePoint rp, DrawContext ctx) This method is called when a user begins to move a resize point.booleanThis method is called when the user clicks on a study.voidThis method is called when the start and end indices of the data series have changed.voidThis method is called when additional historical data is loaded into the data series or when a new bar has been added to the data series.voidonDeactivate(OrderContext ctx) This method is called when the strategy is deactivated.booleanonDoubleClick(Point p, int flags) This method is called when the user double clicks on a study.voidonDrag(Point2D p, int flags, DrawContext ctx) This method is called when an update occurs during the drag operation.voidonEndDrag(Point2D p, int flags, DrawContext ctx) This method is called when the drag operation ends (user releases the mouse button)voidonEndResize(ResizePoint rp, DrawContext ctx) This method is called when a user completes a movement of a resize point.voidonEnterNow(OrderContext ctx) This method is called on response to the 'Enter Now' button on the strategy panel.voidThis is called after the study figures have been laid out.voidonHover(Point2D loc, int flags, DrawContext ctx) This method is called when the mouse is positioned over the study.voidonHoverLost(Point2D loc, int flags, DrawContext ctx) This method is called when the mouse exits the study.voidThis method is called when the study is first loaded and before the data is loaded.onMenu(String plotName, Point loc, DrawContext ctx) Override this method to provide a custom context menu, when a popup trigger (right click) is detected on this study.voidThis method is called when a new data series is created.voidonOrderCancelled(OrderContext ctx, Order order) This method is called when an order is cancelled.voidonOrderFilled(OrderContext ctx, Order order) This method is called when an order is filled.voidonOrderModified(OrderContext ctx, Order order) This method is called when an order is cancelled.voidonOrderRejected(OrderContext ctx, Order order) This method is called when an order is rejected.voidThis method is called when the current open position is closed.voidonReset(OrderContext ctx) This method is called when the strategy is reset.voidonResize(ResizePoint rp, DrawContext ctx) This method is called whenever the user moves the resize point.voidonSessionEnded(OrderContext ctx, TimeFrame session) This method is called when a trading session is ended.voidonSessionStarted(OrderContext ctx, TimeFrame session) This method is called when a trading session is started.voidThis method is called whenever the settings for the study have been updated.voidonSignal(OrderContext ctx, Object signalKey) This method is called when a signal is generated by the study.voidonTick(DataContext ctx, Tick tick) This method is called when a tick (trade) occurs.booleanonWheelMoved(Point p, int delta, int flags) This method is called when the user moves the mouse wheel while the mouse is above the study.protected voidpostcalculate(DataContext ctx) Override this method to perform work after calculate and calculateValues() is called.protected voidprecalculate(DataContext ctx) Override this method to perform work before calculate and calculateValues() is called.voidrecalculate(DataContext ctx) protected final voidremoveFigure(Figure figure) Removes the given figure from the figure list for the default plot (if it exists).protected final voidremoveFigure(String plotName, Figure figure) Removes the given figure from the figure list for the plot associated with the given name.protected final voidremoveFigures(String plotName, Collection<? extends Figure> figures) Removes the given figures from the figure list for the plot associated with the given name.protected final voidremoveFigures(Collection<? extends Figure> figures) Removes the given figures from the figure list for the default plot.voidRemoves the given property listener.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Removes the given property listener for the given propertyName.final doubleround(double d) Rounds the give value to the minimum value displayable on the graph.final voidsetCancelInProgress(boolean b) Sets the cancel in progress state for this strategyfinal voidThis method is called by the study framework and should not be used.final voidsetEntryState(Enums.EntryState state) Sets the current state of this strategy.protected final voidsetFigures(String plotName, List<? extends Figure> figures) Adds a figure to the end of the figure list for the plot associated with the given plot name.protected final voidsetFigures(List<? extends Figure> figures) final voidSets this strategy as "long' (if true)voidsetMinBars(int bars) Sets the minimum number of bars required to display this study.voidsetMinBars(int bars, BarSize bs) Sets the minimum number of bars required to display this study.voidsetMinStartTime(Long time) Sets the minimum start time (milliseconds since 1970) to display this study (null if no minimum is required)final voidSets the 'runtime' descriptor.final voidsetSettings(Settings settings) Sets the user defined settings.final voidSets the settings descriptor.final voidsetState(Enums.StrategyState state) Sets the current state of this strategy.final voidsetStopPrice(Float price) Sets the stop price for the active strategy.final voidsetTargetPrice(Float price) Sets the target price for the active strategy.voidsetVetoCloseOnDeactivate(boolean b) booleanThis method indicates if the study supports the drag operations below (onBeginDrag, onDrag and onEndDrag).final voidLogs a warning message to the study log.
-
Field Details
-
SHIFT_DOWN
public static final int SHIFT_DOWNThe Shift key modifier constant.- See Also:
-
CTRL_DOWN
public static final int CTRL_DOWNThe Control key modifier constant.- See Also:
-
META_DOWN
public static final int META_DOWNThe Meta key modifier constant (Mac Command Key).- See Also:
-
ALT_DOWN
public static final int ALT_DOWNThe Alt key modifier constant.- See Also:
-
-
Constructor Details
-
Study
public Study()
-
-
Method Details
-
initialize
This method is called to initialize the design and runtime settings.- Parameters:
defaults- system defaults
-
onLoad
This method is called when the study is first loaded and before the data is loaded. This can be a useful place to set the minimum number of bars to calculate the study.- Parameters:
defaults- system defaults
-
precalculate
Override this method to perform work before calculate and calculateValues() is called.- Parameters:
ctx- data context
-
postcalculate
Override this method to perform work after calculate and calculateValues() is called.- Parameters:
ctx- data context
-
calculate
Override this method to calculate the values at a specific index in the data series. This method is called from calculateValues(ctx) and onBarUpdate(ctx)- Parameters:
index- index in the data seriesctx- Data Context
-
calculateValues
By default, this method is called on events where the data series has been affected.- Parameters:
ctx- data context
-
isRepaintAllOnUpdate
public boolean isRepaintAllOnUpdate()Indicates if a full repaint of the graph is necessary when the latest bar is updated. By default this returns false. If your study needs other parts (outside of the latest bar) to be repainted when the bar is updated, consider returning true.- Returns:
- true if a full repaint of the graph is required when the bar is updated
-
onBarOpen
This method is called when the latest bar in the data series is first opened. By default, this method calls onBarUpdate(ctx)- Parameters:
ctx- data context
-
onBarUpdate
This method is called when the latest bar in the data series has been updated.- Parameters:
ctx- data context
-
onTick
This method is called when a tick (trade) occurs.- Parameters:
tick- latest tick (trade)
-
onBarClose
This method is called when the latest bar in the data series has been closed. By default, this method calls onBarUpdate(ctx)- Parameters:
ctx- data context
-
onDataSeriesMoved
This method is called when the start and end indices of the data series have changed.- Parameters:
ctx- data context
-
onDataSeriesUpdated
This method is called when additional historical data is loaded into the data series or when a new bar has been added to the data series. Please Note: this may change the indices of the data stored in the set. The data stored on the series will be preserved as it is stored by the start times of the individual bars.- Parameters:
ctx- data context
-
onNewDataSeries
This method is called when a new data series is created. Typically this occurs when the user changes the interval on the graph.- Parameters:
ctx- data context
-
onSettingsUpdated
This method is called whenever the settings for the study have been updated.- Parameters:
ctx- data context
-
recalculate
-
onMenu
Override this method to provide a custom context menu, when a popup trigger (right click) is detected on this study.- Parameters:
plotName- name of the plot where this event occurredloc- x,y coordinates of the mouse location where event occurred- Returns:
- MenuDescriptor
-
onBeginResize
This method is called when a user begins to move a resize point.- Parameters:
rp- resize point that is about to be moved.ctx- draw context for the chart that is affected.
-
onResize
This method is called whenever the user moves the resize point. It is called between the onBeginResize() and onEndResize() events.- Parameters:
rp- resize point that is being moved.ctx- draw context for the chart that is affected.
-
onEndResize
This method is called when a user completes a movement of a resize point. On completion of this method, the study will be recalculated. This will also affect other charts that have an instance of this study.- Parameters:
rp- resize point was resized.ctx- draw context for the chart that is affected.
-
supportsDrag
public boolean supportsDrag()This method indicates if the study supports the drag operations below (onBeginDrag, onDrag and onEndDrag). By default this method returns false. Override this method to return true if the study supports the ability to drag.- Returns:
- true if the study supports drag operations
- Since:
- 7.0
-
onHover
This method is called when the mouse is positioned over the study.- Parameters:
flags- indicators of modifier keys pressedctx- draw context for the chart that is affected.p- point where the mouse currently is- Since:
- 7.0
-
onHoverLost
This method is called when the mouse exits the study.- Parameters:
flags- indicators of modifier keys pressedctx- draw context for the chart that is affected.p- point where the mouse currently is- Since:
- 7.0
-
onBeginDrag
This method is called when a user starts a drag operation on the study.- Parameters:
p- point where the drag operation startedflags- indicators of modifier keys pressedctx- draw context for the chart that is affected.- Since:
- 7.0
-
onDrag
This method is called when an update occurs during the drag operation.- Parameters:
p- point where the drag operation startedflags- indicators of modifier keys pressedctx- draw context for the chart that is affected.- Since:
- 7.0
-
onEndDrag
This method is called when the drag operation ends (user releases the mouse button)- Parameters:
p- point where the drag operation startedflags- indicators of modifier keys pressedctx- draw context for the chart that is affected.- Since:
- 7.0
-
onDoubleClick
This method is called when the user double clicks on a study.- Parameters:
p- x and y location where the user double clickedflags- indicators of modifier keys pressed- Returns:
- true if the default behavior should be executed (display study dialog)
-
onClick
This method is called when the user clicks on a study.- Parameters:
p- x and y location where the user clickedflags- indicators of modifier keys pressed- Returns:
- true if the default behavior should be executed
-
onWheelMoved
This method is called when the user moves the mouse wheel while the mouse is above the study.- Parameters:
p- x and y coordinate where the mouse is locateddelta- direction and amount the wheel was movedflags- indicators of modifier keys pressed- Returns:
- true if the default behavior should be executed
-
clearState
public void clearState()Override this method to clear any internal state that may be kept within the study. This method is called when the settings have been updated, the user chooses a new bar size or when additional historical data is loaded into the series -
createRD
Convenience Method. Creates a RuntimeDescriptor and set it on this study- Returns:
- RuntimeDescriptor
-
getRuntimeDescriptor
Gets the 'runtime' descriptor. This object describes the runtime characteristics of the study.- Returns:
- runtime descriptor
-
setRuntimeDescriptor
Sets the 'runtime' descriptor. This object describes the runtime characteristics of the study.- Parameters:
desc- runtime descriptor object
-
createSD
Convenience Method. Creates a SettingDescriptor and set it on this study- Returns:
- SettingsDescriptor
-
getSettingsDescriptor
Gets the settings descriptor. This object describes the design time characteristics of the study.- Returns:
- settings descriptor
-
setSettingsDescriptor
Sets the settings descriptor. This object describes the design time characteristics of the study.- Parameters:
sd- descriptor object
-
getSettings
-
setSettings
Sets the user defined settings. This method is called by the SDK framework and should not be called within the study code.- Parameters:
settings-
-
getBarSizes
Gets the list of bar sizes required by this study. By default, this method will return all of the bar sized defined in the settings. If a descriptor is defined for the bar size, it will check to see if the descriptor is enabled before adding the bar size.- Returns:
- list of bar sizes required by this study
-
getInstruments
Gets the list of instruments required by this study. By default, this method will return all of the instruments defined in the settings. If a descriptor is defined for the instrument, it will check to see if the descriptor is enabled before adding the instrument.- Returns:
- list of instruments required by this study
-
getPopupMessage
Returns a message to display to the user when the mouse "hovers" over the study. By default, this method will iterate through figures and return the first non-empty message from a figure that contains the given x and y coordinates.- Parameters:
x- x coordinatey- y coordinate- Returns:
- message to display to the user when the mouse is over given (x,y) coordinate.
-
getHeader
This convenience method gets the StudyHeader annotation defined for this study.- Returns:
- study header
-
getLabel
Gets the display label for the default plot including setting values.- Returns:
- display label for the default plot including setting values
-
getLabel
-
clearFigures
protected final void clearFigures()Clears the figures associated with this study (all figures). -
clearFigures
Clears the figures associated with the given plot.- Parameters:
plotName- name of the study plot
-
onFiguresLaidOut
This is called after the study figures have been laid out. -
addFigure
Adds a figure to the end of the figure list (for the default plot).- Parameters:
figure- figure to add
-
setFigures
-
addFigureFront
Adds a figure to the start of the figure list (for the default plot).- Parameters:
figure- figure to add
-
addFigure
-
setFigures
-
addFigures
Adds a figure to the end of the figure list for the plot associated with the given plot name.- Parameters:
figures- figures to add
-
addFigures
Adds a figure to the end of the figure list for the plot associated with the given plot name.- Parameters:
plotName- name of the study plotfigures- figures to add
-
addFigure
Adds a figure to the start of the figure list for the default plot.- Parameters:
index- position in the list to addfigure- figure to add
-
addFigure
-
addFigureFront
-
removeFigure
Removes the given figure from the figure list for the default plot (if it exists).- Parameters:
figure- figure to remove
-
removeFigure
-
removeFigures
Removes the given figures from the figure list for the default plot.- Parameters:
figures- figures to remove
-
removeFigures
Removes the given figures from the figure list for the plot associated with the given name.- Parameters:
plotName- name of the study plotfigures- figures to remove
-
getFigures
-
getFigures
-
getMinBars
public int getMinBars()Gets the minimum number of bars required to display this study.- Returns:
- minimum number of bars required to display the study
-
getMinBars
Gets the minimum number of bars required to display this study.- Parameters:
ctx- data context- Returns:
- minimum number of bars required to display the study
-
getMinBars
Gets the minimum number of bars required to display this study for the given bar size.- Parameters:
ctx- data contextbs- bar size- Returns:
- minimum number of bars required to display the study
-
setMinBars
public void setMinBars(int bars) Sets the minimum number of bars required to display this study.- Parameters:
bars- minimum number of bars
-
setMinBars
Sets the minimum number of bars required to display this study.- Parameters:
bars- minimum number of barsbs- bar size
-
getMinStartTime
Gets the minimum start time (milliseconds since 1970) required to display this study (null if no minimum is required)- Returns:
- minimum start time required to display this study (null if no minimum is required).
-
getMinStartTime
Gets the minimum start time (milliseconds since 1970) required to display this study (null if no minimum is required)- Parameters:
ctx- data context- Returns:
- minimum start time required to display this study (null if no minimum is required).
-
setMinStartTime
Sets the minimum start time (milliseconds since 1970) to display this study (null if no minimum is required)- Parameters:
time- minimum start time (milliseconds since 1970)
-
onActivate
This method is called when the strategy is activated.- Parameters:
ctx- order context
-
onSessionStarted
This method is called when a trading session is started.- Parameters:
ctx- order contextsession- time frame
-
onSessionEnded
This method is called when a trading session is ended.- Parameters:
ctx- order contextsession- time frame session
-
onBarOpen
This method is called when the current bar is first opened. By default, this method calls onBarUpdate(ctx).- Parameters:
ctx- order context
-
onBarUpdate
This method is called when the current bar has been updated.- Parameters:
ctx- order context
-
onBarClose
This method is called when the current bar has been closed. By default, this method calls onBarUpdate(ctx).- Parameters:
ctx- order context
-
onSignal
This method is called when a signal is generated by the study. This method will be called even if the signal is not enabled in the study settings.- Parameters:
ctx- order contextsignalKey-
-
onDeactivate
This method is called when the strategy is deactivated.- Parameters:
ctx- order context
-
setVetoCloseOnDeactivate
public void setVetoCloseOnDeactivate(boolean b) -
onReset
This method is called when the strategy is reset.- Parameters:
ctx- order context
-
onPositionClosed
This method is called when the current open position is closed.- Parameters:
ctx- order context
-
onEnterNow
This method is called on response to the 'Enter Now' button on the strategy panel. This is for manual entry strategies only.- Parameters:
ctx- order context
-
onOrderFilled
This method is called when an order is filled.- Parameters:
ctx- order contextorder- order that was filled
-
onOrderCancelled
This method is called when an order is cancelled.- Parameters:
ctx- order contextorder- order that was cancelled
-
onOrderRejected
This method is called when an order is rejected.- Parameters:
ctx- order contextorder- order that was rejected
-
onOrderModified
This method is called when an order is cancelled. -
getState
Gets the current state of this strategy.- Returns:
- current state of this strategy
-
setState
Sets the current state of this strategy.- Parameters:
state- strategy state
-
getEntryState
Gets the current entry state of this strategy.- Returns:
- current entry state of this strategy
-
setEntryState
Sets the current state of this strategy.- Parameters:
state- entry state
-
isLong
public final boolean isLong()returns true if this strategy is 'long'.- Returns:
- true if this strategy is 'long'
-
isShort
public final boolean isShort()returns true if this strategy is 'short'.- Returns:
- true if this strategy is 'short'
-
setLong
Sets this strategy as "long' (if true)- Parameters:
b- flag that indicates if this strategy is long
-
isCancelInProgress
public final boolean isCancelInProgress()returns true if the strategy is currently being cancelled.- Returns:
- true if this strategy is currently being cancelled
-
setCancelInProgress
public final void setCancelInProgress(boolean b) Sets the cancel in progress state for this strategy- Parameters:
b- true if this strategy is being cancelled
-
getStopPrice
Gets the current stop price for an active strategy. This may be used to calculate the stop profit/loss (null if there is no stop price).- Returns:
- current stop price for an active strategy
-
setStopPrice
Sets the stop price for the active strategy. Use null to indicate that there is no stop.- Parameters:
price- stop price
-
getTargetPrice
Gets the current target price (exit price) for an active strategy. This may be used to calculate the target profit/loss (null if there is no target price).- Returns:
- current target price for this strategy
-
setTargetPrice
Sets the target price for the active strategy. Use null to indicate that there is no target.- Parameters:
price- target price (null for no target)
-
setDataContext
This method is called by the study framework and should not be used. -
getDataContext
-
get
-
round
public final double round(double d) Rounds the give value to the minimum value displayable on the graph. If this is an overlay, it calls Instrument.round(d) for the for instrument in the data context. If this is not an overlay the value is rounded using the minTick value set on the RuntimeDescriptor.- Parameters:
d- the value to round- Returns:
- the value d rounded to the min value displayable on the graph
-
format
Formats the give value as a displayable value on the graph. If this is an overlay, it calls Instrument.format(d) for the for instrument in the data context. If this is not an overlay the value is rounded using the minTick value set on the RuntimeDescriptor.- Parameters:
d- the value to round
-
crossedAbove
Convenience Method. Checks to see if the series of values defined by key1 has crossed above the series of values defined by key2 (using the latest value of the default data series). This occurs if round(series.getDouble(index, key1)) > round(series.getDouble(index, key2)) AND round(series.getDouble(index-1, key2)) < round(series.getDouble(index-1, key2))- Parameters:
key1- key that identifies the first series of valueskey2- key that identifies the second series of values- Returns:
- true if the series key1 crossed above series key2
-
crossedAbove
Convenience Method. Checks to see if the series of values defined by key1 has crossed above the series of values defined by key2. This occurs if round(series.getDouble(index, key1)) > round(series.getDouble(index, key2)) AND round(series.getDouble(index-1, key2)) < round(series.getDouble(index-1, key2))- Parameters:
series- series that contains the valuesindex- index in the data serieskey1- key that identifies the first series of valueskey2- key that identifies the second series of values- Returns:
- true if the series key1 crossed above series key2
-
crossedAbove
Convenience Method. Checks to see if the series of values defined by key1 has crossed above the value 'val' (using the latest value of the default data series).- Parameters:
key1- key that identifies the first series of valuesval- value to cross above- Returns:
- true if the series key1 crossed above val
-
crossedAbove
Convenience Method. Checks to see if the series of values defined by key1 has crossed above the value 'val'.- Parameters:
series- series that contains the valuesindex- index in the data serieskey1- key that identifies the first series of valuesval- value to cross above- Returns:
- true if the series key1 crossed above val
-
crossedBelow
Convenience Method. Checks to see if the series of values defined by the key key1 has crossed below the series of values defined by key2 (using the latest index in the default data series). This occurs if round(series.getDouble(index, key1)) < round(series.getDouble(index, key2)) AND round(series.getDouble(index-1, key1)) > round(series.getDouble(index-1, key2))- Parameters:
key1- key that identifies the first series of valueskey2- key that identifies the second series of values- Returns:
- true if the series key1 crossed below series key2
-
crossedBelow
Convenience Method. Checks to see if the series of values defined by the key key1 has crossed below the series of values defined by key2. This occurs if round(series.getDouble(index, key1)) < round(series.getDouble(index, key2)) AND round(series.getDouble(index-1, key1)) > round(series.getDouble(index-1, key2))- Parameters:
series- series that contains the valuesindex- index in the data serieskey1- key that identifies the first series of valueskey2- key that identifies the second series of values- Returns:
- true if the series key1 crossed below series key2
-
crossedBelow
Convenience Method. Checks to see if the series of values defined by key1 has crossed below the value 'val' (using the latest value of the default data series).- Parameters:
key1- key that identifies the first series of valuesval- value to cross below- Returns:
- true if the series key1 crossed below val
-
crossedBelow
Convenience Method. Checks to see if the series of values defined by key1 has crossed below the value 'val'.- Parameters:
series- series that contains the valuesindex- index in the data serieskey1- key that identifies the first series of valuesval- value to cross below- Returns:
- true if the series key1 crossed below val
-
debug
Logs a debug message to the study log.- Parameters:
msg- debug message
-
info
Logs an info message to the study log.- Parameters:
msg- info message
-
warning
Logs a warning message to the study log.- Parameters:
msg- warning message
-
error
Logs an error message to the study log.- Parameters:
msg- error message
-
addPropertyChangeListener
Adds the given property change listener. This listener will receive property change events for all properties.- Parameters:
listener- property change listener
-
addPropertyChangeListener
Adds the given property change listener. This listener will only receive property change events for the given propertyName.- Parameters:
propertyName- name of the propertylistener- property change listener
-
removePropertyChangeListener
Removes the given property listener.- Parameters:
listener- property change listener
-
removePropertyChangeListener
Removes the given property listener for the given propertyName.- Parameters:
propertyName- name of the propertylistener- property change listener
-
firePropertyChange
Fires a property change event for the given property name if the newValue is different from the oldValue- Parameters:
propertyName- name of the propertyoldValue- old (previous) value for this propertynewValue- new value for the property
-
destroy
public void destroy()This method is called when the study is being disposed. This method should be used to release and resources (if any). -
notifyRangeUpdated
protected void notifyRangeUpdated()Sends a notification that the range for the study has been updated and the range for graph may need to be recomputed. -
notifyValuesUpdated
protected void notifyValuesUpdated()Sends a notification that the values for the study have been updated and any dependent studies may need to get recomputed. -
notifyRedraw
protected void notifyRedraw()Sends a notification that the study needs to be redrawn. -
clone
-
beginFigureUpdate
public void beginFigureUpdate() -
endFigureUpdate
public void endFigureUpdate()
-