Click here to Login





                                                   TimeframeApply function

  0

0
User
2011-01-24 08:42:57


Hello,

I have a question regarding multi time frame and money management script.
I saw that there was a TimeframeApply function. I tried to use it in Money management script but it does not seem to work.
I am using daily bars and wanted to check a simple indicator (like sma, or rsi) in a weekly time frame, so I set tf=5 for the time frame factor in TimeframeApply.
I suppose that, since I have daily bars, QS is able to expand them to weekly bars so that values can be found by the TimeframeApply function.
Is it correct ? If so, could you provide an example of how to use TimeframeApply to weekly bars in a daily setting in money manager ?

Another question is relative to the long/short portfolio settings.
I have found the way to set these settings (Portfolio.UpdateCategorySettings) but how to retrieve them ?
Is there something like a "GetCategorySetting" function ?

And last question, when would the userguide be updated with all the money management functions that are not yet in ?
Or is there someplace else on this site where to find the up to date informations regarding money management capabilities ?

Thanks fo any help or advice you could provide.





QuantShare
2011-01-24 09:11:08

  0

Best Answer
- TimeframeApply creates a time-series in the specified time-frame.
To use this time-series with daily data, you should use the "TimeframeDecompress" function.
TimeframeDecompress(TimeframeApply(5, rsi(14)))

In the Money Management Script:
TimeSeries a = Data.ParseFormula("a = TimeframeDecompress(TimeframeApply(5, rsi(14)));").GetTimeSeries("Symbol", "a");

- There is no function to retrieve these settings. They are updated by you, so you can always store the values in some variables.
By default:
Long Strategy: "long" = 100
Long Strategy: "short" = 100
Long/Short Strategy: "long" = 50 and "short" = 50

- We will update the user guide very soon. A good way to learn about money management capabilities is to download money management items from the sharing server and see how they are implemented.



QuantShare
2011-01-24 09:12:15

  0

For a weekly time-frame, set 7 instead of 5.


User
2011-01-24 10:09:09

  0

Again, thanks a lot for your help !
I think TimeframeDecompress is what I was missing.

Actually, I did download money management scripts from the sharing server and it helped me a lot. I am trying to put additional ideas to my own script.
What I like is that until now, QS seems to be able to handle the implementation of all that I need.



QuantShare
2011-01-24 10:12:51

  0

I am glad you like QuantShare. If you have any feature in mind, please don't hesitate to contact me.


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
News parser function
Advanced Quotes and Custom Databases Function
Swing Point Function (SP)
NORMDIST - Normal Probability Density Function
Day of week and Week number function

How-to Lessons
How to display two stocks on the same chart
How to detect stocks trading near all time highs
How to calculate the average of a time series using the money man...
How to plot arrows below/above candlesticks on a chart
How to create a hatched area in a chart

Related Forum Threads
Percent Rank Function Needed
newbie looking for function help
Optimizable Fibonacci function
Question on Swing Point function sp()
Function Call

Blog Posts
The 'inside period' function
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
A vector-based language









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.