Page 1 of 1

tick resolution causing Floating point error

Posted: Jun 17 2020
by joebone
When i use <= 500 tick resolution on /ES I get a floating point error. I dont get an error when above that. What am i missing?

Re: tick resolution causing Floating point error

Posted: Jun 18 2020
by joebone
if I use tick resolution of 500 then i get a floating point. If I use tick resolution of 501 then it works?

I am not even sure how I start to debug this? what am I missing?

Re: tick resolution causing Floating point error

Posted: Jun 22 2020
by JoshM
Is that floating point error triggered by MultiCharts itself, or by one of the scripts you have on the chart?

Re: tick resolution causing Floating point error

Posted: Jun 22 2020
by joebone
Is that floating point error triggered by MultiCharts itself, or by one of the scripts you have on the chart?
The scripts error and status switches off. MC scripts still work though. I threw on some to make sure

Re: tick resolution causing Floating point error

Posted: Jun 22 2020
by TJ
Please post a screenshot of the error message.

Re: tick resolution causing Floating point error

Posted: Jun 23 2020
by joebone
Please post a screenshot of the error message.
error message 6-23-20.PNG
(6.87 KiB) Not downloaded yet

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by JoshM
I don't know the 'VWAP Array 11' indicator, but the floating point error is caused by this indicator. And not by the chart's resolution.

Since it looks to be a custom indicator, did you perhaps code it to require a minimum resolution of 500 in its calculations?

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by joebone
I don't know the 'VWAP Array 11' indicator, but the floating point error is caused by this indicator. And not by the chart's resolution.

Since it looks to be a custom indicator, did you perhaps code it to require a minimum resolution of 500 in its calculations?
Yes, the indicator is custom. what could cause a floating point while using volume on very small ticks?

is there such a thing as a tick with 0 volume?

I am not aware of any resolution requirements in my indicator.

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by TJ
First step:

go through the code and find all the division operations.

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by joebone
First step:

go through the code and find all the division operations.
This was my first thought but I was pretty confused as to why a >500 tick resolution doesn't give me a floating point error and <=500 does?

is there something different about <=500 resolution?

Re: tick resolution causing Floating point error  [SOLVED]

Posted: Jun 24 2020
by joebone
First step:

go through the code and find all the division operations.
I found the 0, haven't figured out what mistake I made that was just getting covered up by larger resolutions but there is nothing special about the problem.

solved. thanks

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by joebone
First step:

go through the code and find all the division operations.
quick question though?

Rec_V = Rec_V + V;

sometimes I get a zero on this..

Rec_V - Rec_V[1]

how could a += of volume ever be equal to its previous count? Is there something rounding off?

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by TJ
GIGO

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by joebone
GIGO
you making fun of me? :( :lol:

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by joebone
For anyone that finds this in the future with a similar problem....

My mistake was not noticing that MC uses only UpVolume when you [ "Build Volume on" - Trade Volume ] in the instrument settings.
This leaves off down volume and leaves some bars with 0 volume.

If someone knows why that is the case then that would be illuminating to me. I am sure there is a good reason, I just don't know it.

Use the code

Code: Select all

ticks
This returns the total volume instead of the UpVolume

Re: tick resolution causing Floating point error

Posted: Jun 24 2020
by TJ
This is an EasyLanguage legacy problem . . .

You see, in EasyLanguage, VOLUME returns ticks,
and TICKS returns volume.

If you had used the keyword TICKS, you would not have encountered the problem.

Code: Select all

Rec_V = Rec_V + TICKS;

Re: tick resolution causing Floating point error

Posted: Jun 29 2020
by Vlada MultiCharts
Hello joebone,

We can recommend you to make sure that you have the correct settings for the symbol's Min. Movement and Price Scale in QuoteManager ->Tools -> Symol Dictionary -> Select symbol ->Edit.

If the issue persists, please send us:
1) Your workspace file (File -> Save Workspace).
2) Exported data for the symbol in qmd
3) Export of your signal/indicator

Also, please describe the steps performed that lead to the issue so that we could reproduce the issue on our end.