Dukascopy
 
 
Wiki JStore Search Login

problem avec updateExcel
 Post subject: problem avec updateExcel Post rating: 0   New post Posted: Thu 31 May, 2012, 09:23 

User rating: 0
Joined: Thu 31 May, 2012, 09:04
Posts: 4
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.


 
 Post subject: Re: problem avec updateExcel Post rating: 2   New post Posted: Tue 05 Jun, 2012, 17:08 
User avatar

User rating: 4
Joined: Wed 21 Dec, 2011, 10:21
Posts: 30
Location: France, Sallanches
Hello,
are you sure the file "pretty-tools-JDDE-1.0.2.jar" is placed in "Dukascopy\Strategy\files" (see the "files" at the end).
Are you using excel in french version ? In this case you must replace this code:

public String getCell(int num) {


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

return str;
}


by this:

public String getCell(int num) {


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

return str;
}


(notice the "R" is replaced by "L")

Hope that help you...


 
 Post subject: Re: problem avec updateExcel Post rating: 0   New post Posted: Wed 06 Jun, 2012, 12:13 

User rating: 0
Joined: Thu 31 May, 2012, 09:04
Posts: 4
Hello Tyraslin

Thank's for your help,
my excel 2010 is in french
I changed "R" By "L" save and compiled, i look in files : "pretty-tools-JDDE-1.0.2.jar" is placed it's ok pretty-tools-JDDE-1.0.1.jar to.
i did all the thing you wrote me but is still a same.

2012-06-06 11:05:26 Strategy "UpdateExcelask" is stopped at 2012-06-06 11:05:26.290 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"=[Feuil1]

i have only one doubt ?
i am not sure about arborescnce ( excuse my english ).
you wrote me

" are you sure the file "pretty-tools-JDDE-1.0.2.jar" is placed in "Dukascopy\Strategy\files" (see the "files" at the end) "

but on my computer i find this files in :C:\Users\simonkho\JForex\Dukascopy\Strategies\files

it's in a wrong place ? should i need only C:\Dukascopy\Strategies\files

sorry but i am so beginner.
Thank's again for your help.


 
 Post subject: Re: problem avec updateExcel Post rating: 2   New post Posted: Fri 08 Jun, 2012, 13:23 
User avatar

User rating: 4
Joined: Wed 21 Dec, 2011, 10:21
Posts: 30
Location: France, Sallanches
First of all, I apologize to give the response in french but since Humble and myself are french, it will be less difficult for me to explain it in our mother tongue.

Humble, j'ai fait un copier/coller du code que tu avais posté.
Première remarque: il y avait une erreur de frappe, ce qui "foutais le bazar" (excuse-moi pour mon langage peu chatié ;)
Tu avais

@Configurable("CCY")
public Instrument insturment = Instrument.EURUSD;


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


(remarque le insTUrment et insTRument)

J'ai corrigé...

Ensuite, pour ce qui est du chemin où tu place le fichier "pretty-tools-JDDE-1.0.2.jar", il me semble correct tant que tu n'as pas touché aux chemins d'accès par défaut.

Enfin, tu dois avoir une feuille de calcul nommée "5min" dans excel. Si tu veux essayer en lançant excel comme ça, sans rien changer, remplace "5min" par "Feuil1".

Tu dois d'abord ouvrir ta feuille excel AVANT de lancer la stratégie (très important, sinon, ça ne peut pas fonctionner).
Enfin (last but not least), au début je croyais que ça ne fonctionnais pas - et je n'avais aucun message d'erreur. Tu as mis

@Configurable("Select the starting column")
public int column = 100;


Remplace le par
@Configurable("Select the starting column")
public int column = 1;


Sans cela, les valeurs seront affichées à partir de la 100ème colonne sous excel (perso, mon écran ne fait par 63 pouces, donc je ne voyais rien ;)

J'allais oublier: il faut que tu ouvre le graph de l'eur/usd (peu importe la période - j'ai essayé)

Voilà, je te joins le fichier corrigé avec les bonnes options par défaut.

Pour résumé:
- prend la stratégie que j'ai mis en pièce jointe
- met la dans "C:\Users\simonkho\JForex\Dukascopy\Strategies\"
- Ouvre Excel (un classeur vierge)
- Lance JForex
- Vérifie que le graph EUR/USD est bien affiché
- lance la stratégie.
- vérifie que tu as bien 1 pour "select the starting row" ET "select the starting column"
- vérifie que tu as bien "Feuil1" pour "Type sheet name"


Pour infos, si tu lances ta stratégie, que tu l'arrête et que tu la relances, ça ne fonctionnera pas. Tu sera obliger de fermer ta plateforme JForex pour la relancer.

Voilà, j'espère que cela marchera.


Attachments:
UpdateExcel.java [2.8 KiB]
Downloaded 423 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com