public class IBDemoStrategy extends Object implements ResumableStrategy
Using this example. Illustrates a resumable broker strategy: initialize state, handle events, submit limit orders and serialize state for restart. This class is used by IBStrategyServerDemo and can send broker orders when connected; configure a paper account and inspect the order logic before running.
Strategy.Param| Constructor and Description |
|---|
IBDemoStrategy(NamedParam param) |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(TraderContext ctx) |
void |
onEvent(TraderContext ctx,
Event evt) |
void |
resumeStates(TraderContext ctx,
Map<String,String> savedStates) |
List<Product> |
resumeTradedProducts(List<String> savedProductInfo) |
Map<String,String> |
saveStates() |
List<String> |
saveTradedProducts() |
public IBDemoStrategy(NamedParam param)
public void initialize(TraderContext ctx)
initialize in interface Strategypublic void onEvent(TraderContext ctx, Event evt)
public List<String> saveTradedProducts()
saveTradedProducts in interface ResumableStrategypublic List<Product> resumeTradedProducts(List<String> savedProductInfo)
resumeTradedProducts in interface ResumableStrategypublic Map<String,String> saveStates()
saveStates in interface ResumableStrategypublic void resumeStates(TraderContext ctx, Map<String,String> savedStates)
resumeStates in interface ResumableStrategyCopyright © 2026. All rights reserved.