TrueFXTickEvent: fix instrument name to match OANDA format

This commit is contained in:
2018-09-06 15:58:12 -07:00
parent 594ac82c06
commit f9dd57c0e5

View File

@ -48,7 +48,7 @@ public class TrueFXTickEvent extends TickEvent {
* @param instrument the instrument to set * @param instrument the instrument to set
*/ */
public void setInstrument(String instrument) { 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); 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. * Return a human readable representation of this event.
*/ */