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.

Fake Take Profit Order
 Post subject: Fake Take Profit Order Post rating: 0   New post Posted: Wed 06 Nov, 2013, 20:49 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
There is a simple question:
What the line in my code does produce a take profit order?

My code:
package jforex;

import com.dukascopy.api.*;
import java.util.EnumSet;

public class FakeTakeProfit implements IStrategy {

    public void onStart(IContext context) throws JFException {
        Instrument instrument = Instrument.AUDCAD;
        context.setSubscribedInstruments(EnumSet.of(instrument), true);
        context.getEngine().submitOrder("label", instrument, IEngine.OrderCommand.BUY, 0.001).waitForUpdate(IOrder.State.FILLED);
        context.stop();
    }

    public void onAccount(IAccount account) throws JFException {}

    public void onMessage(IMessage message) throws JFException {}

    public void onStop() throws JFException {}

    public void onTick(Instrument instrument, ITick tick) throws JFException {}
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
}

Messages Tab:
19:39:06 Order ACCEPTED: #219439229 TAKE PROFIT SELL 0.001 mil. AUD/CAD @ LIMIT 0.99298 IF BID => 0.99298 - Position #56024770
19:39:06 Strategy "FakeTakeProfit" is stopped at 2013-11-06 19:39:06.554 GMT on the local computer with no parameters. Reason: Stopped by Engine
19:39:06 Stopping "FakeTakeProfit" strategy at 2013-11-06 19:39:06.549 GMT on the local computer
19:39:06 Order FILLED at 0.99258 CAD (#219439227 BUY 0.001 mil. AUD/CAD @ MKT MAX SLIPPAGE 0.0005)  - Position #56024770
19:39:06 Order ACCEPTED: #219439227 BUY 0.001 mil. AUD/CAD @ MKT MAX SLIPPAGE 0.0005 - Position #56024770
19:39:06 Order BUY 1000 AUD/CAD @ MKT  is sent at 2013-11-06 19:39:06.353 GMT by the strategy "FakeTakeProfit": from the local computer
19:39:06 Strategy "FakeTakeProfit" Strategy ID: E114B5919ABA7F0DD5254070C13E6F33 is started at 2013-11-06 19:39:06.327 GMT on the local computer with no parameters
19:39:06 Starting "FakeTakeProfit" strategy at 2013-11-06 19:39:06.247 GMT on the local computer
DEMO account, ver. 2.28.4
Thank you all


Attachments:
File comment: my code
FakeTakeProfit.java [847 Bytes]
Downloaded 61 times
File comment: screenshot of Orders tab after running code
FakeTakeProfitOrder.png [100.64 KiB]
Downloaded 200 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: Fake Take Profit Order Post rating: 0   New post Posted: Mon 25 Nov, 2013, 17:00 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We were not able to replicate this. Does the issue still persist?


 
 Post subject: Re: Fake Take Profit Order Post rating: 0   New post Posted: Mon 25 Nov, 2013, 18:48 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
DEMO 2.29.2: the issue is gone.
Thank you.


 

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