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.

Re: Remote Running Error
 Post subject: Re: Remote Running Error Post rating: 0   New post Posted: Mon 11 Jan, 2016, 18:27 
User avatar

User rating: 0
Joined: Fri 06 Mar, 2015, 11:56
Posts: 19
Location: ChinaChina
Dear supporter:

Below is Remote Running Error.
I don't know what happened at 11.01.2016 15:17:14.
What's the cause?
How can I fix it?
Or could I ignore it with no effect on the strategy running?(The strategy is not stopped.)
THX


Image
Image


Attachments:
360截图20160112011437640.jpg [102.72 KiB]
Downloaded 140 times
360截图20160112012121680.jpg [107.18 KiB]
Downloaded 142 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: Remote Running Error Post rating: 0   New post Posted: Tue 12 Jan, 2016, 08:44 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide sample strategy that would reproduce this error.


 
 Post subject: Re: Remote Running Error Post rating: 0   New post Posted: Tue 12 Jan, 2016, 10:08 
User avatar

User rating: 0
Joined: Fri 06 Mar, 2015, 11:56
Posts: 19
Location: ChinaChina
public class ForexStrategies implements IStrategy {
private InnerStrategy AUDUSD_H1;
private InnerStrategy EURJPY_H1;
private InnerStrategy EURUSD_H1;
private InnerStrategy GBPUSD_H1;
private InnerStrategy USDCAD_H1;
private InnerStrategy USDJPY_H1;

public void onStart(IContext context) throws JFException {
AUDUSD_H1 = new InnerStrategy();
AUDUSD_H1.myInstrument = Instrument.AUDUSD;
AUDUSD_H1.myLabel = "AUDUSD";

EURJPY_H1 = new InnerStrategy();
EURJPY_H1.myInstrument = Instrument.EURJPY;
EURJPY_H1.myLabel = "EURJPY";

EURUSD_H1 = new InnerStrategy();
EURUSD_H1.myInstrument = Instrument.EURUSD;
EURUSD_H1.myLabel = "EURUSD";

GBPUSD_H1 = new InnerStrategy();
GBPUSD_H1.myInstrument = Instrument.GBPUSD;
GBPUSD_H1.myLabel = "GBPUSD";

USDCAD_H1 = new InnerStrategy();
USDCAD_H1.myInstrument = Instrument.USDCAD;
USDCAD_H1.myLabel = "USDCAD";

USDJPY_H1 = new InnerStrategy();
USDJPY_H1.myInstrument = Instrument.USDJPY;
USDJPY_H1.myLabel = "USDJPY";

AUDUSD_H1.onStart(context);
EURJPY_H1.onStart(context);
EURUSD_H1.onStart(context);
GBPUSD_H1.onStart(context);
USDCAD_H1.onStart(context);
USDJPY_H1.onStart(context);
}

public void onTick(Instrument instrument, ITick tick) throws JFException {
AUDUSD_H1.onTick(instrument, tick);
EURJPY_H1.onTick(instrument, tick);
EURUSD_H1.onTick(instrument, tick);
GBPUSD_H1.onTick(instrument, tick);
USDCAD_H1.onTick(instrument, tick);
USDJPY_H1.onTick(instrument, tick);
}

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
AUDUSD_H1.onBar(instrument, period, askBar, bidBar);
EURJPY_H1.onBar(instrument, period, askBar, bidBar);
EURUSD_H1.onBar(instrument, period, askBar, bidBar);
GBPUSD_H1.onBar(instrument, period, askBar, bidBar);
USDCAD_H1.onBar(instrument, period, askBar, bidBar);
USDJPY_H1.onBar(instrument, period, askBar, bidBar);
}

public void onMessage(IMessage message) throws JFException {
AUDUSD_H1.onMessage(message);
EURJPY_H1.onMessage(message);
EURUSD_H1.onMessage(message);
GBPUSD_H1.onMessage(message);
USDCAD_H1.onMessage(message);
USDJPY_H1.onMessage(message);
}

public void onAccount(IAccount account) throws JFException {
AUDUSD_H1.onAccount(account);
EURJPY_H1.onAccount(account);
EURUSD_H1.onAccount(account);
GBPUSD_H1.onAccount(account);
USDCAD_H1.onAccount(account);
USDJPY_H1.onAccount(account);
}

public void onStop() throws JFException {
AUDUSD_H1.onStop();
EURJPY_H1.onStop();
EURUSD_H1.onStop();
GBPUSD_H1.onStop();
USDCAD_H1.onStop();
USDJPY_H1.onStop();
}
}

class InnerStrategy implements IStrategy {
private IAccount account;
private IBar bar;
private IChart chart;
private IConsole console;
private IContext context;
private IEngine engine;
private IHistory history;
private IHorizontalLineChartObject hline;
private IIndicators indicators;
private IUserInterface userInterface;
private Calendar calendar;

@Configurable("myInstrument")
public Instrument myInstrument = Instrument.AUDUSD;
@Configurable("myLabel")
public String myLabel = "AUDUSD";

public final Period myPeriod = Period.ONE_HOUR;
public final double myAmount = 0.1;

//---Indicatiors
public final OfferSide mySide = OfferSide.BID;
public final MaType myMaType = MaType.EMA;
public final AppliedPrice myPrice = AppliedPrice.CLOSE;
public final int bbandPeriod = 20;
public final double nbDevUp = 2.0;
public final double nbDevDn = 2.0;
public final int fastPeriod = 12;
public final int slowPeriod = 26;
public final int signalPeriod = 2;
public final double fastpr = 2.0 / (1 + fastPeriod);
public final double slowpr = 2.0 / (1 + slowPeriod);

//---Constants
public final int sleepTime = 2000;

//---Viarables
public long lastBarTime;
public long lastTickTime;

//---Statics
public static long frTime1;
public static long toTime1;
public static long frTime2;
public static long toTime2;
public static long frTime3;
public static long toTime3;
public static long filledBarTime;
public static boolean isCloseOutFlag;

public void onTick(Instrument instrument, ITick tick) throws JFException {
account = context.getAccount();
history = context.getHistory();

double pip = myInstrument.getPipValue();
double mypip = 0.1 * pip;
double commission = 1.0 * pip;
double myStopLoss = 50.0 * pip;
double myTakeProfit = 50.0 * pip;
double slippage = 0.3;

double bid = history.getLastTick(myInstrument).getBid();
double ask = history.getLastTick(myInstrument).getAsk();
double size = engine.getOrders(myInstrument).size();
double close0 = history.getBar(myInstrument,myPeriod,mySide,0).getClose();

lastBarTime = history.getBar(myInstrument,myPeriod,mySide,0).getTime();
lastTickTime = history.getTimeOfLastTick(myInstrument);
......
......
......
......
......
......

Above is about onTick getting historial data. Is it enough?
THX!


 
The Best Answer  Post subject: Re: Remote Running Error Post rating: 0   New post Posted: Wed 13 Jan, 2016, 10:53 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We were unable to reproduce this error.


 

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