Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2827; setMarginCutLevel does not work
 Post subject: JFOREX-2827; setMarginCutLevel does not work Post rating: 0   New post Posted: Wed 16 Feb, 2011, 16:45 

User rating: 1
Joined: Sun 05 Dec, 2010, 08:44
Posts: 21
In a historical test using the JForex API, calling the setMarginCutLevel method only sets a new value in the ITesterClient object, not in the strategy object where it's actually used.

The following is the relevant code I used to test.
In the tester class:
final ITesterClient client = TesterFactory.getDefaultInstance();

client.setLeverage(leverage);
client.setMarginCutLevel(50);
LOGGER.info("In ITesterClient: Leverage = " + client.getLeverage() + ", MarginCutLevel = " + client.getMarginCutLevel());


In the straetgy class:
console.getOut().println("In IStrategy: Leverage = " + context.getAccount().getLeverage() + ", MarginCutLevel = " + context.getAccount().getMarginCutLevel());


Here is the output:
2011-02-16 22:40:04.865 INFO  TestMarginCallMain - In ITesterClient: Leverage = 300, MarginCutLevel = 50
2011-02-16 22:40:04.874 INFO  TestMarginCallMain - 1 strategies started.
In IStrategy: Leverage = 300.0, MarginCutLevel = 200


You can see above that setLeverage is working fine, but the MarginCutLevel in the strategy object should be 50 but remains at the default value of 200. This is incorrect so please fix this. Thank you.


 
 Post subject: Re: setMarginCutLevel does not work Post rating: 0   New post Posted: Wed 16 Feb, 2011, 16:54 

User rating: 1
Joined: Sun 05 Dec, 2010, 08:44
Posts: 21
I'd like to add that even though the default value of margin cut level is 200, From my tests I believe that it is actually executing margin cut at 100, i.e. 100% of maximum allowed leverage. You should also check this and fix it.


 
 Post subject: Re: setMarginCutLevel does not work Post rating: 0   New post Posted: Tue 08 Mar, 2011, 13:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
The getMarginCutLevel() will be fixed in the next release


 

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