Develop Your System
This section is to discuss the key components in Cyan Spring framework and how to develop your system based on those componentsMulti-instrument Strateiges
To develop a multi-instrument strategy, you simply create a new class of your own and make it a subclass of com.cyanspring.strategy.multiinstrument.MultiInstrumentStrategy. Once you have your multi-instrument strategy class, you need to provide implementation for ONE of the following(but not both)
IMultiInstrumentAnalyzer analyzer
This class member is an interface, you need to create a class which implments this interface and put it in spring configuration xml file.public interface IMultiInstrumentAnalyzer { PriceInstruction analyze(MultiInstrumentStrategy strategy); }The only method in this interface returns a PriceInstruction for the framework to work out the child order actions.
Please refer to PriceInstruction for the details.
PriceInstruction analyze() method
You may also directly override the parent class method analyze() to provide your own implementation. This produce the same result of a PriceInstruction for the framework to work out the child order actions.Please refer to PriceInstruction for the details.