hi, that is exactely when the problem appears, when I try to attach it; here is the converted indicator:
package jforex.converted; import java.awt.Color; import com.dukascopy.api.*; import com.dukascopy.connector.engine.*; import com.dukascopy.connector.engine.Properties; import com.dukascopy.connector.engine.IndicatorBuffer; @RequiresFullAccess @Library("C:/Users/flo/Desktop/libs/MQL4Connector-2.6.60.2.jar") public class StochasticWallabys2 extends MQL4ConnectorStrategy {
protected void initProperties() { if (properties == null) { properties = new Properties(); } properties.setProperty("indicator_width4","2"); properties.setProperty("indicator_buffers","4"); properties.setProperty("indicator_minimum","0"); properties.setProperty("link","http:"); properties.setProperty("indicator_separate_window","true"); properties.setProperty("indicator_color2","Silver"); properties.setProperty("copyright","Copyright 2010 Toshiyuki Tega (Softgate Limited)"); properties.setProperty("indicator_color1","Silver"); properties.setProperty("indicator_maximum","100"); properties.setProperty("indicator_color3","Silver"); properties.setProperty("indicator_color4","Red"); properties.setProperty("indicator_style4","STYLE_SOLID"); properties.setProperty("indicator_style3","STYLE_SOLID"); properties.setProperty("indicator_style2","STYLE_SOLID"); properties.setProperty("indicator_style1","STYLE_SOLID"); } protected int indicator_width4 = 2; protected Color indicator_color2 = Silver; protected Color indicator_color1 = Silver; protected Color indicator_color3 = Silver; protected Color indicator_color4 = Red; @Configurable("") public int KPeriod=toInt(7); @Configurable("") public int DPeriod=toInt(3); @Configurable("") public int Slowing=toInt(3); @Configurable("") public int Timeframe1=toInt(1); @Configurable("") public int Timeframe2=toInt(5); @Configurable("") public int Timeframe3=toInt(15); @Configurable("") public int Type=toInt(0); @IndicatorBuffer ("") public double[] Wallabys = new double[0]; @IndicatorBuffer ("") public double[] Stoch1 = new double[0]; @IndicatorBuffer ("") public double[] Stoch2 = new double[0]; @IndicatorBuffer ("") public double[] Stoch3 = new double[0]; public int init() throws JFException { SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,Stoch1); SetIndexLabel(0,"Stochastic 1"); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Stoch2); SetIndexLabel(1,"Stochastic 2"); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,Stoch3); SetIndexLabel(2,"Stochastic 3"); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,Wallabys); SetIndexLabel(3,"Wallabys"); IndicatorShortName("Stochastic Wallabys ("+KPeriod+","+DPeriod+","+Slowing+","+Type+","+Timeframe1+","+Timeframe2+","+Timeframe3+")"); if(true)return toInt(0);return 0; } public int deinit() throws JFException { if(true)return toInt(0);return 0; } public int start() throws JFException { int countedBars = 0; int barsNeeded = 0; int i=toInt(0); int shift1 = 0; double stoch1 = 0.0; int shift2 = 0; double stoch2 = 0.0; int shift3 = 0; double stoch3 = 0.0; countedBars = toInt(IndicatorCounted()); barsNeeded = toInt(Bars-countedBars); for(i=(int)0;i<barsNeeded;i++){ shift1 = toInt(iBarShift(null,Timeframe1,iTime(null,0,i),false)); stoch1 = toDouble(iStochastic(null,Timeframe1,KPeriod,DPeriod,Slowing,MODE_SMA,Type,MODE_MAIN,shift1)); shift2 = toInt(iBarShift(null,Timeframe2,iTime(null,0,i),false)); stoch2 = toDouble(iStochastic(null,Timeframe2,KPeriod,DPeriod,Slowing,MODE_SMA,Type,MODE_MAIN,shift2)); shift3 = toInt(iBarShift(null,Timeframe3,iTime(null,0,i),false)); stoch3 = toDouble(iStochastic(null,Timeframe3,KPeriod,DPeriod,Slowing,MODE_SMA,Type,MODE_MAIN,shift3)); Stoch1[toInt(i)]=toDouble(stoch1); Stoch2[toInt(i)]=toDouble(stoch2); Stoch3[toInt(i)]=toDouble(stoch3); Wallabys[toInt(i)]=toDouble((stoch1+stoch2+stoch3)/3); } if(true)return toInt(0);return 0; }
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException{}
then I get the message compiled ok:
2012-05-17 12:36:20 Compilation successful. Strategy ID: 018518F527C043D1DF3CF4C45EEFA8E4
when I try add to chart it won t work
|