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 ?
- 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.
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.
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.