I'm trying to write a simple system that would buy at each N-th BAR (NOT "date") of each month. For.ex.: buy each 1st bar on the beginning of each month.
But I cannot figure out how to realize it in Wealth Script.
Could anyone help please?
Size:
Color:
Hi there. By the way, which product are you using?
Here's how:
CODE:
Please log in to see this code.
Size:
Color:
Hi Eugene!
Thanks for answering!
I'm using Wealth Lab Developer and still it's not clear for me what exact part of the above code should I put into CharScript Editor as it doesn't understand any of the above?
p.s: Just noticed,...i suppose i should have posted this question in Wealth-Lab 4 forum branch?
Size:
Color:
QUOTE:
p.s: Just noticed,...i suppose i should have posted this question in Wealth-Lab 4 forum branch?
For sure.
Anyway, the pattern is pretty clear to code in WL4: detect the bar when month has changed, save it into an integer variable (e.g
newMonth), then check if the current bar is equal to (that variable + offset).
Size:
Color:
Eugene's method is probably more efficient, but this is more straightforward for anyone asking this question -
CODE:
Please log in to see this code.
Size:
Color: