Dukascopy
 
 
Wiki JStore Search Login

EURUSD was untradable long periods of time on Remote Server
 Post subject: EURUSD was untradable long periods of time on Remote Server Post rating: 0   New post Posted: Fri 25 Oct, 2013, 10:43 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Hi,

On 24.10.2013 I've noticed that EURUSD was untradable during some periods:
first time about 6 minutes (from 16:17:20 to 16:23:40)
and another time about 24 minutes (from 16:48:27 to 17:11:54)

What did cause a such weird behavior of EURUSD?

The code and its log are attached.

package jforex;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IInstrumentStatusMessage;
import com.dukascopy.api.IMessage;
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;
import com.dukascopy.api.util.DateUtils;
import java.io.PrintStream;
import java.util.EnumSet;

public class Tradability implements IStrategy {

    private static final Instrument INSTRUMENT = Instrument.EURUSD;
    private PrintStream out;
    private boolean tradable = false;

    @Override
    public void onStart(IContext context) throws JFException {
        out = context.getConsole().getOut();
        context.setSubscribedInstruments(EnumSet.of(INSTRUMENT), true);
    }

    @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 {
        if ((message.getType() == IMessage.Type.INSTRUMENT_STATUS) && (message instanceof IInstrumentStatusMessage)) {
            IInstrumentStatusMessage m = (IInstrumentStatusMessage) message;
            if ((m.getInstrument() == INSTRUMENT) && (m.isTradable() || tradable) && (!m.isTradable() || !tradable)) {
                out.println(String.format("%s Instrument %s %s tradable",
                                          DateUtils.format(m.getCreationTime()),
                                          m.getInstrument(),
                                          m.isTradable() ? "is" : "is NOT"));
                tradable = m.isTradable();
            }
        }
    }

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

    @Override
    public void onStop() throws JFException {
    }
}

Image


Attachments:
Tradability.java [1.96 KiB]
Downloaded 138 times
EURUSDtradability.png [65.73 KiB]
Downloaded 299 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.
 

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