Created
April 28, 2017 23:43
-
-
Save jshelton31/e85ed06bb0ac5c345bfee69756697dca to your computer and use it in GitHub Desktop.
Interactive Brokers Common Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void updatePortfolio(Contract contract, double position, double marketPrice, double marketValue, double averageCost, double unrealizedPNL, double realizedPNL, String accountName) { | |
DecimalFormat df = new DecimalFormat("0.0000"); // TODO get digit according | |
df.setDecimalSeparatorAlwaysShown(true); | |
String formatedPosition = df.format(position); | |
formatedPosition = formatedPosition.replace(",", "."); | |
System.out.println("contract = " + contract.localSymbol() + ", contract.description() = " + contract.description() + ", unrealizedPNL = " + unrealizedPNL + ", formatedPosition = " + formatedPosition); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment