Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

About onTick method
 Post subject: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 13:27 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
I downloaded the project "singlejartest" from your website "www.dukascopy.com",I I run it in Ecplise, then I found that the onTick method(in the strategies MA_PLAY) run normally when execute the "TestMain", but It does not normally that I execute Main. Later, i login jnlp, run the strategies MA_PLAY in real-time, then the same problem occurred.Why? It's a bug?


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 13:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
goodsss241 wrote:
but It does not normally that I execute Main
Please elaborate.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 14:54 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
I execute the Main.java, but the onTick method in MA_PLAY.java is not called. The same problem is that I launch the jforex.jnlp, and login the jforex platform, then run the MA_PLAY strategies on my computer(Local Run), the onTick method in MA_PLAY is not called.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 15:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
goodsss241 wrote:
but the onTick method in MA_PLAY.java is not called.
How did you check that is not called? Consider logging ticks to make sure they actually get called, see:
https://www.dukascopy.com/wiki/#IConsole/Logging_values


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 15:27 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
Yes, I use the way "Print last ask price", no information always. in addition, i use the way "Print last ask price" in onBar method, there will be information, so MA_PLAY strategies is running


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 15:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide:
  1. The program which runs the strategy
  2. The strategy
  3. JForex-SDK and JForex-API versions that you use.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 15:58 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
The project "singlejartest" that downloaded from your website, execute Main.java and TestMain.java, call the MA_PLAY.java strategy.The JForex-SDK and JForex-API is the newest version --- JForex-SDK-2.27.2.1.jar and JForex-API-2.9.3.1.jar


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 16:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
goodsss241 wrote:
call the MA_PLAY.java strategy
It does not contain any logging in the onTick method. How do you know that it is not getting executed?
goodsss241 wrote:
I use the way "Print last ask price", no information always. in addition, i use the way "Print last ask price" in onBar method, there will be information, so MA_PLAY strategies is running
Please provide a strategy and a program that you run and which replicates the case.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Fri 11 Oct, 2013, 16:27 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
I add the codes of "Print last ask price" into the onTick method in the MA_PLAY.java. At the same time, I add the codes of "Print last ask price" into the onBar method in the MA_PLAY.java.
The onBar method can output information, but the onTick method can not.
Not only that, you may login jforex platform from jnlp, then run MA_PLAY.java real-time, the same problem also appears.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Sat 12 Oct, 2013, 03:47 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
I uploaded the project


Attachments:
MA_Play.java [5.52 KiB]
Downloaded 202 times
TesterMain.java [5.61 KiB]
Downloaded 162 times
Main.java [5.05 KiB]
Downloaded 199 times
JForex-SDK.zip [20.92 KiB]
Downloaded 139 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.
 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Sat 12 Oct, 2013, 18:01 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
I've replied on your other topic before I saw that there are some more about the subject...

Anyway, keep in mind that it is now weekend, which means that there is no price feed working (for the Demo accounts for sure). So testing now the onTick() method is useless...
What you can try is to test a strategy with the TesterMain, as it is working fine in the weekend as well (because it is not using live data feeds).

I am still not sure what is you exact situation. Are you just trying to get familiar with the JForex SDK and doing you first test on the onTick() method?


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 04:17 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
Image
Image


Hello, I pasted the Figures. 3 Figures above display the MA_PLAY.java run on jforex platform, next I
pasted the Figures which display the MA_PLAY.java run in Eclipse, can you see that the onTick method is not called?



Image


Attachments:
Eclipse.jpg [234.84 KiB]
Downloaded 430 times
info.jpg [152.76 KiB]
Downloaded 448 times
onBar.jpg [18.85 KiB]
Downloaded 297 times
onTick.jpg [81.97 KiB]
Downloaded 378 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.
 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 08:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Your account is inactive that is why you don't receive ticks. This gets announced on every login in the platform and from a strategy you can check it the following way:
https://www.dukascopy.com/wiki/#Account_Info/Trading_allowance
Please register a new demo account and retry running the program.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 08:30 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
Now, I add the code in the onStart method.
print("AccountState="+context.getAccount().getAccountState());

The info is
07:24:36 AccountState=BLOCKED

Then, how can I do?


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 08:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
API Support wrote:
Please register a new demo account and retry running the program.


 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 08:55 

User rating: 0
Joined: Thu 10 Oct, 2013, 16:24
Posts: 10
Location: China, Hebi
I use Chinese login jforex platform previously, however, the warning message does not display properly,
as shown below:

Image

now, I use English Login, then, I saw the warning message, as shown below:
Image

Dear support, Why my account is not activated? Can you tell me? Thanks!!!


Attachments:
Chinese_Account_BLOCKED.jpg [14.77 KiB]
Downloaded 406 times
Account_BLOCKED.jpg [15.46 KiB]
Downloaded 389 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.
 
 Post subject: Re: About onTick method Post rating: 0   Post Posted: Mon 14 Oct, 2013, 08:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Normally the DEMO accounts are active for 14 days, hence once they expire you need to open a new one. For more on this please post your inquiries in the Trading Platforms/FAQ section.


Submit programming questions in this forum only.


 

Jump to:  

  © 1998-2026 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