Write in Excel (DDE)

A strategy updates Excel. Once the bar is completed, you will get a new line in your sheet. You can adjust the strategy according to your needs and update any cells in your Excel files.

Pretty Tools JDDE 2.1.0

Steps to run the strategy:

  1. Put the jar file in the folder "JForex\Strategies\files"
  2. Put the dll file in the system32 folder
  3. Keep Excel opened

Notice: if you stop the strategy, you need to restart the platform to ensure dll file is loaded accordingly.

package com.dukascopy;

import com.dukascopy.api.*;
import com.dukascopy.api.Configurable;
import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.pretty_tools.dde.client.DDEClientConversation;
import com.pretty_tools.dde.DDEException;


public class UpdateExcel implements IStrategy {

    public Instrument insturment = Instrument.EURUSD;

    public Period period = Period.TEN_SECS;

    @Configurable("Select the starting row")
    public int row = 1;
    @Configurable("Select the starting column")
    public int column = 1;
    @Configurable("Type sheet name")
    public String  sheetName = "Sheet1";

    private DDEClientConversation conversation; 
    private IConsole console;
    private int counter;

    public void onStart(IContext context) throws JFException {

        conversation = new DDEClientConversation(); 
        console = context.getConsole();
        counter = 0;

        try {
            conversation.connect("Excel", sheetName);

        } catch (DDEException e) {


    public synchronized void onBar(Instrument instrument, Period period, IBar askBar,
            IBar bidBar) throws JFException {

        if (instrument == this.insturment && period == this.period) {

            try {

            } catch (DDEException e) {





    public void onTick(Instrument instrument, ITick tick) throws JFException {


    public void onAccount(IAccount account) throws JFException {


    public void onMessage(IMessage message) throws JFException {


    public void onStop() throws JFException {


    public void print(String str) {



    public String getCell(int num) {

        String str = "R" +(row+counter) + "C" + (column+num);

        return str;


The information on this web site is provided only as general information, which may be incomplete or outdated. Click here for full disclaimer.