Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 07:26:39 +0000



[User Discussion] - Is it possible to exclude last (current) bar from Moving Average calculations?

View Count: 618

[2020-09-09 00:50:11]
gjockey - Posts: 47
Hello,

Using a 1 minute chart, I have a "Number of Trades" study on which I apply a "simple moving average" study to with length = 4 (ie. calculate # of trades per minute over 4 minutes). I then use a "Text Display" study to display this average. In the case that the current bar is just beginning, I do not want the current bar's "number of trades" zero or near zero value to skew the entire moving average. Is there a way to force a moving average study to only calculate on completion of time bars, or have it offset one bar somehow and always skip the current bar in it's calculations?

In case somebody has a better/different approach, here’s more background on why I am asking. On volatile stocks, I like to pull up tick charts but I need a quick way to figure what the tick (number of trades) setting should be, which is why I want to know the trades/minute average it is doing in the immediate timeframe. When I mean volatile, a stock could normally make 40 trades per minute and suddenly be doing 1,000 trades per minute. Using an approach like I mentioned above would work except the calculation of that last bar can really screw up the # of trades average if the current bar is just starting when you are only looking at 4 bars/minutes back.

Thanks.
Date Time Of Last Edit: 2020-09-09 01:12:05
[2020-09-09 12:52:37]
Ackin - Posts: 1865
Hi, Did you try Displacement in the Study settings?

Chart Studies: Subgraphs Tab >> Displacement
[2020-09-09 13:47:43]
Sawtooth - Posts: 3976
The Text Display For Study study has an option to display any previous value:
Set 'Subgraph Columns Back' to 1.
[2020-09-10 04:16:19]
gjockey - Posts: 47
Thank You. Both solutions were great. I love the flexibility of Sierra Charts. As I suspected, there was more than 1 way to approach this problem.

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

Login

Login Page - Create Account