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.

MIT order
 Post subject: MIT order Post rating: 0   New post Posted: Thu 13 Mar, 2014, 20:09 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Will IEngine.OrderCommand.BUYLIMIT order with Double.isNaN(slippage) == true be considered as Market if Touch Order (MIT) ?


 
 Post subject: Re: MIT order Post rating: 0   New post Posted: Mon 24 Mar, 2014, 09:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
In that case it works as if it were MIT.


 
 Post subject: Re: MIT order Post rating: 0   New post Posted: Mon 24 Mar, 2014, 18:48 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
API Support wrote:
In that case it works as if it were MIT.
On the chart a such order is labeled "### ENTRY MIT x.xxxxx".
But in the orders pane Type of a such order is "STOP" instead of "MIT".

Would you like to fix this issue?


 
 Post subject: Re: MIT order Post rating: 0   New post Posted: Wed 26 Mar, 2014, 10:45 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
hebasto wrote:
On the chart a such order is labeled "### ENTRY MIT x.xxxxx".
For us it shows as ENTRY ASK, see:
package jforex.orders;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IEngine;
import com.dukascopy.api.IHistory;
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.Period;

public class BuyStopNanSlippage implements IStrategy {

    public void onStart(IContext context) throws JFException {
         IEngine engine = context.getEngine(); 
         IHistory history = context.getHistory();
         Instrument instrument = Instrument.NZDUSD;
         context.setSubscribedInstruments(java.util.Collections.singleton(instrument), true);
         
         ITick lastTick = history.getLastTick(instrument);
         double price = lastTick.getAsk() + instrument.getPipValue();// * 0.1;
         IOrder order = engine.submitOrder("BuyStopOrder"+System.currentTimeMillis(), instrument, IEngine.OrderCommand.BUYSTOP, 500, price, Double.NaN);
     }

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

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

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

    @Override
    public void onAccount(IAccount account) throws JFException {
    }

    @Override
    public void onStop() throws JFException {
    }

}
Please provide a strategy which reproduces what you have described.


 
 Post subject: Re: MIT order Post rating: 0   New post Posted: Wed 26 Mar, 2014, 13:39 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
See my first post.
You use IEngine.OrderCommand.BUYSTOP, but this topic is about IEngine.OrderCommand.BUYLIMIT.


 
 Post subject: Re: MIT order Post rating: 0   New post Posted: Mon 31 Mar, 2014, 08:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We managed to replicate this. The issue has been registered.


 

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