TrueFXTickEvent: fix instrument name to match OANDA format
This commit is contained in:
@ -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.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user