Login Page - Create Account

Support Board


Date/Time: Sat, 05 Jul 2025 15:36:39 +0000



Post From: How does Sierra Charts discount the opening gap calculating Moving averages?

[2024-11-29 12:47:44]
User813832 - Posts: 12
Hi,

I am trying to write some systems in python and I have written a market regime filters (based on moving averages) in python and ACSIL. However I notice that when exporting the RTH data, the moving averages in the python code respond strongly to big moves when the market gaps up and down (because I am only looking at prices from the RTH session, so for example there is a big jump between 16:15 and 09:30).

However, when I look at Sierra Charts, I can see the moving average barely responds at all to the opening gap and stays extremely smooth. I prefer this approach.

I have tried to brainstorm how this is done or how to recreate this, I tried to align the close of prior session with the open of new session, but it doesn't have the same affect. I can't for the life of me think how the opening gap is completely smoothed out. Is the moving average being calculated on ETH prices even though the chart is only displaying RTH?

Currently, I have rewritten my python code to just take the moving average calculations done by SC rather than calculate them itself (as I don't know how to discount the opening gap). This approach works, but it means I need to completely revise my data every time I want to change some variables.

I am not sure if this question is out of order or the way its done is some trade secret or something, if you want to keep it secret feel free to tell me that. But it sure would help me if you'd steer me in the right direction and I can align my python code with the way the MAs are calculated in reference to the opening gap in SC. As I say, it's really quite impressive how smooth the MAs stay when there is a gap up/down and I have no idea how they stay so smooth.

Many thanks!

As always love SC, keep up the great work.
Date Time Of Last Edit: 2024-11-29 12:49:26