Click here to Login





                                                   Correl of daily returns in QSScript?

  0

0
Kiran
2016-06-14 12:40:16


How do i plot correlation of daily returns of 2 symbols (e.g. SPY, TLT) in Quantscript?
correl function only takes 1 series as parameter and assumes the other one is Close (whereas I want daily return of Close)
- Below is the code i tried and i get an error on last line.

tlt = GetSeries("TLT",close);
drSpy = perf(close,1); //SPY is plotted on chart
drTlt = perf(tlt,1);
drCor1m = correl(drSpy,drTlt,22); // this one doesn't compile, gives error

Pl advise ..



QuantShare
2016-06-14 18:25:07

  0

Your formula works. It does not give any error. Something else is probably given the error. Try just these lines and it should work.


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
CryptoCompare Daily Downloader
Forex Daily Volatility
Stocks Outperforming the S&P 500 on Daily Basis
Daily Stock Quotes for more than 50 Stock Exchanges
Daily Stock Quotes - Stock Market EOD Data

How-to Lessons
How to screen for stocks having a high correlation with the Dow J...
How to detect stocks trading near all time highs
How to plot two different time frames in the same chart
How to create and trade a Neural Network model
How to add a metric in the trading system simulation report

Related Forum Threads
drawing objects in log mode in daily and weekly charts
Access intraday data while working on daily chart
Display weekly RSI in a daily chart
MM script: getting Daily prices of index from Intraday Interval
Print daily equity with monthly timeframe

Blog Posts
Historical volatility estimators
How to Backtest an Intraday Stock Trading System with EOD Ranking
QuantShare Programming Language Tutorial
Fundamental Stock Analysis: Rank stocks based on a valuation rati...
The custom trading indicators tool explained









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.