Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

General Discussion and Comments
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=21&t=4771
Page 14 of 17

Author:  ahabkl [ Thu 03 Mar, 2011, 16:23 ]
Post subject:  jpforexsrategy is this possible sir can i know how to make a strategy in jpforex platform

sir
i am trying to make a strategy but not familiar with java is this possible sir can i know how to make a strategy in jpforex platform
or is this possible to get a sample how to write a strategy in jforex platform
thanks
regards

Author:  Contest Support [ Fri 04 Mar, 2011, 12:20 ]
Post subject:  Re: General Discussion and Comments

Yes, you can use published strategies as examples. Otherwise, if you are interested in manual trading, please register to Traders contest.

Author:  [Haydel] [ Sat 05 Mar, 2011, 20:38 ]
Post subject:  Re: OverTheWeekend leverage control

Contest Support wrote:
One of the contestants asked a question how to check if the over-the-weekend leverage hours are in place. Here is a code below with a method

public boolean isOverTheWeekend() {
       
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
        calendar.setTime(new Date());
       
        if (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.FRIDAY) return false;
        if (calendar.HOUR_OF_DAY < 18) return false;
        else return true;
     
    }




I think it should be:
calendar.get(Calendar.HOUR_OF_DAY) < 18


instead of:
calendar.HOUR_OF_DAY < 18



Regards,

Haydel

Author:  Contest Support [ Mon 07 Mar, 2011, 09:12 ]
Post subject:  Re: General Discussion and Comments

This field is static, so you can retrieve from the class name or from the instance object. The result is the same.

Author:  nikunj0580 [ Fri 11 Mar, 2011, 10:09 ]
Post subject:  Configurable

I want to know whether configurable can be used in strategy for time period,target , stoploss and instrument? Or its not allowed ?

Author:  Contest Support [ Tue 15 Mar, 2011, 12:31 ]
Post subject:  Re: General Discussion and Comments

sorry, but' it can't be used.

Author:  [Frank] [ Wed 30 Mar, 2011, 14:40 ]
Post subject:  Re: General Discussion and Comments

Hi Support,
yesterday I backtested a strategy without problem, today when I backtested the same strategy without changes Historical Tester gave me different "crazy" results and the following error:

13:33:47 Strategy tester: java.lang.ArrayIndexOutOfBoundsException: -1 @ FrankStrategy.onTick(FrankStrategy.java:83)

the line 83 is simple:

double EMA5 = indicators.ema(instrument, myPeriod, OfferSide.BID,IIndicators.AppliedPrice.CLOSE, 5, Filter.WEEKENDS, 1, tick.getTime(), 0)[0];                   


Has anything changed in Historical Tester ?

Best regards,
Frank

Author:  Contest Support [ Fri 01 Apr, 2011, 09:12 ]
Post subject:  Re: General Discussion and Comments

Yes, the platform was updated. Can you please provide us with more exact details how do you get the exception and why the results are different?

We will have a more detailed look at the problem. Thanks.

Author:  [Frank] [ Fri 01 Apr, 2011, 13:41 ]
Post subject:  Re: General Discussion and Comments

Contest Support wrote:
Yes, the platform was updated. Can you please provide us with more exact details how do you get the exception and why the results are different?

We will have a more detailed look at the problem. Thanks.


Hi Support,
I noted the same trouble in another strategy for which I have previous data backtesting. The recent backtesting
results are worse and the Tester shows a similar error (that there was not in previous backtesting):

2011-04-01 12:23:06 Strategy tester: java.lang.ArrayIndexOutOfBoundsException: -1 @ jforex.Frank_CashboneNov.stopLossATR(Frank_CashboneNov.java:214)

The line of exception is again enough simple:
double atr = indicators.atr(myInstrument, myPeriod, OfferSide.BID, periodSpan, Filter.WEEKENDS, 1, time, 0)[0];



I attached this strategy and at the end of file you'll find the backtesting results made before 30.03.2011 and
the results made today.

Best regards,
Frank

Author:  Contest Support [ Fri 01 Apr, 2011, 14:07 ]
Post subject:  Re: General Discussion and Comments

thank you for the strategy, Frank. We will start investigation on this problem. I will keep you posted.

Author:  [2010noob] [ Sat 02 Apr, 2011, 05:38 ]
Post subject:  Re: General Discussion and Comments

I had (and continue to have) the same problem with my demo accounts (both contest and permanent demo accounts) when I use the historical backtester.

It started about three days ago after I logged in and got an error saying that "...the site certificate was not issued by Dukascopy...should log out immediately...should contact Dukascopy Support."

I didn't have time to deal with it that day, and when I tried yesterday, the error message did not appear, and after that I noticed the historical tester results in my demo accounts were waaaaay different than previous test runs. I also received the "...out of bounds: -1..." error on the messages tab of the tester. It was on the histogram part of the macd[], and the error seemed to start when it hit the weekend, even though I had it Filter.WEEKENDS.

Interestingly, the historical tester in my live account works fine.

Any help you can offer would be much appreciated!!

Author:  [profx_eu] [ Sun 03 Apr, 2011, 01:33 ]
Post subject:  API ver 2.6.37 has bugs... API 2.6,33 stable on LIVE account

I have got the same problem on the DEMOC and DEMO3 account!
With the indicators, but I got strage bar datas from history.getBar() too, compared to the chart on the tester, it must be wrong!

Please change back the API version for the contest to the stable .33 version that is working fine on my LIVE account!
Of course please inform all the participants in the contest that there is some bug with indicators and history getBar methods in the API version 2.6.37!

Please inform me if the bugs affect only the historical tester, and we can run the strategies without worrying bugs in the contest!
Thanks

Author:  [Frank] [ Sun 03 Apr, 2011, 18:32 ]
Post subject:  Trouble with Tester

Contest Support wrote:
Yes, the platform was updated. Can you please provide us with more exact details how do you get the exception and why the results are different?

We will have a more detailed look at the problem. Thanks.


Hi Support,
I wrote a simple Cross EMAs strategy to test the trouble with Historical Tester and I noted that the Tester
open wrong opposite positions. That is in other words, the strategy has

ConditionEntryLong = EMA10 > EMA50
ConditionExitLong = EMA10 < EMA50

ConditionEntryShort = EMA10 < EMA50
ConditionExitShort = EMA10 > EMA50

so when EMA10 is up to EMA50 there are Long conditions but the Tester open Short positions.
You can note this if you run the Tester in "Visual mode".

I attached the image of backtesting of last week, where you can easily see that EMA10 is up to EMA50 but the Tester
opened Short positions.
I even attached the strategy.


I don't know if the trouble is in indicators or in Tester.

Best regards,
Frank

Author:  Contest Support [ Mon 04 Apr, 2011, 08:24 ]
Post subject:  Re: General Discussion and Comments

Thanks for feedback.

Author:  [Tipota] [ Mon 04 Apr, 2011, 21:47 ]
Post subject:  Re: General Discussion and Comments

Hi Support,

I have the same ArrayIndexOutOfBoundsException with historical tester since last week.
Please try to run your SMAStrategy.java code provided on Wiki:

public void onTick(Instrument instrument, ITick tick) throws JFException {
...
long prevBar = history.getBar(instrument, selectedPeriod, OfferSide.BID, 1).getTime();
double[] filteredSma10 = indicators.sma(instrument, selectedPeriod, OfferSide.BID, appliedPrice, 10, indicatorFilter, 2, prevBar, 0);
...
}

It seems for some reason the previous bars are not formed!

Following modification works without errors
long prevBar = history.getBar(instrument, selectedPeriod, OfferSide.BID, 0).getTime();
however the indicator provides clearly different values that appear using same indicator on the the chart.

Thanks for investigating this problem... this issue make any backtesting impossible.

Author:  cactis [ Tue 05 Apr, 2011, 14:21 ]
Post subject:  meaning

What is a turnover?

Author:  Pastfinders [ Tue 05 Apr, 2011, 19:21 ]
Post subject:  April competition

Hi
Unsure why my competition strategy opened one position OK but is now refusing to open any further positions ?

Author:  [pipscity] [ Thu 07 Apr, 2011, 13:58 ]
Post subject:  Pb with Demo version

HI, i have been running my strategy remotely, this morning i launched the demo interface, it gave me a message (demo version is limited etC), but also the strategy i am running is not showing up anymore on the screen, and i cant run it anymore, only indicators seems to be allowed...

Author:  [linnux] [ Thu 07 Apr, 2011, 14:01 ]
Post subject:  Strategy Removed from my account

Hello support,
Could you please tell me what happened to my strategy, in the contest account, yesterday everything is ok, it opened 3 orders. Today it desapear from my account and i'm not able to put it again.
help is appreciated

Linnux

Author:  Guest [ Thu 07 Apr, 2011, 15:52 ]
Post subject:  Re: Strategy Removed from my account

linnux wrote:
Hello support,
Could you please tell me what happened to my strategy, in the contest account, yesterday everything is ok, it opened 3 orders. Today it desapear from my account and i'm not able to put it again.
help is appreciated

Linnux


The same thing happened to me!

  Page 14 of 17