Typically a strategy running corresponds to one entry in the database table strategy
. In certain situations it may be necessary for a running strategy to place orders into separate entries in the database table strategy
. Reasons for this might be:
-
A strategy wants to have of multiple positions on the same instrument (i.e. long and short positions at the same time)
-
A strategy needs to track positions for different accounts
For this purpose it is possible to use so called Base Strategy Names.
Example:
A strategy named EXAMPLE
would like to interact with two separate entries in the database named LONG
and SHORT
. For this purpose the strategy needs to be started with the strategyName
set to EXAMPLE
inside the file conf.properties
. Alternatively the properties can be changed via VM arguments:
strategyName = EXAMPLE
In addition one needs to create the two entries EXAMPLE|LONG
and EXAMPLE|SHORT
in the database table strategy
. the |
separator causes strategy events like OrderStatusVO
, FillVO
and TransactionVO
are propagated to the running strategy EXAMPLE
.
Note
Using other characters than |
will not work and will cause strategy events not to arrive in the EXAMPLE
strategy.
Comments
0 comments
Please sign in to leave a comment.