|
Mark
2010-11-14 06:22:45
|
|
I was looking to create a dynamic watchlist with the following condition:
Close is below the 20 period SMA on 60 Minutes Bar
and
Close is Above the 20 period SMA on 5 Minutes Bar
As you will notice, two time frames are involved in a single criteria.
Thanks for your help.
Regards,
Mark
|
|
|
|
QuantShare
2010-11-15 06:12:22
0
|
|
Best Answer
To perform this, create your dynamic watchlist, choose the lower time-frame (5 minutes) then add the following formula:
var1 = close > sma(20);
tf = 60*60; // 1-hour in seconds
var2 = TimeframeApply(tf, close < sma(20));
filter = var1 AND var2;
|
|
|
|
Mark
2010-11-15 06:46:39
0
|
|
Wow Excellent. I will try it now. Thanks a lot.
|
|
|
|
Mark
2010-11-15 06:51:56
0
|
|
Perfect. Works beautifully. Thank you very much.
|
|
|
|
chaz
2011-11-16 10:49:18
0
|
|
Will it work in TradingSystem Strategy to have 30m timeframe for Buy rules & 5min timeframe for Sell rules?
Regards,
Chaz
|
|
|
|
QuantShare
2011-11-16 13:15:26
0
|
|
If you want to backtest this rule then you should decompress the time-series to synchronize dates. You can plot it on a chart to see the difference.
var1 = close > sma(20);
tf = 60*60; // 1-hour in seconds
var2 = TimeframeApply(tf, close < sma(20));
var2 = TimeframeDeCompress(var2);
|
|
|
|