Support Board
Date/Time: Wed, 05 Nov 2025 23:43:12 +0000
Filter signals based on price being above or below a moving average
View Count: 53
| [2025-11-04 16:58:29] |
| User993440 - Posts: 23 |
|
Using a study with signals, the Stochastic Crossover System, for instance. Can you tell me how to display signals only when the market is above or below a moving average. For example, if I'm using a 200 period simple moving average with the stochastic crossover system, I only want buy signals to display when the underlying price is above the SMA and only sell signals when the price is below the SMA. Hope that makes sense. Thanks |
| [2025-11-04 18:41:41] |
| John - SC Support - Posts: 42801 |
|
The "Stochastic Crossover System" is it's own system with Buy/Sell signals generated based on the Stochastic Slow lines. So we are not certain how what you are asking relates to this study, as it does not have a Simple Moving Average that you specifically set. If you are asking how to have a Buy signal when price is above a particular 200 period SMA, and a Sell Signal when the price is below that 200 period SMA, then you would need two copies of the "Color Bar Based on Alert Condition" study to do this. One copy for the Buy situation and one for the Sell situation. For the Buy setup, you would enter an Alert Condition that looks like the following: =C > ID1.SG1 Where "C" is the Close (Last) of the bar, or the current price. "ID1" is the ID of the Simple Moving Average study. And "SG1" is the subgraph of the Simple Moving Average study that actually contains the data. If you then want a down pointing green arrow to print at the bar, then set the "Draw Style" for the "Color Bar" subgraph of the "Color Bar Based on Alert Condition" to be "Down Arrow" and the color to "Green". Then set the following Inputs for the study to have the arrow at the high of the bar: - Output When Condition True: Use Input Data - Input Data: High We leave the rest to you. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
| [2025-11-04 19:14:59] |
| User993440 - Posts: 23 |
|
Thanks for the reply. Let me clarify what I meant. In this case I want to use one instance of the Stochastic Crossover System study and a separate 200 period simple moving average study. If the underlying instrument price is above the SMA and the Stochastic Crossover System fires an up arrow, I want that to display. But I don't want it to display any down arrows when the instrument price is above the SMA, just up arrows. Conversely, if the underlying instrument price is below the SMA and the Stochastic Crossover System fires a down arrow, I want that to display. But I don't want it to display any up arrows when the instrument price is below the SMA, just down arrows. |
| [2025-11-04 19:36:16] |
| John - SC Support - Posts: 42801 |
|
To do what you are wanting, you need to keep the main configuration as we have specified it above, where you use two copies of the Color Bar Based on Alert Condition to get the Buy and Sell Signals. You will want to hide the "Stochastic Crossover System", as you do not need it to show anything on the chart. You will then add the condition that the "Stochastic Crossover System" is true for the Buy situation and separately for the Sell condition. So your Alert Condition for the "Buy" Color Bar Based on Alert Condition would now be the following: =AND(C > ID1.SG1, ID2.SG1) Where "ID2" is the ID of the Stochastic Crossover System and "SG1" is the Buy subgraph of the Stochastic Crossover System. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
| [2025-11-04 19:53:52] |
| User993440 - Posts: 23 |
|
Perfect, thanks John.
|
To post a message in this thread, you need to log in with your Sierra Chart account:
