Click here to Login





                                                   How to get forex rates for a specified currency

  0

0
Chaim6
2014-12-08 01:07:03


// Would the following be doable?
// I didn't test out this code but this is the idea:
EarningsYield = ToUSD(GetSeries("mstar", "eps ttm"), GetSeries("mstar", eps currency")) / ToUSD(Close, Currency);

and the custom function ToUSD
Is the following code in the nearly correct to get fx data?
VectorCustomDouble FX_Rates = cFunctions.GetTimeframeData("USD" + FromCurrency, "daily", "close");
What is the second parameter really supposed to be (I know, it is supposed to be a number not a string, but what number)?
What is the difference between cFunctions.GetTimeframeData() and cFunctions.GetTimeframeRawData()?

I am trying to convert fundamental data from another currency to the USD. I plan to use this together with the Morningstar downloader for international stocks. For my non-US list of stocks Morningstar has many with a EPS currency different than the trading currency. One way to measure the earnings yield properly is by converting the price and EPS to USD before building the ratio. Something like this:

Thanks.



QuantShare
2014-12-08 01:39:08

  0

"GetTimeframeRawData" gets raw data not adjusted to current security's bars.
You should use "GetTimeframeData" instead.

Regarding the second parameter, I don't know what the "eps currency" is but obviously it is a string value.




Chaim6
2014-12-08 15:39:57

  0

So what is Param 2 supposed to be?

Putting together the documentation from the Script Help which states:
cFunctions.GetTimeframeData(symbol String, timeframe Int32, close, open, high, low, volume or openint String) returns VectorCustomDouble.
and from the intellisense which states:
cFunctions.GetTimeframeData(String symbol, Int32 timeframe, String arrayType)
Param 1: symbol
Param 2: timeframe
Param 3: close, open, high, low, volume or openint

I understand what Param 1 is and what param 3 is but what is Param 2? What are the choices and what does it mean? Can you write an example?

Thanks.



QuantShare
2014-12-09 03:41:50

  0

Best Answer
The second parameter is the time frame.
If you are applying the function in a daily system and you want to get weekly data, type:
VectorD v = cFunctions.GetTimeframeData("Symbol", 7, "close").ToVectorD();

If in a 60-min chart/system you want to get daily data:
VectorD v = cFunctions.GetTimeframeData("Symbol", -1, "close").ToVectorD(); // Negative value to get EOD time frame in an intraday time frame



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
EOD Data for Forex
Tweet Sentiment Index for the Forex and Stock Market
One-Minute Intraday Data for Currency Pairs
Currency Trading News from Yahoo - Forex Market
Interest Rates Historical Data for Australia - Interbank and Targ...

How-to Lessons
How to get fundamental data for U.S. Stocks
How to get stocks for a particular index using the global script
How to download earnings calendar data for various stocks
How to get trading orders from a portfolio programmatically
How to display Forex economic calendar data in a chart

Related Forum Threads
How do I find the close price for an entry matching a custom DB
How to adjust for splits in QS
How to get the last day of the month in C#
how to creat support & resistance level for n days?
How do you retrieve the entry and exit price for a position?

Blog Posts
Step by step on how to get free realtime/delayed data for stocks,...
How to get buy and sell orders for a portfolio based on a trading...
6 places to download historical intraday Forex quotes data for fr...
How to Download Trading Data for Certain Securities Only
Fundamental analysis: How to track economic indicators in the For...









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.