Hi
The strategy below plots weekly close. Why does it change value on last bar of chart, even if it's not a Friday? How can I stop it doing that?
Regards Jon Brewer
CODE:
Please log in to see this code.
Size:
Color:
QUOTE:
Why does it change value on last bar of chart, even if it's not a Friday?
What's wrong with it? Why shouldn't it change value if you feed in more bars? Just two examples. Some international markets can trade on Saturdays. Friday can be a holiday.
Making compressed bar available on last bar of period is Wealth-Lab's default behavior. You can change it so that previous compressed bar becomes available on the first bar of period by shifting the
dsWeeklyClose DataSeries one bar forward - according to this KB article:
Intraday / Multi-Time Frame | Compressed price series alignmentCODE:
Please log in to see this code.
Size:
Color:
Eugene,
I guess there is nothing wrong with that. In a sense it is a good idea because it takes more data into account. But... I need to duplicate the behaviour of a trading system developed in another tool. This other tool did not update the weekly close until the week had in fact closed. After close on Friday (or whatever day was the last trading day of that week) the weekly close series would be updated to reflect the close of the week. Until the next Friday close the weekly close series then remained constant.
The WL6 design is like having an intraday "ghost" bar that jumps around all day, except on a higher time-frame.
My solution to this will be to develop some C#-code that will detect that today is the last day of a week. Only if today is the last day of the week then the weekly series will be updated, otherwise they will remain constant.
Regards Jon
Size:
Color:
Jon,
I see your point and like the proposed workaround.
Size:
Color:
If you're trading a weekly system, why are you wasting your time looking at the chart during the week?
One of the advantages of trading weekly is that you need only to update your data once per week, run the strategy, and place market or GTC orders. You're done for the week; go and enjoy your free time or work your normal job.
Size:
Color:
Hi Cone,
The system uses weekly and daily timeframes.
Regards Jon
Size:
Color:
In that case, then you shouldn't be looking at the Weekly chart, you must use Daily charts. When you synchronize weekly time frames with Daily data, i.e., your code uses SetScaleWeekly()... then Synchronize(), you'll get the closing values of the previous week. You will not get the daily updates as shown in the Weekly chart.
If this isn't clear, just plot your Weekly series on a Daily chart and you'll see that the weekly data are updated only after the Friday close.
Size:
Color: