I'm working on an automated trading system. On of the most challenging tasks I have faced is as follows:
The system is created with ease of use in mind, so there is a client side application with type-script/java-script. I want the users to easily create their trading algorithms with some predefined parameters and indicators and execute them. The tricky part is to convert what the user wants to an object that can be used by the execution service.
Since the above problem is complicated I rather start with something simpler: Users can write .*
files(like .go .js .java
) which implement their desired algorithms. Ideally I want to add this strategies in runtime(hence might want to use reflection) but for an MVP, creating custom strategies before compiling and compiling the whole project with some new strategies is also an option.
Most of the problems I'm facing are int implementation:
- What should be my approach to the architecture of the strategy parsing system?
- How can I implement some simple interface that can be easily be used to create and new algorithms and strategies and easily be executed by the program?
- In the above problem how can I add this new algorithms at runtime
I have some general Ideas:
Since there might be multiple micro-services, I was thinking of creating a separate micro-service for strategies! This micro-service can register new strategies and exposes some API so other services can check whether the current market triggers any strategy. This design makes the task much simpler since the service can be written with the same language as the client application, also there are many merits to a micro service approach. How ever the overhead of network calls can be a problem if the trade frequency is high! Another approach is the create a library or SDK that can be used in other services,the con here is that all the back-end source code the needs the SDK, should have same language . I don't that is there any other way or not but I would appreciate any help.
Also, considering the building and execution process it self I don't know what is the best practice here. I was thinking of the Builder
and Strategy
patterns but I think there are better options.
Thanks
Aucun commentaire:
Enregistrer un commentaire