package jforex;

import com.dukascopy.api.*;
import java.util.*;
import com.dukascopy.api.IEngine.OrderCommand;

public class EquityBug implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private boolean entry = false;
    
    public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
    }

    public void onAccount(IAccount account) throws JFException {
    }

    public void onMessage(IMessage message) throws JFException {
    }

    public void onStop() throws JFException {
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
        if (entry) return;
        entry = true;
        engine.submitOrder("test_"+System.currentTimeMillis(),
            instrument, OrderCommand.BUY, 0.1, 0, 20, 0, 0);
    }
    
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}