Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 23:40:54 +0000



[User Discussion] - Need help Error #DIV/0- using Study

View Count: 1272

[2017-12-02 15:38:23]
nicktrader - Posts: 728
I am using the Study "Color bar based on..."

As soon as a new candle starts and the bid or ask volume = 0
I get the error message "#DIV/0"

The first part of the formula is totally ignored.

I have tried many things without any success.
=OR(AND(H-L>11,O-C>8,V>V[1],BV/AV>BV[1]/AV[1]),
AND
(H-L>11,C-O>8,V>V[1], AV/BV>AV[1]/BV[1]))


Many thanks
Date Time Of Last Edit: 2017-12-02 15:39:45
[2017-12-02 16:46:12]
Sawtooth - Posts: 4153
Try this:
=IF(OR(AV=0,BV=0),
OR(AND(H-L>11,O-C>8,V>V[1]),AND(H-L>11,C-O>8,V>V[1])),
OR(AND(H-L>11,O-C>8,V>V[1],BV/AV>BV[1]/AV[1]),AND(H-L>11,C-O>8,V>V[1],AV/BV>AV[1]/BV[1])))
[2017-12-03 04:09:05]
nicktrader - Posts: 728
@tomgilb

Many thanks for your help. Never seen before that kind of formula.

I have used the formula, but unfortunately still the same error message (see pic).

Although the conditions do not meet the criteria, it is already calculated and this gives the error message (from my point of view)
imageError.png / V - Attached On 2017-12-03 04:01:26 UTC - Size: 17.22 KB - 330 views
[2017-12-03 06:40:26]
TechTrader - Posts: 116
Your AV,BV and V formulas indicate they are looking forward to bars that have not yet printed.
As soon as a bar starts, the formulas are looking for the next bar where all values will be zero.
If assuming you are comparing current bar with previous bar AV,BV and V values then using [-1] should achieve that.
[2017-12-03 07:51:03]
nicktrader - Posts: 728
@TechTrader

I know. The problem is certainly the part "AV/BV" or "BV/AV". But I can't use [1] because it would misrepresent the result.

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

Login

Login Page - Create Account