Is it possible to use Daily mode for a buy and then use the Weekly mode for a sale.
Thank you
Size:
Color:
If you mean "to use SetScale.../RestoreScale inside a trading loop", then this is not supported in WealthScript.
For anything else like "use an indicator on Daily scale for a buy and then its (or another indicator's) value on Weekly scale for a sale", it's certainly possible. Check out the WealthScript Programming Guide > Multi-Time Frame Analysis and the QuickRef > Time Frames for code samples. And since it's been a popular question, I'm sure that a forum search will add a hundred or two examples more.
Size:
Color:
Yes, that is what I was looking for.
Thank you
Size:
Color:
You're welcome.
Size:
Color:
I used the example on page 91 of the Programming Guide in order to code for my needs. I used the 2/5 EMA crossover to make a new buy. I then test to see if the 3/8 Stochastics had a crossover for both the Daily bars and Weekly bars. I sell when both Daily and Weekly K is below D at the same time. I plotted the 2 3/8 Stochastics data streams to confirm the Sell is done correctly. One issue is the weekly data range should go back further in time compared to the daily data. Using weekly bars is important because it smooths out some of the daily ups and downs without getting stopped out. I use this program to back-test 3X ETFs, e.g., SOXL, TECL, TQQQ, and UPRO. Results for 2019 are excellent.
Size:
Color:
QUOTE:
One issue is the weekly data range should go back further in time compared to the daily data.
Is this what you're looking for?
Wealth-Lab User Guide > Strategy Window > Backtesting Strategies > Inside a Portfolio Simulation >
A Lead Bars SolutionJust FYI, the online guides in the WLP Help menu may contain content not available in the PDF versions. The electronic versions receive content additions/updates in the first place. So when I refer to a Guide I always do so with the built-in version in mind.
Size:
Color:
Eugene,
Thank you for the suggestion. What I did was to define the date when to start trading. Then with each bar I check to see if the day, month, and year match my desired trade start and then I set a Boolean to true. No trades can occur unless that Boolean has been set to true. Now I set the Data Range such that all my data series are complete when the trading starts.
Thank you
Size:
Color:
Glad you've found a solution on your own. Merry Christmas!
Size:
Color: