How to specify time frame for chart script formulas?

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
Import
Posts: 21
Joined: Wed Dec 29, 2010 5:28 pm

How to specify time frame for chart script formulas?

Post by Import »

Anon Asked
Tuesday, May 04, 2010

I’m trying to do a scan for a close above or below an 8 ema, but I want this to be on a weekly chart. Is there a way to code this or should I just do close > or < 40 ema.

Thank you.
Anon

Above8:= C > EMA(C,8);
Event: Above8

Chris White responded to "How to specify time frame for chart script formulas"
Tuesday, May 04, 2010 1:07 PM

Hi Anon,

It is possible to specify a weekly time frame if you are referencing another formula script.

So for example, there is a SystemIndicators.EMA script which takes the time period as a parameter and always uses the close price as the bar component.

Now you can reference this formula using:

Code: Select all

WeekEMA8: FML('EMA(8)#WEEK1');
If you make a new script and add the above line and the line below, you will see two EMA lines on the daily chart – one showing the 8 week ema and one showing the 40day ema:

Code: Select all

DayEMA40: EMA(C, 40);
Here's the resulting chart:

Image

Hope that helps,

Chris.
Post Reply