public class TutorialStrategy extends Object implements Strategy
Using this example.
Minimal Strategy implementation: onEvent filters order-book events, reads the updated market
context and computes target minus current filled position. Equal prices choose the long
target because the comparison is >=. It targets +1 or -1 unit, with no automatic cash-based
sizing; create a new instance for each run because previousPrice is mutable state.
Model and publication. No single original research publication is claimed for this library/example policy.
Implementation in this tutorial. This is an event-handling lesson rather than a published econometric model. Price direction selects a fixed signed-unit target and the existing position determines the incremental order. See TutorialStrategy for equal-price behavior and the companion demo for monthly sampling.
Strategy.Param| Constructor and Description |
|---|
TutorialStrategy(Product product)
Creates a fresh fixed-unit strategy for a single product.
|
| Modifier and Type | Method and Description |
|---|---|
void |
onEvent(TraderContext ctx,
Event evt) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializepublic TutorialStrategy(Product product)
product - instrument whose updates and filled position are read from the contextpublic void onEvent(TraderContext ctx, Event evt)
Copyright © 2026. All rights reserved.