Package com.strategyquant.tradinglib
Interface IBlock
- All Known Implementing Classes:
ExitMethod
public interface IBlock
Block Interface - has methods to call actions over block.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone(boolean includingParameters, StrategyBase strategy)
Clone.void
copyCustomData(IBlock block)
Copy custom data.double
Evaluate block.double
evaluateBlock(int relativeShift)
Evaluate block.org.jdom2.Element
getCustomBlockXml(int type)
Gets the custom block xml.int
getCustomData(String key)
Gets the custom data.int
Gets the return type.Gets the strategy.newInstance(StrategyBase strategy, org.jdom2.Element elBlock)
New instance.void
setCustomData(String key, int value)
Sets the custom data.void
setReturnType(int returnType)
Sets the return type.
-
Field Details
-
True
static final double TrueThe Constant True.- See Also:
- Constant Field Values
-
False
static final double FalseThe Constant False.- See Also:
- Constant Field Values
-
-
Method Details
-
evaluateBlock
Evaluate block.- Returns:
- the double
- Throws:
TradingException
- the trading exception
-
evaluateBlock
Evaluate block.- Parameters:
relativeShift
- the relative shift- Returns:
- the double
- Throws:
TradingException
- the trading exception
-
newInstance
IBlock newInstance(StrategyBase strategy, org.jdom2.Element elBlock) throws BlockDefinitionExceptionNew instance.- Parameters:
strategy
- the strategyelBlock
- the el block- Returns:
- the i block
- Throws:
BlockDefinitionException
- the block definition exception
-
getStrategy
StrategyBase getStrategy()Gets the strategy.- Returns:
- the strategy
-
clone
Clone.- Parameters:
includingParameters
- the including parametersstrategy
- the strategy- Returns:
- the i block
- Throws:
BlockDefinitionException
- the block definition exception
-
setCustomData
Sets the custom data.- Parameters:
key
- the keyvalue
- the value
-
getCustomData
Gets the custom data.- Parameters:
key
- the key- Returns:
- the custom data
-
copyCustomData
Copy custom data.- Parameters:
block
- the block
-
getReturnType
int getReturnType()Gets the return type.- Returns:
- the return type
-
setReturnType
void setReturnType(int returnType)Sets the return type.- Parameters:
returnType
- the new return type
-
getCustomBlockXml
Gets the custom block xml.- Parameters:
type
- the type- Returns:
- the custom block xml
- Throws:
BlockDefinitionException
- the block definition exception
-