Hi Support
I have recently added a few lines of code to calculate the lot size in my strategy
I then tested the new strategy on the demo platform using the Historic Tester (for a week)
It works perfectly
Now , when I try to run the strategy on the live platform I continually get an Out of Memory error (Garbage Collector)
Here is the new code I added:-
private final Locale BASE_LOCALE = Locale.US;
private final Currency BASE_CURRENCY = Currency.getInstance(BASE_LOCALE);
................................
/**
* Calculates the correct lot size according to
* percentage at risk and the currency pair
*
* @param instrument - the instrument in use
* @return
* @throws JFException
*/
private double getLot(Instrument instrument) throws JFException{
double lot;
double equity = myAccount.getEquity();
if(!BASE_CURRENCY.equals(myAccount.getCurrency())){
double bcBid = myHistory.getLastTick(Instrument.fromString(myAccount.getCurrency()+"/"+BASE_CURRENCY)).getBid();
equity *= bcBid;
myConsole.getOut().println("we did get through this !");
}
double latestBid = myHistory.getLastTick(Instrument.fromString(myInstrument.getPrimaryCurrency()+"/"+BASE_CURRENCY)).getBid();
double limit = equity * percentage;
lot = (new BigDecimal(limit/latestBid/(100*10000))).setScale(4, BigDecimal.ROUND_DOWN).doubleValue();
myConsole.getOut().println("Lot Size:- " + lot);
return lot;
}
******************************************************
I am running a PC with Windows 7 Professional
I have tried to increase the java memory by going to the Control Panel -> Programs -> Java -> View-> Runtime Parameters -> -Xms1024m
but when I put any parameter into this blank box, I can NOT load the forex platform ??
Any ideas?
Bob M