Bug in the new MC data randomizer

When I first created this code, I tested and developed on "1 minute data tick simulated." Changing every "tick" by up to 40% was way too much change. I put in this hack of adding two zeroes:


double dblChange = ((double) change)/ 10000.0d;


(It's a percent calc so it should really be /100 not /10000) 

I now realize, running on "1 minute tick data simulated" for this MC doesn't really make as much sense because then we are modifying every single m1 OHLC by up to x%/100 . There may also be rounding problems when an m1 bar which only moves one or two points tries to get modified by a small percent. Using evey tick precision will have even greater problems. But what if we want to make % changes to the main time-frame instead of m1 or each tick?

When running on "this timeframe only" this MC test makes more sense because now it should be literally changing the OHLC of the main timeframe by up to x% or x/100. But because of my "hack" running on "this timeframe only" is actually changing up to x%/100 or x/10000. It's way too small! The current workaround is of course to add two zeroes. For instance, if you want to change OHLC prices by up to 40% on the main timeframe then you would set the precision to "this timeframe only" and set the "max change price" variable to 4000.

I propose a change to the code as follows:

double dblChange = ((double) change)/ 100.0d;



and also perhaps a recommendation to use the "this timeframe only" precision for this test or a warning that unexpected results could happen if using higher precisions.

Attachments
No attachments
  • Votes +6
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

bentra

17.04.2021 22:05

Task created

b
#2

bentra

17.04.2021 22:05
Voted for this task.
IH
#3

clonex / Ivan Hudec

17.04.2021 22:19
Voted for this task.
JH
#4

Jabezz

18.04.2021 08:44
Voted for this task.
o
#5

Enric

18.04.2021 09:21
Voted for this task.
k
#6

Karish

18.04.2021 11:46
Voted for this task.
JK
#7

Insanity82007

20.04.2021 02:50
Voted for this task.
MF
#8

Mark Fric

12.05.2021 10:52

Status changed from New to Waiting for information

ok, I changed it to 100.00 and updated the snipped help text.


As for higher precisions - you can modify the constants in initSettings(), check the original RandomizeHistoryData snippet. 

I haven't changed anything in initSettings() in this new snippet.

b
#9

bentra

13.05.2021 17:44
As for the higher precisions - yes I have seen the way it works in the other snippet. I'm not sure that it is appropriate because it is supposed to change each tick by x %, anything else is not working as described. Also, rounding issues from making the changes much smaller, tick volume becomes a factor etc.... I would want to do some experimenting and get some feedback after the indicator and price level bug is fixed.

Hope that's the info you're waiting for.

Cheers, Bentra

MF
#10

Mark Fric

20.05.2021 08:38

Status changed from Waiting for information to Fixed

I'm closing this task, you can reopen a new one after the release of B 132

Votes: +6

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please