diff --git a/src/main/java/TrueFXTickEvent.java b/src/main/java/TrueFXTickEvent.java index eafed06..f49ecd3 100644 --- a/src/main/java/TrueFXTickEvent.java +++ b/src/main/java/TrueFXTickEvent.java @@ -48,7 +48,7 @@ public class TrueFXTickEvent extends TickEvent { * @param instrument the instrument to set */ public void setInstrument(String instrument) { - this.instrument = instrument; + this.instrument = fixName(instrument); } /** @@ -89,6 +89,14 @@ public class TrueFXTickEvent extends TickEvent { return getMid(ask, bid); } + /** + * Convert from "EUR/USD" format to "EUR_USD" to match what OANDA + * uses. + */ + private String fixName(String n) { + return n.replace('/', '_'); + } + /** * Return a human readable representation of this event. */