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.

how to get margin required?
 Post subject: how to get margin required? Post rating: 0   New post Posted: Tue 18 Mar, 2014, 03:46 
User avatar

User rating: 1
Joined: Tue 27 Aug, 2013, 17:39
Posts: 26
Location: China, Shanghai
i am 6 month old in MT4 but new in jforex,please kindly help me if you know the answers.
question:
how to get margin required per 1.0 lots for the current instrument and leverage?
is there some function like MarketInfo in MT4?
double marginrequired = MarketInfo(Symbol(),MODE_MARGINREQUIRED);
i have search a lot,but didn't find any function yet.
thanks in advance :)


 
 Post subject: Re: how to get margin required? Post rating: 0   New post Posted: Sun 30 Mar, 2014, 03:03 
User avatar

User rating: 1
Joined: Tue 27 Aug, 2013, 17:39
Posts: 26
Location: China, Shanghai
i get the margin in the following way:
double PipValue = myinstrument.getPipValue();
double Ask = tick.getAsk();
private double getMarginRequired(Instrument instrument) throws JFException {
JFUtils localutils = mycontext.getUtils();
double pipvalueincurr = localutils.convertPipToCurrency(instrument,
myaccount.getCurrency());
return ((Ask / PipValue) * 1000000 * pipvalueincurr / myaccount
.getLeverage());
}
if someone get better way,please kindly inform me.


 

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