I know how to put an instruction to allow a trade on one day of the weeek, for example:
if (Date[bar].DayOfWeek == DayOfWeek.Monday)
as part of a buy signal will only enter trades on Monday. I can edit the code manually
and change Monday to any other day of the week but I would like to do this a little more
elegantly.
I would like to have a parameter slider that allows me to change the day of the week to
test any particular day for an entry but the logic of it escapes me. I have tried a few
different ways, by defining a slider as an integer from 1 to 5 and then equating
each day of the week to a different number. Alas, I don't get it and my programming
logic doesn't seem to eliminate those little red squiggles and error messages. If someone
can give me a snippet of code that would allow me to carry out this function I would be most
appreciative.
Thanks,
Rich Man
Size:
Color:
Here you go:
CODE:
Please log in to see this code.
Size:
Color:
Thanks Eugene.
Size:
Color:
You're welcome.
Size:
Color: