Package com.strategyquant.tradinglib
Class Blocks
java.lang.Object
com.strategyquant.tradinglib.Blocks
- All Implemented Interfaces:
com.strategyquant.lib.snippets.ICustomClasses
The Class Blocks.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckContains(Class<?> aClass, String className)Check contains.static booleanExists.static voidgenerateBlocksXml(org.jdom2.Element elRoot)Generate blocks xml.static org.jdom2.ElementgenerateBlockTreeXml(IBlock block)Generate block tree xml.static voidgenerateExitRulesXml(org.jdom2.Element elExitRules)Generate exit rules xml.Generate opposite blocks map.static IBlockGets the.static IBlock[]Gets the all available blocks.static IBlockgetBlockObject(String snippetName, StrategyBase strategy, org.jdom2.Element elBlock)Gets the block object.static intgetBlockType(IBlock block)Gets the block type.static IBlockgetOppositeBlock(IBlock block)Gets the opposite block.static StringgetOppositeBlockKey(String blockKey)Gets the opposite block key.static intgetReturnType(IBlock block)Gets the return type.static IBlockgetSameBlock(IBlock block)Gets the clone of the same block.static voidinit()Inits the.voidreload()Reload.static voidsortByOrder(ExitMethod[] exitMethods)Sort by order.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log.
-
-
Method Details
-
init
Inits the.- Throws:
Exception- the exception
-
getBlockObject
public static IBlock getBlockObject(String snippetName, StrategyBase strategy, org.jdom2.Element elBlock) throws BlockDefinitionExceptionGets the block object.- Parameters:
snippetName- the snippet namestrategy- the strategyelBlock- the el block- Returns:
- the block object
- Throws:
BlockDefinitionException- the block definition exception
-
get
Gets the.- Parameters:
snippetName- the snippet name- Returns:
- the i block
- Throws:
BlockDefinitionException- the block definition exception
-
exists
Exists.- Parameters:
snippetName- the snippet name- Returns:
- true, if successful
- Throws:
BlockDefinitionException- the block definition exception
-
generateBlockTreeXml
Generate block tree xml.- Parameters:
block- the block- Returns:
- the element
- Throws:
BlockDefinitionException- the block definition exception
-
generateBlocksXml
Generate blocks xml.- Parameters:
elRoot- the el root- Throws:
BlockDefinitionException- the block definition exception
-
checkContains
Check contains.- Parameters:
aClass- the a classclassName- the class name- Returns:
- true, if successful
-
getBlockType
Gets the block type.- Parameters:
block- the block- Returns:
- the block type
- Throws:
Exception- the exception
-
getReturnType
Gets the return type.- Parameters:
block- the block- Returns:
- the return type
- Throws:
Exception- the exception
-
getAllAvailableBlocks
Gets the all available blocks.- Returns:
- the all available blocks
- Throws:
Exception- the exception
-
generateExitRulesXml
public static void generateExitRulesXml(org.jdom2.Element elExitRules) throws BlockDefinitionExceptionGenerate exit rules xml.- Parameters:
elExitRules- the el exit rules- Throws:
BlockDefinitionException- the block definition exception
-
reload
public void reload()Reload.- Specified by:
reloadin interfacecom.strategyquant.lib.snippets.ICustomClasses
-
generateOppositeBlocksMap
Generate opposite blocks map.- Returns:
- the tree map
-
getOppositeBlock
Gets the opposite block.- Parameters:
block- the block- Returns:
- the opposite block
- Throws:
BlockDefinitionException- the block definition exception
-
getSameBlock
Gets the clone of the same block.- Parameters:
block- the block- Returns:
- the opposite block
- Throws:
BlockDefinitionException- the block definition exception
-
getOppositeBlockKey
Gets the opposite block key.- Parameters:
blockKey- the block key- Returns:
- the opposite block key
-
sortByOrder
Sort by order.- Parameters:
exitMethods- the exit methods
-