computing 20 day sma from within a 1 minute strategy?
Author: haytac
Creation Date: 11/28/2013 12:08 AM
profile picture

haytac

#1
Hi,

I am currently computing 20 day sma from a day strategy and then pass it to the 1 minute strategy using globals. This works fine before the start of the day.

However, I have a need to access end of the day 20 day sma value from within the 1 minute strategy for the last bar of the day. The previous trick will not work in this case. Is there a way to compute this from:
a) 20 day sma of the day before
b) todays closing values of C,L,H, or O?

It may be a simple calculation to do it with sma but I also need ema.

Thanks!
profile picture

Eugene

#2
profile picture

Cone

#3
QUOTE:
I have a need to access end of the day 20 day sma value from within the 1 minute strategy for the last bar of the day
Do you mean that you want to calculate the 20-day average, where's "today's" contribution to the average is updated each minute?
profile picture

haytac

#4
From inside a 1 minute strategy, at 4pm of a session, I would like to have access to 20 day sma which includes today's data. Thanks!
profile picture

Eugene

#5
Hope that helps:

Intraday / Multi-Time Frame | Mixing intraday and daily data > Updating a Daily indicator using Intraday values
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).