Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 05:45:47 +0000



[Programming Help] - Alert won't trigger, rounding error?

View Count: 556

[2019-11-09 23:19:09]
j4ytr4der_ - Posts: 910
I have a simple visual signal triggered by the formula

=CROSSFROMBELOW(C, ID2.SG4)

ID2.SG4 is the lower band of an ATR channel set at 2 ATR.

I have a valid signal firing on one bar, then 7 bars later it fails to fire, when both signals are valid by 3 ticks (C went below the line by 3 ticks, then came back above ID2.SG4 again).

I can't figure out how it could work once, then fail just 7 bars later. I'm using a Renko chart (20-15-15) in case that's a factor.

If I adjust the ATR channel so that it's slightly tighter (1.8 ATR instead of 2), then both signals register fine.

Looking at the Alert Manager, it appears that there may be a rounding error at work here. Here's an example from the Alert log (there is an endless stream of lines so this may not be the perfect example, but they all demonstrate the apparent floating point number):

=CROSSFROMBELOW({1559.39990234375,1558.699951171875,1559.199951171875},{1559,1559.2000732421875,1559.300048828125}) | No alert sound/email.  2019-11-09 15:10:03

When the signal fires OK, it looks like this:

Study  Replay 30X: RTYZ19 [CB] Flex Renko 20-15-15 #7 | LongSignal  Alert - Chart: Replay 30X: RTYZ19 [CB] Flex Renko 20-15-15 #7 | Study: LongSignal | Formula: =CROSSFROMBELOW(C,ID2.SG4) is TRUE. | Last Price: 1559.1 | Bar start date-time: 2019-09-11 08:20:16 | No alert sound/email.  2019-11-09 15:10:03

Is there a bug here? Or do I have some incorrect setting somewhere or something?
Date Time Of Last Edit: 2019-11-09 23:19:49
[2019-11-10 01:02:12]
j4ytr4der_ - Posts: 910
Changing my formula to

=AND(
L < ID2.SG4,
C > ID2.SG4
)

Works fine, where CROSSFROMBELOW doesn't. Weird.
[2019-11-10 03:54:27]
Sawtooth - Posts: 3952
If you are using Renko bars, you should use the Renko close:
=CROSSFROMBELOW(ID0.SG23, ID2.SG4)
Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables

Also, see this about the Value Format:
Study/Chart Alerts And Scanning: The Effect of the Value Format on Identifier Values
[2019-11-10 04:10:32]
j4ytr4der_ - Posts: 910
Thanks. I've actually had issues with the Renko close for some reason, and I'm working on candle charts now. But I'll check out the links you highlighted.

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

Login

Login Page - Create Account