tick resolution causing Floating point error [SOLVED]
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Is that floating point error triggered by MultiCharts itself, or by one of the scripts you have on the chart?
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
Please post a screenshot of the error message.
- JoshM
- Posts: 2196
- Joined: May 20 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
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?
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?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?
is there such a thing as a tick with 0 volume?
I am not aware of any resolution requirements in my indicator.
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
First step:
go through the code and find all the division operations.
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?First step:
go through the code and find all the division operations.
is there something different about <=500 resolution?
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.First step:
go through the code and find all the division operations.
solved. thanks
quick question though?First step:
go through the code and find all the division operations.
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?
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
GIGO
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
This returns the total volume instead of the UpVolume
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
Last edited by joebone on Jun 25 2020, edited 1 time in total.
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
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.
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;
- Vlada MultiCharts
- Posts: 301
- Joined: Apr 22 2020
- Has thanked: 8 times
- Been thanked: 78 times
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.
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.