Dukascopy
 
 
Wiki JStore Search Login

Contest Compliant Strategy Example [July]
 Post subject: Contest Compliant Strategy Example [July] Post rating: 0   New post Posted: Fri 11 Jun, 2010, 14:58 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Quote:

    Contest Rules (edition 11.06.2010, new amendments become effective starting from July)

  • Registration Rules:

    1. The JForex Strategy Contest (“Contest”) is held by Dukascopy Bank SA (“Dukascopy”) on DEMO accounts for JForex strategies on a regular monthly basis.
    2. For each respective month registration opens on the 1st and remains available until the 15th day included of that month. Participants may register for the next month’s Contest at any time.
    3. Only persons aged 18 or over are eligible to apply for a registration in the Contest.
    4. Registration is a mandatory requirement for participation. Before trading on the contest account, Participant needs to compile a strategy in the trading platform in order to generate a strategy ID. The strategy ID is a unique identification number which is assigned to every trade on the Contest account. The strategy ID will be automatically assigned to Participant when the first trade is made on the contest account. Any further modification of the script will result in change of strategy ID. Participants are not allowed to modify the code and trade with different strategy IDs on the same contest.
    5. Participant agrees to provide true information at registration. If Participant will become eligible for any prize, information provided upon registration will be used to initiate procedure for opening of a live account with Dukascopy in the name of Participant. In case of information being false, inaccurate or incomplete, Dukascopy may declare participation in Contest void at any time at its sole discretion.
    6. Among other, multiple registrations and/or use of proxy servers may result in Participant’s disqualification.

  • Trading Rules:

    1. Contest accounts are registered with an initial deposit of USD 100 000.
    2. Terms and conditions commonly applicable to trading via Dukascopy at the time of the Contest shall also apply to trading within the framework of the Contest (for information purposes only, as of March 1st 2010 these include: 32 currency pairs available for trading, account leverage 1:100, minimal size of one trade USD 1000, margin cut level of exposure 200%).
    3. Strategy must be compiled and used in the JForex platform only. Running the Strategy in any custom platforms or IDE is prohibited.
    4. Trades must be mainly conducted by the Strategy script. In general, manual intervening is not allowed. In exceptional cases, the contestant may use manual trades to close positions, but the ratio of manually closed trades must be less than 10% of the total turnover. Dukascopy reserves the right to require Participant's explanation of any manual intervention with Strategy's operation, and accept or reject such an explanation at its sole discretion.
    5. To run the Strategy, Participant must use his/her own computer during the Contest period. The strategy must be running at least 10 trading days of the month.
    6. Trading requirements to the positions are as follows:
    • The total amount of positions opened during the Contest must be at least 10.
    • The maximum amount of simultaneously opened positions is 1. Any further requests to open a new position will be rejected by the platform.
    • The maximum amount of profit on a single position should not exceed 50% of the balance of the previous day. If not, Dukascopy reserves the right to decrease the total balance of the account for the amount equal to the profit of the position.
    7. Multiple order resubmissions are strongly prohibited and will result in automatic disqualification. The trading script of the strategy must include the validation on free margin and amount of simultaneously opened positions.

    8. No “black boxes” (as commonly known in the industry) are allowed. Strategy’s trading algorithms must be fully scripted inside the JForex platform. Participants are not allowed to use external files (DLL, JAR, etc), and/or MT4 strategies with MT4-JForex Clients Bridge.
    9. The strategy’s parameters must be hardcoded inside the script. Annotation @Configurable is prohibited for use. In exceptional cases, the contestant may change the parameters upon receiving a preliminary consent by Dukascopy.
    10. At the end of the contest all open positions will be automatically liquidated.

  • Ranking and Awarding Rules:

    1. The winners will be determined at the end of each respective Contest period. 10 Participants with the largest positive balances in the overall rating table will be defined as award candidates.
    2. The winners must disclose the code of the strategy to Dukascopy (Suisse) SA for verification purposes no longer then 10 days after the end of the Contest. If the verification for strategy ID fails, the respective Participant may be disqualified from the Contest.
    3. The total prize pool of USD 15 000 is distributed among 10 winners of the contest in the following manner:
    • 1st place – “grand prize” of USD 5000
    • 2nd-3rd places – “golden prize” of USD 2500
    • 4th-6th places – “silver prize” of USD 1000
    • 7th-10th places – “bronze prize” of USD 500
    4. The winners may withdraw cash prize amounts from their respective live accounts after meeting the following minimum turnover requirements on these live accounts:
    • 1st place – 10 million USD
    • 2nd-3rd places – 5 million USD
    • 4th-6th places – 2 million USD
    • 7th-10th places – 1 million USD
    5. Cash prizes are credited to a live account in the name of Participant with Dukascopy. A Participant who is awarded with a prize is not allowed to demand crediting of the prize to any other account, including, among other, an account that is not in the name of this Participant.
    6. Each prize winner has a commitment to give consent to publication of his/her Strategy’s source code by Dukascopy. In case such consent is not given, respective Participants will have their prize value reduced by 50%. In case of 1st – 6th place winners the resulting prize amount will be credited to respective Participants’ live account with Dukascopy in a manner described above. In case of 7st – 10th place winners the resulting prize value will be counted towards the respective Participants’ bonus. If the total value of bonuses accumulated by the respective Participant exceeds 500 USD during one year the resulting amount may be credited to such Participant’s live account with Dukascopy in a manner, described above.
    7. In case of Participant’s refusal to participate in promotional events, interviews, public announcements in connection with Contest, Dukascopy has the right to disqualify such Participant and give the respective prize to another Participant.

    Dukascopy reserves the right to change the contest rules, requirements and awards without prior notice and at any time at its sole discretion. Dukascopy prevents the use of its JForex contest web pages for promotion of money management activities.

    Please note that any modification of the Strategy’s code during the contest will result in a change of the strategy ID – the unique identification number which is used by the JForex platform to label every trade on the contest account. Participants with multiple strategy IDs within one contest account will be disqualified, unless Dukascopy decides otherwise in its sole discretion.

    For feedback, questions and comments please send an email to jforex(at)dukascopy.com


 
 Post subject: Contest Compliant Strategy Example [July] Post rating: 0   New post Posted: Mon 21 Jun, 2010, 10:25 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
We are posting an example of a strategy which is fully compliant with rules. The strategy is based on 2 moving averages (with periods 7 and 14)! You can adjust the strategy and use it in the contest:

package jforex;

import java.util.List;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IConsole;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IEngine;
import com.dukascopy.api.IIndicators;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IOrder;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.OfferSide;
import com.dukascopy.api.Period;
import com.dukascopy.api.IEngine.OrderCommand;

public class MovingAverageExample implements IStrategy {

        // these are strategy interfaces which are used to execute trades, request indicators, print messages
        private IEngine engine;
        private IIndicators indicators;
        private IConsole console;

        // these are strategy parameters
        private Instrument myInstrument = Instrument.EURUSD;
        private Period myPeriod = Period.ONE_MIN;
        private int fastMAPeriod = 7;
        private int slowMAPeriod = 14;
        private boolean tradingAllowed;
        private double takeProfit = 10 / Math.pow(10, Instrument.EURUSD.getPipScale());
        private double stopLoss = 20 / Math.pow(10, Instrument.EURUSD.getPipScale());
        private double accountEquity;


        @Override
        public void onStart(IContext context) throws JFException {

                // we initialise interfaces in the onStart method
                engine = context.getEngine();
                indicators = context.getIndicators();
                console = context.getConsole();
        }

       
// we put the trading algorithms either in onBar or onTick methods. Once the bar is closed, the script will be run

        @Override
        public void onBar(Instrument instrument, Period period, IBar askBar,
                        IBar bidBar) throws JFException {

                // close the opened order if the profit is very close to 50% of equity, acc. rule 6.3
                 closeOrder();


                // in the line below we indicate that we are oging to trade on EURUSD and on 1 min chart. And we will trade only when the trade will be allowed
                if (myPeriod == period && myInstrument == instrument && tradingAllowed) {

                        double fastMA = indicators.sma(instrument, period, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, fastMAPeriod, 0);
                        double fastMAonPreviousBar = indicators.sma(instrument, period, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, fastMAPeriod, 1);
                        double slowMA = indicators.sma(instrument, period, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, slowMAPeriod, 0);
                        double slowMAonPreviousBar = indicators.sma(instrument, period, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, slowMAPeriod, 0);

                        // condition when we BUY
                        if (fastMAonPreviousBar < slowMAonPreviousBar && fastMA > slowMA) {

                                engine.submitOrder("BUY", instrument, OrderCommand.BUY, 0.1, 0, 5, bidBar.getClose() - stopLoss, bidBar.getClose() + takeProfit);

                                print("BUY signal!" + stopLoss + takeProfit);
                               
                        // condition when we SELL
                        } else if (fastMAonPreviousBar > slowMAonPreviousBar
                                        && fastMA < slowMA) {

                                engine.submitOrder("SELL", instrument, OrderCommand.SELL, 0.1, 0, 5, askBar.getClose() + stopLoss, askBar.getClose() - takeProfit);

                                print("SELL signal!");
                        }

                }

        }
       
        @Override
        public void onAccount(IAccount account) throws JFException {
               
                if (account.getUseOfLeverage() == 0) { tradingAllowed = true;
                } else tradingAllowed = false;

                accountEquity = account.getEquity();

        }

        @Override
        public void onMessage(IMessage message) throws JFException {

        }

        @Override
        public void onStop() throws JFException {

        }

        @Override
        public void onTick(Instrument instrument, ITick tick) throws JFException {

        }
       
        public void print(String string) {

                console.getOut().println(string);
               
        }

        public void closeOrder() throws JFException {
               
                List<IOrder> orderList = engine.getOrders(myInstrument);
                for (IOrder order: orderList) {
                        if (order.getState()== IOrder.State.FILLED) {
                                if (order.getProfitLossInUSD()> accountEquity*0.45) {
                                        order.close();
                                }
                        }
                       
                }
               
        }

}


Please test it before using on contest account!


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Fri 25 Jun, 2010, 12:51 

User rating: 0
Joined: Fri 25 Jun, 2010, 12:48
Posts: 12
About the point 8 in Trading Rules :
What about using Encog library for Neural Trading ? Not allowed ?


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Mon 28 Jun, 2010, 11:01 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Unfortunately, no! It's not allowed!


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Tue 29 Jun, 2010, 10:41 
User avatar

User rating: 0
Joined: Wed 19 Nov, 2008, 20:45
Posts: 10
I like new rules, looks like my quantum strategy that I was running in April.

I have a question, can I add to position and merge if I want to? Or should I close the one I have and open another?

Kind regards, Yaroslav.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Tue 29 Jun, 2010, 12:09 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
"The maximum amount of simultaneously opened positions is 1. [...]"

A merge requires at least 2 positions. This is now prohibited.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Sat 03 Jul, 2010, 23:04 

User rating: 0
Joined: Sat 03 Jul, 2010, 00:08
Posts: 8
i don't understand this statement

7. Multiple order resubmissions are strongly prohibited and will result in automatic disqualification. The trading script of the strategy must include the validation on free margin and amount of simultaneously opened positions.


Especially (Multiple order resubmissions )
what does it mean?


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Mon 05 Jul, 2010, 13:20 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Well, it does not make sense to send a new order on every tick if you already have a position in the platform. Another example, if you're trying to send an invalid order on every new tick.

Multiple submission means that you're sending the same instruction again and again without waiting for a response from the server.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Mon 05 Jul, 2010, 13:22 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
In some cases, a mistake in the code may also result in multiple order submission. If you will encounter this situation, you need to carefully follow your strategy and upon getting a permission from Dukascopy you can change the code and recompile the strategy.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Wed 07 Jul, 2010, 17:46 

User rating: 0
Joined: Sat 03 Jul, 2010, 00:08
Posts: 8
Contest Support wrote:
Quote:
    The maximum amount of profit on a single position should not exceed 50% of the balance of the previous day. If not, Dukascopy reserves the right to decrease the total balance of the account for the amount equal to the profit of the position.

[list=]
sorry for my english

another question please :
am i disqualified if this case happened
if i bought eur\usd at Monday ( when my balance was 100000) and i closed the position at Friday with profit exceed 50% ( the balance =200000 for example )

[/list]


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Wed 07 Jul, 2010, 17:56 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
No, you're not. But we will either ignore your profit or limit the profit up to 50% of the balance.

As you're trading with a robot, you can easily check if the position already has a big profit. It's better to control it right in the script. We have already posted some examples on the forum. Please check them to learn how you can do that.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Wed 07 Jul, 2010, 18:00 

User rating: 0
Joined: Wed 07 Jul, 2010, 17:54
Posts: 10
Hi,

I just wanted to ask, will the strategy be disqualified if it closes most of its trades by the function 'close on exit'? I mean that some trades are closed by SL/TP, but most of them are initiated by the code which closes the open position when the strategy is stoped. Is it allowed?

Thank you.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Wed 07 Jul, 2010, 18:44 

User rating: 0
Joined: Sat 03 Jul, 2010, 00:08
Posts: 8
Contest Support wrote:
No, you're not. But we will either ignore your profit or limit the profit up to 50% of the balance.

As you're trading with a robot, you can easily check if the position already has a big profit. It's better to control it right in the script. We have already posted some examples on the forum. Please check them to learn how you can do that.



i mean maximum profit must not to exceed 50 % even

if the position has been opened for 5- 6 days !!!


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Thu 08 Jul, 2010, 08:28 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
cebesaru wrote:
Hi,

I just wanted to ask, will the strategy be disqualified if it closes most of its trades by the function 'close on exit'? I mean that some trades are closed by SL/TP, but most of them are initiated by the code which closes the open position when the strategy is stoped. Is it allowed?

Thank you.



No, the OnStop method must not contain any trading operations.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Thu 08 Jul, 2010, 08:29 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
trader wrote:
i mean maximum profit must not to exceed 50 % even

if the position has been opened for 5- 6 days !!!


It does not matter for how long you keep the position, try to keep the profit of every position below 50% of balance.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Thu 08 Jul, 2010, 09:37 

User rating: 0
Joined: Tue 20 Apr, 2010, 09:13
Posts: 7
Contest Support wrote:
the OnStop method must not contain any trading operations.


Hmm... In April you recommended to use OnStop method for closing positions. The new rules do not contain any prohibition on using OnStop.
?


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Thu 08 Jul, 2010, 13:33 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Our rules say that this is a contest of Automated strategies but not manual ones. By using any trading operations in the onStop method you explicitly indicate that you're closing the trade with manual intervention. It's allowed to have some manual trades but the total amount must not exceed 10% of total turnover.

If you didn't know about this, then I would suggest you to submit a new registration in the contest. We will remove you previous registration in the contest.

We will add more description in the rules for the next month to make it clear.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Thu 15 Jul, 2010, 17:37 

User rating: -
Can my sister participate in the contest one strategy modification of my strategy???
Is is not multiple registration?

And we want to use the same VPS...

Thanks


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Mon 19 Jul, 2010, 15:17 
User avatar

User rating: 8
Joined: Wed 21 Apr, 2010, 10:42
Posts: 1167
Brother wrote:
Can my sister participate in the contest one strategy modification of my strategy???
Is is not multiple registration?

And we want to use the same VPS...

Thanks


Yes, she has to register the same way you did.

As discussed previously, similar strategies are not prohibited.

It is not allowed to use the same VPS because the IP address is not unique.


 
 Post subject: Re: Contest Rules [July] Post rating: 0   New post Posted: Fri 23 Jul, 2010, 15:55 

User rating: -
Okey

But I have some problem
Your reply date was on Mon 19 Jul, 2010, 15:17
I had started the strategy 2 on jul 15. (contest rules) and at the contest rules page not contain anything about a unique IP just to have unique ID of the strategy.
Now we have the same ip address 1 computer on a single ADSL line and 1 router.
Strategy 1. HumpY4X
Strategy 2. Syster

What can we do to not disqualifi the two strats???

Contest Support wrote:
Brother wrote:
Can my sister participate in the contest one strategy modification of my strategy???
Is is not multiple registration?

And we want to use the same VPS...

Thanks


Yes, she has to register the same way you did.

As discussed previously, similar strategies are not prohibited.

It is not allowed to use the same VPS because the IP address is not unique.


 

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