Hi again Dukascopy Team,
I managed to access information about opposite wick using reflection. This dirty hack though and it does not work in remote mode as it requires @RequiresFullAccess annotation, which use is not allowed in remote mode.
Is there better solution to access opposite wick?
import java.lang.reflect.Field;
import com.dukascopy.api.JFException;
import com.dukascopy.api.feed.IRenkoBar;
public class Wicks {
private Double wick, oppositeWick;
public Wicks(IRenkoBar renkoBar, boolean isFullAccessGranted) throws JFException {
try {
if (isFullAccessGranted) {
Field[] fs = renkoBar.getClass().getDeclaredFields();
int counter = 0;
for (Field f : fs) {
f.setAccessible(true);
if (counter == 1) {
wick = (Double) f.get(renkoBar);
}
if (counter == 2) {
oppositeWick = (Double) f.get(renkoBar);
}
counter++;
}
} else {
wick = renkoBar.getWickPrice();
}
} catch (Exception e) {
throw new JFException(e);
}
}
public Double getWick() {
return wick;
}
public Double getOppositeWick() {
return oppositeWick;
}
}
Best regards,
Greg