Click here to Login





                                                   Creating Watchlist with Two Timeframes

  0

0
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);




No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Design and backtest a trading system with two strategies
Rebalance & Combine & backtest two trading strategies
Short Term Trading System with RSI Ratios
Intraday Trading System with Daily Ranking
Trading Rules to use with the Trading System Optimizer

How-to Lessons
How to speed up watchlist and screener plug-ins when working with...
How to run a screen or a watchlist from a script
Difference between the watchlist and the screener tools
How to create a watchlist
How to drag & drop a stock to a static watchlist

Related Forum Threads
Use Watchlist with Simulator
Need assistance with C# creating an indicator
Creating Shortcuts with arrow keys? Function keys?
Composite with dynamic watchlist symbols
Browse a watchlist or filter

Blog Posts
Create Realtime Quote Sheets with the Watchlist Tool
Create Profitable Trading Strategies with Exchange Traded Funds (...
Creating a download item: Initial Jobless Claims
Compare stocks and securities by creating a relative performance ...
Technical Analysis Using Multiple Timeframes









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.