import java.awt.*;
import java.util.*;
import com.dukascopy.api.*;
import com.dukascopy.api.drawings.*;
public class DemoStrategy implements IStrategy {
public void onStart(IContext context) throws JFException {
IChart chart = context.getLastActiveChart();
IChartObjectFactory cf = chart.getChartObjectFactory();
IScreenLabelChartObject staticLabel = cf.createScreenLabel("my-static-label");
staticLabel.setColor(Color.RED);
staticLabel.setText("static - print me on the chart pls");
staticLabel.setCorner(IScreenLabelChartObject.Corner.TOP_RIGHT);
staticLabel.setxDistance(20);
staticLabel.setyDistance(20);
chart.add(staticLabel);
ILabelChartObject timedLabel = cf.createLabel("my-timed-label");
timedLabel.setColor(Color.RED);
timedLabel.setText("timed - print me on the chart pls");
timedLabel.setTime(0, System.currentTimeMillis());
timedLabel.setPrice(0, (chart.getMaxPrice() + chart.getMinPrice()) / 2);
chart.add(timedLabel);
}