StockFetcher Forums · General Discussion · Backtesting in Strata Search<< >>Post Follow-up
graftonian
1,089 posts
msg #142350
Ignore graftonian
2/19/2018 12:38:19 PM

I am tinkering with a sector rotation strategy, and would like to utilize SS for back testing.
The heart of the system would be in the ranking of ETFs in a sector. This would be accomplished in SF, and transferred to SS.
QUESTION:
Does anyone have a clue how to write and entry string that would buy at close on the last day of the month?
The exit string could follow similar logic as the entry string or a $daysheld statement.
Thanks

mahkoh
1,065 posts
msg #142351
Ignore mahkoh
2/19/2018 3:11:35 PM

You could import monthly data and "trick" Stratasearch into thinking that they are daily bars.

nibor100
1,031 posts
msg #142356
Ignore nibor100
2/19/2018 7:01:12 PM

@graftonian,

The thread below from the StrataSearch forum looks like it might have possibilities for what you want to do:

"Reference to condition
Postby Schutten » Tue Feb 01, 2011 4:50 pm

I have the following condition.
Only buy long: dayofmonth()=1 and close>period(monthly,mov(close,10,simple)

With other words on day 1 of the month this value is calculated. Now I want to program that the rest of the month the system can only buy long without recalulating if the condition is still true.
How do I do this?
If it can recaculate multiple times per month I can have a lot of zigzag movements and this is something I don't want.

Regards,Dennis Schutten

Re: Reference to condition
Postby Overload » Tue Feb 01, 2011 5:30 pm

You probably don't want to use DayOfMonth()=1 since the first day of the month might not be a trading day. Instead, I would test whether "today's" month is different from "yesterday's" month. That would look like this:

month() <> ref(month(), -1)

I would then put that in the ValueWhen() formula to identify the close price on the first day of the month:

ValueWhen(month() <> ref(month(), -1), close)

Finally, you can create your filter to make trades only in months where the close price on the first day is higher than the 10-month moving average:

ValueWhen(month() <> ref(month(), -1), close) > period(MONTHLY, mov(close, 10, simple))"

Otherwise the Stratasearch 'Period' command might be of use....

If you haven't already found and tried them,
Ed S.

graftonian
1,089 posts
msg #142363
Ignore graftonian
2/20/2018 12:09:08 PM

@Ed S.
You have given me a direction to go. This is new ground for me.
Thanks

StockFetcher Forums · General Discussion · Backtesting in Strata Search<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.