com.dukascopy.api
Interface IStrategy


public interface IStrategy

Interface that all strategies should implement

Author:
Denis Larka

Method Summary
 void onAccount(IAccount account)
          Called when account information update is received
 void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar)
          Called on every bar for every basic period and instrument that application is subscribed on
 void onMessage(IMessage message)
          Called when new message is received
 void onStart(IContext context)
          Called on strategy start
 void onStop()
          Called before strategy is stopped
 void onTick(Instrument instrument, ITick tick)
          Called on every tick of every instrument that application is subscribed on
 

Method Detail

onStart

void onStart(IContext context)
             throws JFException
Called on strategy start

Parameters:
context - allows access to all system functionality
Throws:
JFException - when strategy author ignores exceptions

onTick

void onTick(Instrument instrument,
            ITick tick)
            throws JFException
Called on every tick of every instrument that application is subscribed on

Parameters:
instrument - instrument of the tick
tick - tick data
Throws:
JFException

onBar

void onBar(Instrument instrument,
           Period period,
           IBar askBar,
           IBar bidBar)
           throws JFException
Called on every bar for every basic period and instrument that application is subscribed on

Parameters:
instrument - instrument of the bar
period - period of the bar
askBar - bar created of ask side of the ticks
bidBar - bar created of bid side of the ticks
Throws:
JFException

onMessage

void onMessage(IMessage message)
               throws JFException
Called when new message is received

Parameters:
message - message
Throws:
JFException

onAccount

void onAccount(IAccount account)
               throws JFException
Called when account information update is received

Parameters:
account - updated account information
Throws:
JFException

onStop

void onStop()
            throws JFException
Called before strategy is stopped

Throws:
JFException


Copyright © 2009. All Rights Reserved.