Add an
IAccount field and assign it in the
onStart:
private IAccount account;
public void onStart(IContext context) throws JFException {
this.account = context.getAccount();
Then calculate the
amount in the following way:
double amount = this.account.getEquity() * CoefficientRisk/100000 ;
Mind to replace the
this.amount (which is the global field
amount) with
amount (which will be the method-local variable).
In order to avoid such mistakes already before the compilation, consider programming your strategies in an IDE, e.g. Eclipse:
https://www.dukascopy.com/wiki/#Use_in_Eclipse