Hello. I have problem with UpdateExcel, when i run in local this strategie, i get define parameter ( ok ) and when i run i get message: 2012-05-31 08:12:27 Strategy "UpdateExcel" is stopped at 2012-05-31 08:12:27.587 GMT on the local computer with parameters "CCY"=[EUR/USD], "Period"=[10 Secs], "Select the starting row"=[1], "Select the starting column"=[100], "Type sheet name"=[5min]
i can give you code from console java : 31.05.2012 10:12:27.583 SEVERE connect.JForexTaskManager ] Could not initialize class com.pretty_tools.dde.client.DDEClientConversation java.lang.NoClassDefFoundError: Could not initialize class com.pretty_tools.dde.client.DDEClientConversation at jforex.UpdateExcel.onStart(UpdateExcel.java:49) at com.dukascopy.api.impl.execution.u.call(Unknown Source) at com.dukascopy.api.impl.connect.bh.a(Unknown Source) at com.dukascopy.api.impl.connect.ai.call(Unknown Source) at com.dukascopy.api.impl.connect.ai.call(Unknown Source) at com.dukascopy.api.impl.execution.k.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at com.dukascopy.api.impl.execution.g$a.f(Unknown Source) at com.dukascopy.api.impl.execution.g$a.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 31.05.2012 10:12:50.453 SEVERE actions.SendLogAction ] Connection reset java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at sun.security.ssl.InputRecord.readFully(Unknown Source) at sun.security.ssl.InputRecord.read(Unknown Source) at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source) at sun.security.ssl.SSLSocketImpl.waitForClose(Unknown Source) at sun.security.ssl.HandshakeOutStream.flush(Unknown Source) at sun.security.ssl.Handshaker.kickstart(Unknown Source) at sun.security.ssl.SSLSocketImpl.kickstartHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source) at com.dukascopy.dds2.greed.actions.SendLogAction.c(Unknown Source) at com.dukascopy.dds2.greed.actions.SendLogAction.yB(Unknown Source) at com.dukascopy.dds2.greed.actions.c.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
and a code from UpdateExcel: package jforex;
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.client.DDEClientException;
@Library("pretty-tools-JDDE-1.0.2.jar")
@RequiresFullAccess public class UpdateExcel implements IStrategy { @Configurable("CCY") public Instrument insturment = Instrument.EURUSD; @Configurable("Period") public Period period = Period.TEN_SECS; @Configurable("Select the starting row") public int row = 1; @Configurable("Select the starting column") public int column = 100; @Configurable("Type sheet name") public String sheetName = "5min"; private DDEClientConversation conversation; private IConsole console; private int counter;
@Override public void onStart(IContext context) throws JFException { conversation = new DDEClientConversation(); console = context.getConsole(); counter = 0; try { conversation.connect("Excel", sheetName);
} catch (DDEClientException e) { print(e.toString()); } } public synchronized void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { if (instrument == this.insturment && period == this.period) { try { conversation.poke(getCell(0),String.valueOf(bidBar.getOpen())); conversation.poke(getCell(1),String.valueOf(bidBar.getHigh())); conversation.poke(getCell(2),String.valueOf(bidBar.getLow())); conversation.poke(getCell(3),String.valueOf(bidBar.getClose())); conversation.poke(getCell(4),String.valueOf(bidBar.getVolume())); conversation.poke(getCell(5),String.valueOf(bidBar.getTime())); conversation.poke(getCell(6),String.valueOf(askBar.getOpen())); conversation.poke(getCell(7),String.valueOf(askBar.getHigh())); conversation.poke(getCell(8),String.valueOf(askBar.getLow())); conversation.poke(getCell(9),String.valueOf(askBar.getClose())); conversation.poke(getCell(10),String.valueOf(askBar.getVolume())); conversation.poke(getCell(11),String.valueOf(askBar.getTime())); } catch (DDEClientException e) { print(e.toString()); } counter++; }
} @Override public void onTick(Instrument instrument, ITick tick) throws JFException { }
@Override public void onAccount(IAccount account) throws JFException {
}
@Override public void onMessage(IMessage message) throws JFException {
}
@Override public void onStop() throws JFException {
} public void print(String str) { console.getOut().println(str); } public String getCell(int num) { String str = "R" +(row+counter) + "C" + (column+num); return str; }
this updateExcel i used few months ago was ok, so i don't understand why not now. last thing to help may be. I use excel 2010
thanks for your help.
|