Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Convert Pips To Currency Value
 Post subject: Convert Pips To Currency Value Post rating: 0   New post Posted: Mon 03 Jan, 2011, 09:53 
User avatar

User rating: 0
Joined: Tue 07 Dec, 2010, 10:51
Posts: 39
Hello all,

Was wondering if someone can help me with this little problem, I'm trying to convert the difference between two prices into a currency value (currency of the account). So first you calculate the pips, and then convert the pips to a dollar value. I have tried the code below but it does not seem to work:
pipvalue = instrument.getPipValue();
pipscale = instrument.getPipScale();

CurrencyValue = ((price1 - price2)/pipscale)*pipvalue *UseLots;


UseLots is the lots that is specified to trade with and price1 and price 2 the different instrument values.

Any help will be appreciated!


 
 Post subject: Re: Convert Pips To Currency Value Post rating: 0   New post Posted: Thu 06 Jan, 2011, 10:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please consider the following JForex Wiki page: https://www.dukascopy.com/wiki/index.php ... t_currency


 
 Post subject: Re: Convert Pips To Currency Value Post rating: 0   New post Posted: Fri 11 Mar, 2011, 13:15 

User rating: 0
Joined: Thu 10 Mar, 2011, 16:36
Posts: 3
Hello

For my money management to calculate the lotsize I need the value of a pip in account currency. The example at the wiki doesn't help me. It seems to be easy, but my own work produces only errors.

Thanks for help!

bigtrader


 
 Post subject: Re: Convert Pips To Currency Value Post rating: 0   New post Posted: Tue 15 Mar, 2011, 14:52 

User rating: 1
Joined: Fri 26 Mar, 2010, 19:19
Posts: 116
Location: Canada
Have you tried JFUtil? Converting values to account currency is one of the built in features. It's common problems like this that JFUtil is made for.

https://www.quantisan.com/jfutil-2-0-alpha-demonstration/

bigtrader wrote:
Hello

For my money management to calculate the lotsize I need the value of a pip in account currency. The example at the wiki doesn't help me. It seems to be easy, but my own work produces only errors.

Thanks for help!

bigtrader


 
 Post subject: Re: Convert Pips To Currency Value Post rating: 0   New post Posted: Sun 20 Mar, 2011, 15:49 

User rating: 0
Joined: Thu 10 Mar, 2011, 16:36
Posts: 3
quantisan wrote:
Have you tried JFUtil? Converting values to account currency is one of the built in features. It's common problems like this that JFUtil is made for.

https://www.quantisan.com/jfutil-2-0-alpha-demonstration/



Hi quantisan

Thank you very much for your help! Your page is amazing, good job!

Great regards,
bigtrader


 

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