Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back Test JPY Pairs #6

Closed
randallgann opened this issue Feb 27, 2023 · 2 comments
Closed

Back Test JPY Pairs #6

randallgann opened this issue Feb 27, 2023 · 2 comments

Comments

@randallgann
Copy link
Owner

At the moment whenever I choose a JPY pair for back testing I'm getting an error.

@randallgann
Copy link
Owner Author

randallgann commented Feb 28, 2023

I'm getting a IndexOutofRangeException 'Index was outside the bounds of the array.' When backtesting GBP_JPY.

I don't think this error is necessarily specific to JPY pairs. The error happens within the EMA.cs object when getting the number of decimalPlaces in the close price we split at the "." and the exception gets thrown when there are all zeros to the right of the decimal. This is because when converting the string 161.000 to a decimal the decimal becomes 161 without a dot.

@randallgann
Copy link
Owner Author

I fixed this by declaring the number of decimal places immediately after obtaining the candles in the ProcessBackTest method. This is done before the candle strings are converted to decimals and entered into the datatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant