Dukascopy
 
 
Wiki JStore Search Login

Convert "Profit/Loss in pips" into currency value
 Post subject: Convert "Profit/Loss in pips" into currency value Post rating: 0   New post Posted: Mon 25 Jun, 2012, 17:06 

User rating: 0
Joined: Mon 25 Jun, 2012, 15:55
Posts: 13
Hello Dukascopy-Support


how can I convert the "Profit/Loss in pips" of a position into a currency value?
I need that for my money management.


Thank you

Jimmy Knoppers


 
The Best Answer  Post subject: Re: Convert "Profit/Loss in pips" into currency value Post rating: 0   New post Posted: Mon 25 Jun, 2012, 17:31 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi jimmy:

you can use this example of one of my articles:


if (message.getTye == IMessage.Type.ORDER_CLOSE_OK) {
    // suposing you have this boolean variable to check if strategy can submit any order
    canTrade = true;
    myOrder = message.getOrder();
    // outputs to console tab the value on our currency of profit/loss
    myConsole.getOut().println("---------------------------------------------------");
    myConsole.getOut().println("Order closed:" + myOrder.getLabel());
    myConsole.getOut().println("---------------------------------------------------");
    myConsole.getOut().println("Profit or Loss value:" + myOrder.getProfitLossInAccountCurrency());
    myConsole.getOut().println(" Profit or Loss in Pips:" + myOrder.ProfitLossInPips());
}


I hope that helps

Trade well and good luck

JL


 
 Post subject: Re: Convert "Profit/Loss in pips" into currency value Post rating: 0   New post Posted: Mon 25 Jun, 2012, 18:34 

User rating: 0
Joined: Mon 25 Jun, 2012, 15:55
Posts: 13
Hi jlongo,


it worked!! :) Thank you very much !!

Jimmy Knoppers


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com