Dukascopy
 
 
Wiki JStore Search Login

General Discussion and Comments
 Post subject: jpforexsrategy is this possible sir can i know how to make a strategy in jpforex platform Post rating: 0   New post Posted: Thu 03 Mar, 2011, 16:23 

User rating: -
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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Fri 04 Mar, 2011, 12:20 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Yes, you can use published strategies as examples. Otherwise, if you are interested in manual trading, please register to Traders contest.


 
 Post subject: Re: OverTheWeekend leverage control Post rating: 0   New post Posted: Sat 05 Mar, 2011, 20:38 

User rating: 0
Joined: Sat 26 Feb, 2011, 19:02
Posts: 1
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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Mon 07 Mar, 2011, 09:12 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
This field is static, so you can retrieve from the class name or from the instance object. The result is the same.


 
 Post subject: Configurable Post rating: 0   New post Posted: Fri 11 Mar, 2011, 10:09 

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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Tue 15 Mar, 2011, 12:31 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
sorry, but' it can't be used.


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Wed 30 Mar, 2011, 14:40 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Fri 01 Apr, 2011, 09:12 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
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.


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Fri 01 Apr, 2011, 13:41 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Fri 01 Apr, 2011, 14:07 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
thank you for the strategy, Frank. We will start investigation on this problem. I will keep you posted.


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Sat 02 Apr, 2011, 05:38 

User rating: 0
Joined: Wed 17 Nov, 2010, 20:55
Posts: 3
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!!


 
 Post subject: API ver 2.6.37 has bugs... API 2.6,33 stable on LIVE account Post rating: 0   New post Posted: Sun 03 Apr, 2011, 01:33 
User avatar

User rating: 0
Joined: Sun 11 Jul, 2010, 13:46
Posts: 9
Location: Hungary
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


 
 Post subject: Trouble with Tester Post rating: 0   New post Posted: Sun 03 Apr, 2011, 18:32 

User rating: 0
Joined: Thu 02 Sep, 2010, 05:01
Posts: 49
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


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Mon 04 Apr, 2011, 08:24 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Thanks for feedback.


 
 Post subject: Re: General Discussion and Comments Post rating: 0   New post Posted: Mon 04 Apr, 2011, 21:47 

User rating: 0
Joined: Mon 19 Apr, 2010, 13:51
Posts: 6
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.


 
 Post subject: meaning Post rating: 0   New post Posted: Tue 05 Apr, 2011, 14:21 

User rating: -
What is a turnover?


 
 Post subject: April competition Post rating: 0   New post Posted: Tue 05 Apr, 2011, 19:21 

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


 
 Post subject: Pb with Demo version Post rating: 0   New post Posted: Thu 07 Apr, 2011, 13:58 

User rating: 0
Joined: Fri 15 Oct, 2010, 23:58
Posts: 2
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...


 
 Post subject: Strategy Removed from my account Post rating: 0   New post Posted: Thu 07 Apr, 2011, 14:01 

User rating: 0
Joined: Fri 03 Sep, 2010, 10:49
Posts: 11
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


 
 Post subject: Re: Strategy Removed from my account Post rating: 0   New post Posted: Thu 07 Apr, 2011, 15:52 

User rating: -
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!


 

Jump to:  

cron
  © 1998-2011 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