Hi Dukascopy team
I have a strategy, which calls a custom indicator (BBandsStopIndicator). This strategy runs perfectly on my local computer. However, when I tried to run it on the remote server, the status shows "running" but I have the impression that strategy is frozen. Nothing happens.
According to the support team to use custom indicator it has to properly registered in the onStart Method.
Please can you register the indicator BBandsStopIndicator (
viewtopic.php?f=6&t=42373) in my strategy:
package jforex.strategies.indicators;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import com.dukascopy.api.*;
import com.dukascopy.api.IEngine.OrderCommand;
import com.dukascopy.api.IIndicators.AppliedPrice;
import com.dukascopy.api.indicators.IIndicator;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class NikBBandsStopRemote implements IStrategy {
private IEngine engine;
private IConsole console;
private IHistory history;
private IIndicators indicators;
private int counter = 0;
private IOrder order;
@Configurable("Instrument")
public Instrument instrument = Instrument.EURUSD;
@Configurable("Period")
public Period selectedPeriod = Period.DAILY;
@Configurable("Offer side")
public OfferSide offerSide = OfferSide.BID;
@Configurable("Slippage")
public double slippage = 0;
@Configurable("Amount")
public double amount = 0.02;
@Configurable("Partial Take profit (pips)")
public double takeProfitPips = 3;
@Configurable("Partial Take profit amount")
public double takeProfitAmount = 0.01;
@Configurable("Stop loss in pips")
public int stopLossPips = 0;
@Configurable("Applied price")
public AppliedPrice appliedPrice = AppliedPrice.CLOSE;
@Configurable("BBands period")
public int bBandsPeriod = 60;
@Configurable("BBands deviation")
public int deviation = 2;
@Configurable("BBands money risk")
public double moneyRisk = 0.8;
@Configurable("Trade long")
public boolean tradeLong = true;
@Configurable("Trade short")
public boolean tradeShort = true;
@Configurable("Max bar height")
public double maxBarHeight = 60;
@Configurable("Start hour")
public int startHour = 00;
@Configurable("minute")
public int startMin = 00;
@Configurable("End hour")
public int endHour = 24;
@Configurable("minute")
public int endMin = 00;
public long startTime;
public long endTime;
@Override
public void onStart(IContext context) throws JFException {
this.console = context.getConsole();
this.indicators = context.getIndicators();
this.history = context.getHistory();
this.engine = context.getEngine();
}
@Override
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
if (period != this.selectedPeriod || instrument != this.instrument) {
return;
}
Thank you
Nikolay