public class Settings
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
Settings() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener.
|
void |
addSession(TimeFrame session)
Adds a session to the strategy.
|
Settings |
clone()
Creates a clone (copy) of this object.
|
boolean |
equals(java.lang.Object o)
Compares this settings object with the given object and returns true if they are equal.
|
java.util.Set<java.lang.String> |
getBars()
Gets the set of all registered bar names.
|
BarInfo |
getBars(java.lang.String name)
Gets the bar info associated to the given name.
|
BarSize |
getBarSize(java.lang.String name)
Gets the bar size associated to the given name.
|
java.util.Set<java.lang.String> |
getBarSizes()
Gets the set of all registered bar size names.
|
java.lang.Boolean |
getBoolean(java.lang.String name)
Gets the boolean value associated to the given name.
|
boolean |
getBoolean(java.lang.String name,
boolean def)
Gets the boolean value associated to the given name.
|
java.awt.Color |
getColor(java.lang.String name)
Gets the color associated to the given name.
|
java.awt.Color |
getColor(java.lang.String name,
java.awt.Color def)
Gets the color associated to the given name.
|
ColorInfo |
getColorInfo(java.lang.String name)
Gets the color info object associated to the given name
|
java.util.Set<java.lang.String> |
getColors()
Gets the set of all registered color names.
|
SettingsDescriptor |
getDescriptor()
Gets the SettingsDescriptor object that describes the user settings.
|
java.lang.Double |
getDouble(java.lang.String name)
Gets the double value associated to the given name.
|
double |
getDouble(java.lang.String name,
double def)
Gets the double value associated to the given name.
|
ExitPoint |
getExitPoint(java.lang.String name)
Gets the exit point associated to the given name.
|
java.util.Set<java.lang.String> |
getExitPoints()
Gets the set of all registered Exit Point names.
|
FontInfo |
getFont(java.lang.String name)
Gets the font associated with the given name.
|
java.util.Set<java.lang.String> |
getFonts()
Gets the set of all registered font names.
|
GuideInfo |
getGuide(java.lang.String name)
Gets the GuideInfo associated to the given name
|
java.util.Set<java.lang.String> |
getGuides()
Gets the set of all registered guide names.
|
IndicatorInfo |
getIndicator(java.lang.String name)
Gets the indicator associated with the given name
|
java.util.Set<java.lang.String> |
getIndicators()
Get the set of all registered indicator names.
|
java.lang.Object |
getInput(java.lang.String name)
Gets the input associated to the given name.
|
java.lang.Object |
getInput(java.lang.String name,
java.lang.Object def)
Gets the input key associated to the given name.
|
java.util.Set<java.lang.String> |
getInputs()
Gets the set of all registered input names.
|
Instrument |
getInstrument(java.lang.String name)
Gets the instrument associated to the given name
|
java.util.Set<java.lang.String> |
getInstruments()
Gets the set of all registered instrument names.
|
java.lang.Integer |
getInteger(java.lang.String name)
Gets the integer value associated to the given name.
|
int |
getInteger(java.lang.String name,
int def)
Gets the integer value associated to the given name.
|
java.lang.Long |
getLong(java.lang.String name)
Gets the long value associated to the given name.
|
Enums.MAMethod |
getMAMethod(java.lang.String name)
Gets the Moving Average Calculation method associated to the given name
|
Enums.MAMethod |
getMAMethod(java.lang.String name,
Enums.MAMethod def)
Gets the Moving Average Calculation method associated to the given name.
|
java.util.Set<java.lang.String> |
getMAMethods()
Gets the set of all registered Moving Average Method names.
|
MarkerInfo |
getMarker(java.lang.String name)
Gets the MarkerInfo object associated with the given name
|
java.util.Set<java.lang.String> |
getMarkers()
Gets the set of registered marker names.
|
Enums.OrderType |
getOrderType(java.lang.String name)
Gets the order type associated to the given name.
|
PathInfo |
getPath(java.lang.String name)
Gets the PathInfo object associated with the given name
|
java.util.Set<java.lang.String> |
getPaths()
Gets the set of all registered path names
|
Enums.PositionType |
getPositionType()
Indicates position type to be used with the strategy (long, short or both).
|
java.util.List<TimeFrame> |
getSessions()
Gets the trading sessions (strategies only).
|
java.lang.Object |
getSetting(java.lang.String name)
Gets the setting associated to the given name.
|
ShadeInfo |
getShade(java.lang.String name)
Gets the ShadeInfo object associated to the given name.
|
java.util.Set<java.lang.String> |
getShades()
Gets the set of all registered shade names.
|
java.lang.String |
getString(java.lang.String name)
Gets the string value associated to the given name.
|
java.lang.String |
getString(java.lang.String name,
java.lang.String def)
Gets the string value associated to the given name.
|
Enums.TIF |
getTIF(java.lang.String name)
Gets the tif (Time In Force) value associated to the given name.
|
TimeFrame |
getTimeFrame(java.lang.String name)
Gets the timeframe associated to the given name.
|
java.util.Set<java.lang.String> |
getTimeFrames()
Gets the set of all registered time frame names.
|
Enums.TIF |
getTimeInForce()
Gets the time in force (TIF) for orders (strategies only).
|
java.util.TimeZone |
getTimeZone()
Gets the timezone for sessions (null for local time zone).
|
int |
getTradeLots()
Gets the number of trade lots to use (strategies only).
|
java.lang.Object |
getValue(java.lang.String name)
Gets the set of value associated with the given key.
|
java.util.Set<java.lang.String> |
getValues()
Gets the set of value keys in the settings.
|
boolean |
isAutoEntry()
Indicates if the strategy has auto entry enabled.
|
boolean |
isBarUpdates()
Indicates if this study should respond to bar updates instead of
only calculating on the close of the bar.
|
boolean |
isCloseOnDeactivate()
Indicates if a position should be closed when the strategy is
deactivated.
|
boolean |
isCloseOnSessionEnd()
Determines if this strategy should exit an open position automatically when a trading session closes.
|
boolean |
isEnterOnActivate()
Indicates if a position should be opened when the strategy is
activated.
|
boolean |
isEnterOnSessionStart()
Determines if this strategy should enter automatically when a trading session opens.
|
boolean |
isUseAccountPosition()
Indicates if this study should use the existing position that is available on the account.
|
void |
removeAllPropertyChangeListeners()
Removes all property change listeners.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener.
|
void |
setAutoEntry(boolean b)
Sets the auto entry attribute for the strategy.
|
void |
setBars(java.lang.String name,
BarInfo bar)
Associates the given BarInfo to the specified name.
|
void |
setBarSize(java.lang.String name,
BarSize barSize)
Associates the given BarSize to the specified name.
|
void |
setBarUpdates(boolean b)
Indicates if this study should respond to bar updates instead of
only calculating on the close of the bar.
|
void |
setBoolean(java.lang.String name,
java.lang.Boolean val)
Associates the given boolean value to the specified name.
|
void |
setCloseOnDeactivate(boolean b)
Indicates if a position should be closed when the strategy is
deactivated.
|
void |
setCloseOnSessionEnd(boolean b)
Sets the close position on session end attribute (this is called by the study framework).
|
void |
setColor(java.lang.String name,
java.awt.Color color)
Associates the given Color to the specified name.
|
void |
setColor(java.lang.String name,
ColorInfo color)
Associates the given Color to the specified name.
|
void |
setDescriptor(SettingsDescriptor desc)
Sets the SettingsDescriptor object.
|
void |
setDouble(java.lang.String name,
java.lang.Double val)
Associates the given double value to the specified name.
|
void |
setEnterOnActivate(boolean b)
Indicates if a position should be opened when the strategy is
activated.
|
void |
setEnterOnSessionStart(boolean b)
Sets the enter on session start attribute (this is called by the study framework).
|
void |
setExitPoint(java.lang.String name,
ExitPoint ep)
Associates the given ExitPoint to the specified name.
|
void |
setFont(java.lang.String name,
FontInfo font)
Associates the given FontInfo to the specified name.
|
void |
setGuide(java.lang.String name,
GuideInfo guide)
Associates the given GuideInfo to the specified name.
|
void |
setIndicator(java.lang.String name,
IndicatorInfo indicator)
Associates the given IndicatorInfo to the specified name.
|
void |
setInput(java.lang.String name,
java.lang.Object input)
Associates the given input key to the specified name.
|
void |
setInstrument(java.lang.String name,
Instrument instrument)
Associates the given Instrument to the specified name.
|
void |
setInteger(java.lang.String name,
java.lang.Integer val)
Associates the given integer value to the specified name.
|
void |
setLong(java.lang.String name,
java.lang.Long val)
Associates the given integer value to the specified name.
|
void |
setMAMethod(java.lang.String name,
Enums.MAMethod method)
Associates the given MAMethod to the specified name.
|
void |
setMarker(java.lang.String name,
MarkerInfo marker)
Associates the given MarkerInfo to the specified name.
|
void |
setOrderType(java.lang.String name,
Enums.OrderType type)
Associates the given OrderType to the specified name.
|
void |
setPath(java.lang.String name,
PathInfo path)
Associates the given PathInfo to the specified name.
|
void |
setPositionType(Enums.PositionType p)
Sets the position type for the strategy.
|
void |
setShade(java.lang.String name,
ShadeInfo shade)
Associates the given ShadeInfo to the specified name.
|
void |
setString(java.lang.String name,
java.lang.String val)
Associates the given string value to the specified name.
|
void |
setTIF(java.lang.String name,
Enums.TIF tif)
Associates the given TIF (time in force) to the specified name.
|
void |
setTimeFrame(java.lang.String name,
TimeFrame tf)
Associates the given TimeFrame to the specified name.
|
void |
setTimeInForce(Enums.TIF tif)
Sets the time in force (TIF) for orders (strategies only).
|
void |
setTimeZone(java.util.TimeZone tz)
Sets the timezone for sessions (null for local time zone).
|
void |
setTradeLots(int tradeLots)
Sets the number of trade lots to use (strategies only).
|
void |
setUseAccountPosition(boolean b)
Indicates if this study should use the existing position that is available on the account.
|
void |
update(Settings settings)
Updates the information from the given object.
|
public void setDescriptor(SettingsDescriptor desc)
desc - settings descriptor objectpublic SettingsDescriptor getDescriptor()
public PathInfo getPath(java.lang.String name)
name - namepublic void setPath(java.lang.String name,
PathInfo path)
name - name of the path (key)path - path info objectpublic java.util.Set<java.lang.String> getPaths()
public MarkerInfo getMarker(java.lang.String name)
name - public void setMarker(java.lang.String name,
MarkerInfo marker)
name - name of the markermarker - marker infopublic java.util.Set<java.lang.String> getMarkers()
public IndicatorInfo getIndicator(java.lang.String name)
name - name of the indicatorpublic void setIndicator(java.lang.String name,
IndicatorInfo indicator)
name - name of the indicatorindicator - indicator info objectpublic java.util.Set<java.lang.String> getIndicators()
public BarInfo getBars(java.lang.String name)
name - name of the bar infopublic void setBars(java.lang.String name,
BarInfo bar)
name - name of the bar infobar - bar info objectpublic java.util.Set<java.lang.String> getBars()
public ShadeInfo getShade(java.lang.String name)
name - name of the shadepublic void setShade(java.lang.String name,
ShadeInfo shade)
name - name of the shadeshade - shade info objectpublic java.util.Set<java.lang.String> getShades()
public GuideInfo getGuide(java.lang.String name)
name - name of the guidepublic void setGuide(java.lang.String name,
GuideInfo guide)
name - name of the guideguide - guide info objectpublic java.util.Set<java.lang.String> getGuides()
public FontInfo getFont(java.lang.String name)
name - name of the fontpublic void setFont(java.lang.String name,
FontInfo font)
name - font namefont - font info objectpublic java.util.Set<java.lang.String> getFonts()
public java.awt.Color getColor(java.lang.String name)
name - name of the colorpublic ColorInfo getColorInfo(java.lang.String name)
name - name of the colorpublic java.awt.Color getColor(java.lang.String name,
java.awt.Color def)
name - name of the colordef - default value if the color is not definedpublic void setColor(java.lang.String name,
java.awt.Color color)
name - name of the colorcolor - colorpublic void setColor(java.lang.String name,
ColorInfo color)
name - name of the colorcolor - color info objectpublic java.util.Set<java.lang.String> getColors()
public java.lang.Object getInput(java.lang.String name)
name - name of the input keypublic java.lang.Object getInput(java.lang.String name,
java.lang.Object def)
name - name of the inputdef - default to return if the input is undefinedpublic void setInput(java.lang.String name,
java.lang.Object input)
name - name of the inputinput - input keypublic java.util.Set<java.lang.String> getInputs()
public Enums.MAMethod getMAMethod(java.lang.String name)
name - name of the methodpublic Enums.MAMethod getMAMethod(java.lang.String name, Enums.MAMethod def)
name - name of the methoddef - default value to return if the method is not definedpublic void setMAMethod(java.lang.String name,
Enums.MAMethod method)
name - name of the methodmethod - moving average methodpublic java.util.Set<java.lang.String> getMAMethods()
public BarSize getBarSize(java.lang.String name)
name - name of the bar sizepublic void setBarSize(java.lang.String name,
BarSize barSize)
name - name of the bar sizebarSize - bar sizepublic java.util.Set<java.lang.String> getBarSizes()
public Instrument getInstrument(java.lang.String name)
name - name of the instrumentpublic void setInstrument(java.lang.String name,
Instrument instrument)
name - name of the instrumentinstrument - instrument to associatepublic java.util.Set<java.lang.String> getInstruments()
public ExitPoint getExitPoint(java.lang.String name)
name - name of the exit pointpublic void setExitPoint(java.lang.String name,
ExitPoint ep)
name - name of the exit pointep - exit pointpublic java.util.Set<java.lang.String> getExitPoints()
public TimeFrame getTimeFrame(java.lang.String name)
name - name of the timeframepublic void setTimeFrame(java.lang.String name,
TimeFrame tf)
name - name of the timeframetf - time frame to associate to the given namepublic java.util.Set<java.lang.String> getTimeFrames()
public Enums.OrderType getOrderType(java.lang.String name)
name - name of the order typepublic void setOrderType(java.lang.String name,
Enums.OrderType type)
name - name of the order typetype - order typepublic Enums.TIF getTIF(java.lang.String name)
name - name of the tifpublic void setTIF(java.lang.String name,
Enums.TIF tif)
name - name of the tiftif - time in forcepublic java.util.Set<java.lang.String> getValues()
public java.lang.Object getValue(java.lang.String name)
name - name of the valuepublic java.lang.Double getDouble(java.lang.String name)
name - name of the double valuepublic double getDouble(java.lang.String name,
double def)
name - name of the double valuedef - default value to return if not definedpublic void setDouble(java.lang.String name,
java.lang.Double val)
name - name of the double valueval - double valuepublic java.lang.Integer getInteger(java.lang.String name)
name - name of the valuepublic int getInteger(java.lang.String name,
int def)
name - name of the integer valuedef - default value to return if the name does not existpublic void setInteger(java.lang.String name,
java.lang.Integer val)
name - name of the valueval - value to associatepublic java.lang.Long getLong(java.lang.String name)
name - name of the valuepublic void setLong(java.lang.String name,
java.lang.Long val)
name - name of the valueval - value to associatepublic java.lang.Boolean getBoolean(java.lang.String name)
name - name of the valuepublic boolean getBoolean(java.lang.String name,
boolean def)
name - name of the boolean valuedef - default value to return if the name does not existpublic void setBoolean(java.lang.String name,
java.lang.Boolean val)
name - name of the valueval - value to associatepublic java.lang.String getString(java.lang.String name)
name - name of the valuepublic java.lang.String getString(java.lang.String name,
java.lang.String def)
name - name of the string valuedef - default value to return if the string does not existpublic void setString(java.lang.String name,
java.lang.String val)
name - name of the valueval - string value to associatepublic java.lang.Object getSetting(java.lang.String name)
name - name of the settingpublic void update(Settings settings)
settings - settings objectpublic boolean isBarUpdates()
public void setBarUpdates(boolean b)
b - true if bar updates is enabled.public boolean isUseAccountPosition()
public void setUseAccountPosition(boolean b)
b - true if the account position should be used.public boolean isAutoEntry()
public void setAutoEntry(boolean b)
b - true if auto entry is enabledpublic Enums.PositionType getPositionType()
public void setPositionType(Enums.PositionType p)
p - position typepublic boolean isEnterOnActivate()
public void setEnterOnActivate(boolean b)
b - true if enter on activate is enabledpublic boolean isCloseOnDeactivate()
public void setCloseOnDeactivate(boolean b)
b - true if close on deactivate is enabledpublic void setTimeInForce(Enums.TIF tif)
tif - time in forcepublic Enums.TIF getTimeInForce()
public void setTradeLots(int tradeLots)
tradeLots - number of trade lotspublic int getTradeLots()
public java.util.List<TimeFrame> getSessions()
public void addSession(TimeFrame session)
session - trading sessionpublic boolean isEnterOnSessionStart()
public void setEnterOnSessionStart(boolean b)
b - true if enter on session start is enabledpublic boolean isCloseOnSessionEnd()
public void setCloseOnSessionEnd(boolean b)
b - true if the close position on session end is enabledpublic java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone tz)
tz - time zonepublic Settings clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - object to compare topublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - property change listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - property change listenerpublic void removeAllPropertyChangeListeners()