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 boolean
checkContains(Class<?> aClass, String className)
Check contains.static boolean
Exists.static void
generateBlocksXml(org.jdom2.Element elRoot)
Generate blocks xml.static org.jdom2.Element
generateBlockTreeXml(IBlock block)
Generate block tree xml.static void
generateExitRulesXml(org.jdom2.Element elExitRules)
Generate exit rules xml.Generate opposite blocks map.static IBlock
Gets the.static IBlock[]
Gets the all available blocks.static IBlock
getBlockObject(String snippetName, StrategyBase strategy, org.jdom2.Element elBlock)
Gets the block object.static int
getBlockType(IBlock block)
Gets the block type.static IBlock
getOppositeBlock(IBlock block)
Gets the opposite block.static String
getOppositeBlockKey(String blockKey)
Gets the opposite block key.static int
getReturnType(IBlock block)
Gets the return type.static IBlock
getSameBlock(IBlock block)
Gets the clone of the same block.static void
init()
Inits the.void
reload()
Reload.static void
sortByOrder(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:
reload
in 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
-