Dukascopy
 
 
Wiki JStore Search Login

MC
 Post subject: MC Post rating: 0   New post Posted: Sat 28 Sep, 2013, 23:59 

User rating: 0
Joined: Sat 28 Sep, 2013, 23:42
Posts: 8
Location: Poland,
Hello I need to display the information where it will be the MC for open positions. I can draw a red line and set it to any level but I do not know how to calculate this level for open positions ?


 
 Post subject: Re: MC Post rating: 1   New post Posted: Mon 30 Sep, 2013, 08:36 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

MC level is related to exposure generated by the open positions with regards to their P/L.
If you need to display/calculate the margin cut level you can use the variable "Margin Cut Level" under account section.

Generally speaking, here is the calculation method for some variable:

Used margin = Equity - Free Margin
Leverage = Total Exposure / (Use of Leverage x Equity)
Use of Leverage = (Used Margin / Equity)*100
MC => 2*Account leverage


 
 Post subject: Re: MC Post rating: 0   New post Posted: Mon 30 Sep, 2013, 16:35 

User rating: 0
Joined: Sat 28 Sep, 2013, 23:42
Posts: 8
Location: Poland,
thank you

I was thinking of something like this I do not know whether it will be correct calculation?

douuble EQ = account.getEquity();
double Total_lot_for_open_position = 0.3; //
double Margin_Cut_Level=0;
double EP =0;

//****************
JFUtils utils = context.getUtils();
pipCost = ( utils.convertPipToCurrency(instrument, context.getAccount().getCurrency()) ) *100000 * total_lot_for_open_position;
EP = EQ/ pipCost ;
MC = ask +EP;

//****************

IChart chart = context.getChart(instrument);
IChartObject MC_Line = chart.draw("MC_Line", IChart.Type.HLINE, tick.getTime(), tick.getBid()+EP);
MC_Line.setColor(Color.RED);

Image


Attachments:
mc.png [13.36 KiB]
Downloaded 446 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: MC Post rating: 0   New post Posted: Tue 01 Oct, 2013, 11:51 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Repost that request here:
viewforum.php?f=89

This is Visual JForex forum.


 

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