Login Page - Create Account

Support Board


Date/Time: Sun, 19 Jan 2025 06:13:10 +0000



Potential ADX bug when HighChange == LowChange

View Count: 1009

[2018-01-28 14:40:22]
Usermb - Posts: 126
IMHO DirectionalMovementTrueRangeSummation contains a potential bug when HighChange == LowChange:

Example values:
HighChange = 0.040009
LowChange = 0.039993

For a symbol with a tick size of 0.01 both of them are 4 ticks, but internally they are different as seen above.
The above values lead to Pos = 0.040009 and Neg = 0.0
This is the potential bug, imho they should both be 0.0

Even a small thing like can lead to a fluctuation of 4-5% in the computed ADX some number of bars later.
When unfortunate, it may result in alerts being triggered when they should not be triggered or vice versa.

Potential fix: use FormattedEvaluate
[2018-01-29 09:36:32]
Sierra Chart Engineering - Posts: 104368
We added a small patch to solve this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-02 16:25:52]
Usermb - Posts: 126

We added a small patch to solve this.

The problem does not appear to have been entirely fixed.
Given the following data for FGBL, which has a tick size of 0.01:

open high low close
bar1 125.11 125.11 125.11 125.11
bar2 125.11 125.13 125.09 125.13

SC computes the following values at bar2:
HighChange=0.020004 (2 ticks)
LowChange=0.019989 (2 ticks)
Positive = 0.020004
Negative = 0.000000

Correct would be:
Positive = 0.0
Negative = 0.0
[2018-02-07 19:31:02]
Sierra Chart Engineering - Posts: 104368
This is going to take some time to work out a solution for this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-23 18:56:42]
Sierra Chart Engineering - Posts: 104368
We have worked out a solution to this. It will be out in the next release (1707) and you can have a look at that.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-03-23 11:29:40]
Usermb - Posts: 126

We have worked out a solution to this. It will be out in the next release (1707) and you can have a look at that.

Unfortunatelly it doesn't work as expected. Sorry guys, I know you are really busy.

Example:
HighChange=0.010010 (1 tick)
LowChange=0.009995 (1 tick)
PercentDifference = 0.001527 (which is >= 0.001)
Positive = 0.010010
Negative = 0.000000

Correct would be:
Positive = 0.0
Negative = 0.0

Please note that this is for a product with a tick size of 0.01, image what happens for a product with a much smaller tick size (say 6J where it is 0.00005). I somewhat have my doubts that this solution can work reliably, but I am open to any solution that works :-)

I guess you don't want to change the signature of DirectionalMovementTrueRangeSummation, otherwise by passing SCStudyInterfaceRef instead of SCBaseDataRef you would have access to TickSize.
[2018-03-23 17:41:32]
Usermb - Posts: 126
On Balance Volume is also pained by this problem, and for sure other studies as well that rely on comparing prices.
A lower tick size (say 6J where it is 0.00005) leads to many errors :-(
[2018-03-23 21:48:32]
Sierra Chart Engineering - Posts: 104368
We recommend you implement a solution on your side. This is nothing that we can do anytime soon.

We would be breaking compatibility with custom studies to solve this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account