I'm try to write a script that
Buys: 6 market days before the end of the month and
Sell: 2nd market day of the following month.
Tried the get(month) and get(day) but the trade
dates seem not to be correct- probably logic is faulty?
This following script buys on the 29th of the month
in many cases. Can't see how it calculates that.
Thanks
CODE:
Please log in to see this code.
Size:
Color:
Since you posted in the .NET >> General forum, are you looking for this to work in Version 4 or for a translation to C#?
Please look for the appropriate forum to avoid doubts like these.
Size:
Color:
Looking for the code in version 4.
(please provide the link where I can ask ver. 4 questions)
thanks
Size:
Color:
Size:
Color:
I am trying to upgrade the program that Eugene was kind enought to write for me-
to WLP 5.1 (via the translator)
It does not like the Date Study VI.
I looked at the WIKI for workarounds, but found none.
Any suggestions.
Thanks (hope I posted this in the correct forum...)
CODE:
Please log in to see this code.
Size:
Color:
1) Please use the CODE tags, it's dead simple and they exist for a reason.
QUOTE:
I am trying to upgrade the program that Eugene was kind enought to write for me-
to WLP 5.1 (via the translator)
It does not like the Date Study VI.
2) Yes, this seems to be the case. Please keep in mind that if you face an issue with WealthScript Translator, the best way is to report it directly to the developer (Dr. Koch) on his
dedicated forum.
P.S.
QUOTE:
I looked at the WIKI for workarounds, but found none.
The universal Wiki answer to
date-related functions is "think .NET instead". However, fundtimer's function isn't that simple and requires some effort to re-code it in C#.
Size:
Color:
Well... here is a quick workaround that doesn't take holidays into account:
CODE:
Please log in to see this code.
Accounting for holidays with their floating nature is a PITA, sorry.
Let me add that fundtimer's function was versatile enough to return the remaining trading days in a week or year as well. This one is limited to "days in month" scenario.
Size:
Color:
Great, thanks, I'll give it a try.
Size:
Color:
QUOTE:
Accounting for holidays with their floating nature is a PITA, sorry.
Found myself here accidentally. With Community Components it' a piece of cake to account for market holidays by using this overloaded call:
CODE:
Please log in to see this code.
So the code from post #7 boils down to simply this:
CODE:
Please log in to see this code.
Size:
Color: