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.

pip value
 Post subject: pip value Post rating: 0   Post Posted: Wed 15 Sep, 2010, 21:30 

User rating: 0
Joined: Wed 26 May, 2010, 18:57
Posts: 11
Could you tell me which function returns pip value of a given pair in my deposit currency? I have tried getPipValue(), but it returns something else... :(


 
 Post subject: Re: pip value Post rating: 0   Post Posted: Fri 17 Sep, 2010, 16:19 
User avatar

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

This example stops strategy when created order is great or equal specified amount.


 
 Post subject: Re: pip value Post rating: 0   Post Posted: Mon 20 Sep, 2010, 12:09 

User rating: 0
Joined: Wed 26 May, 2010, 18:57
Posts: 11
Thank You, good example.
But I want calculate amount before create order.
Amount depends on my equity and risk. For example risk = 3%.
I want create order with stopLoss = 10 pips and I want to calculate the amount on this basis.

Let (???) - how much money in my currency is one pips.

private double countAmount(int risk, int stopLoss){
        double equity = this.context.getAccount().getEquity();
        double moneyToRisk = (equity*risk)/100;                       //risk is in % (For example risk = 3)
        double amount = moneyToRisk/(stopLoss*(???));             // (becouse:      amount * (???) * stopLoss = moneyToRisk )
        return amount;
    }


How can I calculate (???).
(Of course I know that it depends on instrument.)


 
 Post subject: Re: pip value Post rating: 0   Post Posted: Mon 04 Oct, 2010, 15:30 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
We have prepared additional example for you, please consider the following JForex Wiki page https://www.dukascopy.com/wiki/index.php ... t_currency.
If you have any questions, please do not hesitate to contact us.


 

Jump to:  

cron
  © 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