|
Dave Walton
2013-07-08 07:39:23
|
|
I'm trying to implement a monthly system that buys the top 3 ETFs on a certain day of the month. If I just use the formula Rule1 = (Day()) == (1)); sometimes I don't get a buy signal because the first trading day of the month is either on a weekend or a holiday. How can I determine if this is the case?
|
|
|
|
clonex
2013-07-08 19:29:44
0
|
|
Rule1 = Day() > 1 and Day() < 7;
|
|
|
|
|
QuantShare
2013-07-09 02:57:17
0
|
|
Best Answer
You can also use:
rule1 = month() != ref(month(), 1);
|
|
|
|
Ching
2015-02-24 23:37:01
0
|
|
What if I want to buy/sell on another trading day of the month (e.g. eighteenth day of the month)?
|
|
|
|
QuantShare
2015-02-25 01:37:52
0
|
|
rule1 = month() != ref(month(), 1);
rule1 = ref(month(), 7); // For the eighteenth day of the month
|
|
|
|
Nuno
2016-06-09 17:20:46
0
|
|
I don't understand why it would work, can you explain this simple code?
|
|
|
|
QuantShare
2016-06-09 18:18:56
0
|
|
My mistake. It should be:
rule1 = month() != ref(month(), 1);
buy = ref(rule1, 6); // For the bar number 7 after the new month
|
|
|
|