Error on size calculation for JForex in case of XAUUSD instrument

Hello, I'm using SQ 138.1837 to create a strategy for XAUUSD, see the attached file GOLD_Strategy 3.50.112.sqx.



 After putting the strategy in real with size 0.01 lots the JForex catch an error, see the "Log_Dukascopy.csv" and the line

11 Dec 2023, 18:00:01INFOGold_Strategy_3_50_112 - ERROR: Order amount: 0.000000010 can't be less than minimum allowed: 0.00000100


The problem is in the function below:



private double getLotSize(Instrument instrument) throws JFException {     if(instrument.getGroup().isCrypto()) return 1d;           if(instrument.getGroup().isForex()) return 100000d;          return 1d; }



I suggest you to use instead the following function that is applicable to all instruments( forex, crypto, metals...)


private double getLotSize(Instrument instrument) throws JFException { return 100*instrument.getMinTradeAmount(); }

Attachments
Log_Dukascopy.csv
(2.86 KiB)
GOLD_Strategy 350112.sqx
(91.49 KiB)
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status New
  • Priority Normal

History

ME
#1

masmox

14.12.2023 18:57

Task created


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please