Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 19:02:12 +0000



[Programming Help] - Slow Stochastic Alert Question

View Count: 1556

[2017-03-14 01:56:45]
zzzzz - Posts: 14
I am presently using Stochastic - Slow as an indicator and am only using Slow %D (ID1.SG1 in this instance.) with Auto-Coloring based on slope. I am using it in conjunction with the DMI.

If I setup an alert for just the Stochastic using "Simple Alert Condition Formula for Change of Slope or New Slope of a Study Subgraph Line" formula, it works great. But because I add in a match condition for the DMI, it fails because the Stochastic might not have changed slope on that candle that the DMI condition matches.

Here's what I am trying to do:

If the DMI crosses up, then I would like an alert that tells me if the Stochastic is pointing up and below 70. If the DMI crosses down, I would like an alert that tells me if the Stochastic is pointing down and above 30.

Knowing that my DMI condition already works, is it possible to put a condition in that meets my stochastic criteria? I read through the study alerts page and could not find one that matches well.

Thanks!

Here are my working formulas independently:

WORKING DMI
=OR(SG1 = SG2, SG2 = SG1)

WORKING STOCHASTIC
=OR(AND(SG1[0]>SG1[-1],SG1[-1]<=SG1[-2],SG1 < 70), AND(SG1[0]<SG1[-1],SG1[-1]>=SG1[-2], SG1 > 30))

Here is my failed attempt to combine them:

DMI+STOCHASTIC
=OR(AND(OR(SG1 = SG2, SG2 = SG1),(ID1.SG1[0]>ID1.SG1[-1],ID1.SG1[-1]<=ID1.SG1[-2],ID1.SG1 < 70), AND(OR(SG1 = SG2, SG2 = SG1),(ID1.SG1[0]<ID1.SG1[-1],ID1.SG1[-1]>=ID1.SG1[-2], ID1.SG1 > 30))
Date Time Of Last Edit: 2017-03-14 01:57:00
[2017-03-14 02:18:22]
Sawtooth - Posts: 3992
Try this:

=OR(
AND(SG1=SG2,ID1.SG1[0]>ID1.SG1[-1],ID1.SG1<70),
AND(SG1=SG2,ID1.SG1[0]<ID1.SG1[-1],ID1.SG1>30))
[2017-03-14 03:10:29]
zzzzz - Posts: 14
Try this:

=OR(
AND(SG1=SG2,ID1.SG1[0]>ID1.SG1[-1],ID1.SG1<70),
AND(SG1=SG2,ID1.SG1[0]<ID1.SG1[-1],ID1.SG1>30))

It sort of works. At first blush, it is alerting when the DMI crosses up but the Stochastic is down. It should only alert if the DMI crosses up and the Stochastic is pointing up and vice versa.
[2017-03-14 04:48:03]
Sawtooth - Posts: 3992
You said this was working so I left it alone:
WORKING DMI
=OR(SG1 = SG2, SG2 = SG1)
But this is not a crossover formula.

Try this instead:

=OR(
AND(SG1>SG2,ID1.SG1[0]>ID1.SG1[-1],ID1.SG1[-1]<=ID1.SG1[-2],ID1.SG1<70),
AND(CROSSFROMBELOW(SG1,SG2),ID1.SG1[0]>ID1.SG1[-1]),
AND(SG1<SG2,ID1.SG1[0]<ID1.SG1[-1],ID1.SG1[-1]>=ID1.SG1[-2],ID1.SG1>30),
AND(CROSSFROMABOVE(SG1,SG2),ID1.SG1[0]<ID1.SG1[-1]))
[2017-03-14 05:01:05]
zzzzz - Posts: 14
Thank you tomgilb for trying to help me on this. I will test this just as soon as I can.

Do you think the CROSSFROMABOVE/BELOW is applicable here? I am only using one line of the Stochastic slow. I just care if it's pointing up or down when the DMI crosses.

I'm not terribly experienced with writing alerts for studies so this question comes from ignorance more than anything.
[2017-03-14 05:31:11]
Sawtooth - Posts: 3992
I was going by this statement:
It should only alert if the DMI crosses up and the Stochastic is pointing up and vice versa.

What is the ID# of the DMI study?
What is the ID# of the Stochastics Slow study?
When exactly do you want the combined alert?
[2017-03-14 05:40:49]
zzzzz - Posts: 14
I was going by this statement:
It should only alert if the DMI crosses up and the Stochastic is pointing up and vice versa.

What is the ID# of the DMI study?
What is the ID# of the Stochastics Slow study?
When exactly do you want the combined alert?

I am sorry, that probably would have been useful. The DMI is SG1 and SG2 and the Stochastic is ID1.SG1. The DMI alert works beautifully.

This is the scenario:

With the DMI, I am really watching SG1. If it points up and becomes equal or greater than SG2, then I need the Stocastic to be pointing up and below 70. If that criteria is met, I want an alert.

If SG1 points down and becomes equal or less than SG2, I need the Stocastic to be pointing down and above 30. If that criteria is met, then I want an alert.

The problem (I think) is that for example, the Stocastic has changed from pointing down to pointing up 1-2 candles before SG1 points up and becomes equal to SG2. So that would explain why my settings for new or changed slope doesn't work. I am just unsure if there is a way to have SC check for the Stocastic conditions I am looking for.

You're awesome tomgilb. Thanks for hanging in there with me.

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

Login

Login Page - Create Account