|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IContext
Gives access to the various parts of the system
| Method Summary | ||
|---|---|---|
|
executeTask(Callable<T> callable)
Every strategy executes in it's own thread. |
|
IAccount |
getAccount()
Returns last known state of the account info. |
|
IChart |
getChart(Instrument instrument)
Returns first chart for specified instrument. |
|
Set<IChart> |
getCharts(Instrument instrument)
Returns set of charts for specified instrument. |
|
IConsole |
getConsole()
Returns interface that allows to write messages into the Messages table |
|
IEngine |
getEngine()
Returns interface of the main engine (order submitting, merging etc) |
|
File |
getFilesDir()
Returns directory where reading and writing is allowed. |
|
IHistory |
getHistory()
Returns interface that allows access to history data |
|
IIndicators |
getIndicators()
Returns interface that allows to calculate indicator values |
|
IStrategies |
getStrategies()
Returns interface that allows to start/stop and control other strategies |
|
Set<Instrument> |
getSubscribedInstruments()
Returns set of the currently subscribed instruments |
|
IUserInterface |
getUserInterface()
Returns an interface which provides control to custom strategy tabs in the main and bottom panels |
|
boolean |
isFullAccessGranted()
Returns true if strategy is granted full access. |
|
boolean |
isStopped()
Returns true if user requested to stop the strategy. |
|
void |
pause()
Pauses historical testing, doesn't have any effect if not in historical tester |
|
void |
setSubscribedInstruments(Set<Instrument> instruments)
Checks that the instruments are subscribed and subscribes to the instrument if it's not. |
|
void |
stop()
Stops strategy execution. |
|
void |
subscribeToBarsFeed(Instrument instrument,
Period period,
OfferSide offerSide,
IBarFeedListener listener)
Subscribes passed listener on bars feed notification by passed instrument, period and offer side |
|
void |
subscribeToPointAndFigureFeed(Instrument instrument,
OfferSide offerSide,
PriceRange priceRange,
ReversalAmount reversalAmount,
IPointAndFigureFeedListener listener)
Subscribes passed listener on point and figure feed notification by passed instrument, offer side, price range and reversal amount |
|
void |
subscribeToRangeBarFeed(Instrument instrument,
OfferSide offerSide,
PriceRange priceRange,
IRangeBarFeedListener listener)
Subscribes passed listener on range bars feed notification by passed instrument, offer side and price range |
|
void |
subscribeToTickBarFeed(Instrument instrument,
OfferSide offerSide,
TickBarSize tickBarSize,
ITickBarFeedListener listener)
Subscribes passed listener on tick bar feed notification by passed instrument, offer side and tick bar size |
|
void |
unsubscribeFromBarsFeed(IBarFeedListener listener)
Unsubscribes passed listener from bars feed notification |
|
void |
unsubscribeFromPointAndFigureFeed(IPointAndFigureFeedListener listener)
Unsubscribes passed listener from point and figure feed notification |
|
void |
unsubscribeFromRangeBarFeed(IRangeBarFeedListener listener)
Unsubscribes passed listener from range bars feed notification |
|
void |
unsubscribeFromTickBarFeed(ITickBarFeedListener listener)
Unsubscribes passed listener from tick bar feed notification |
|
| Method Detail |
|---|
IEngine getEngine()
IChart getChart(Instrument instrument)
instrument - currency pair
Set<IChart> getCharts(Instrument instrument)
instrument - currency pair
Set<IChart>IUserInterface getUserInterface()
IHistory getHistory()
IConsole getConsole()
IIndicators getIndicators()
IAccount getAccount()
IStrategies getStrategies()
void setSubscribedInstruments(Set<Instrument> instruments)
instruments - set of instruments, that strategy needs for it's workSet<Instrument> getSubscribedInstruments()
void stop()
boolean isStopped()
boolean isFullAccessGranted()
<T> Future<T> executeTask(Callable<T> callable)
IStrategy
will be executed in order.
Submission of orders can be called only from these thread.
If some critical action like submitting order needs to be called from other thread, you need to use this method to access
strategy thread.
T - type of the return valuecallable - task to execute
Future<T> that can be used to get result of executionFile getFilesDir()
void pause()
void subscribeToBarsFeed(Instrument instrument,
Period period,
OfferSide offerSide,
IBarFeedListener listener)
instrument - period - offerSide - listener - void unsubscribeFromBarsFeed(IBarFeedListener listener)
listener -
void subscribeToRangeBarFeed(Instrument instrument,
OfferSide offerSide,
PriceRange priceRange,
IRangeBarFeedListener listener)
instrument - offerSide - priceRange - listener - void unsubscribeFromRangeBarFeed(IRangeBarFeedListener listener)
listener -
void subscribeToPointAndFigureFeed(Instrument instrument,
OfferSide offerSide,
PriceRange priceRange,
ReversalAmount reversalAmount,
IPointAndFigureFeedListener listener)
instrument - offerSide - priceRange - reversalAmount - listener - void unsubscribeFromPointAndFigureFeed(IPointAndFigureFeedListener listener)
listener -
void subscribeToTickBarFeed(Instrument instrument,
OfferSide offerSide,
TickBarSize tickBarSize,
ITickBarFeedListener listener)
instrument - offerSide - tickBarSize - listener - void unsubscribeFromTickBarFeed(ITickBarFeedListener listener)
listener -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||