tick resolution causing Floating point error  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

tick resolution causing Floating point error

Postby joebone » 17 Jun 2020

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?

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 18 Jun 2020

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?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: tick resolution causing Floating point error

Postby JoshM » 22 Jun 2020

Is that floating point error triggered by MultiCharts itself, or by one of the scripts you have on the chart?

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 22 Jun 2020

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

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: tick resolution causing Floating point error

Postby TJ » 22 Jun 2020

Please post a screenshot of the error message.

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 23 Jun 2020

Please post a screenshot of the error message.
error message 6-23-20.PNG
(6.87 KiB) Not downloaded yet

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: tick resolution causing Floating point error

Postby JoshM » 24 Jun 2020

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?

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 24 Jun 2020

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.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: tick resolution causing Floating point error

Postby TJ » 24 Jun 2020

First step:

go through the code and find all the division operations.

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 24 Jun 2020

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?

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error  [SOLVED]

Postby joebone » 24 Jun 2020

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

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 24 Jun 2020

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?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: tick resolution causing Floating point error

Postby TJ » 24 Jun 2020

GIGO

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 24 Jun 2020

GIGO
you making fun of me? :( :lol:
Last edited by joebone on 24 Jun 2020, edited 1 time in total.

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: tick resolution causing Floating point error

Postby joebone » 24 Jun 2020

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
Last edited by joebone on 25 Jun 2020, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: tick resolution causing Floating point error

Postby TJ » 24 Jun 2020

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;

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: tick resolution causing Floating point error

Postby Vlada MultiCharts » 29 Jun 2020

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.


Return to “MultiCharts”