public void handle(FXEventInfo EI, FXEventManager EM) { FXRateEventInfo REI = (FXRateEventInfo) EI; this.lastTick = REI.getTick(); // com.oanda.fxtrade.api.FXTick currTick = REI.getTick(); // if (lastTick == null) // Init the tick value if no previous one is available // { // lastTick = REI.getTick(); // return; // } // else //Compare the current and previous tick values // { // if (currTick.getBid() > lastTick.getBid()) // System.out.println(REI.getPair() + " has gone up"); // else if (currTick.getBid() < lastTick.getBid()) // System.out.println(REI.getPair() + " has gone down"); // else // System.out.println(REI.getPair() + " hasn't changed"); // lastTick = currTick; // } }
public void handle(FXEventInfo EI, FXEventManager EM) { // Just print the tick FXRateEventInfo REI = (FXRateEventInfo) EI; System.out.println(REI.getPair() + ":" + REI.getTick()); }