Develop Your System
This section is to discuss the key components in Cyan Spring framework and how to develop your system based on those componentsSingle-order Strateiges
To develop a single-order strategy, you simply create a new class of your own and make it a subclass of com.cyanspring.strategy.singleorder.SingleOrderStrategy. Once you have your single-order strategy class, you need to provide implementation for the following membersIQuantityAnalyzer quantityAnalyzer
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 IQuantityAnalyzer { QuantityInstruction analyze(SingleOrderStrategy strategy); }The only method in this interface returns a QuantityInstruction specifies how much active quantity and passive quantity you want to send to market, which is later to be interpreted by price analyzer.
IPriceAnalyzer priceAnalyzer
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 IPriceAnalyzer { PriceInstruction analyze(QuantityInstruction qtyInstruction, SingleOrderStrategy strategy); }The only method in this interface takes the result from quantity analyzer and produce a PriceInstruction for the framework to work out child order actions.
Please refer to PriceInstruction for the details.