January 13, 2018 at 12:43 pm #44487Jonathan
- Topics: 35
- Replies: 55
- Posts: 90
I am wondering how I backtest 2 theories at the same time.
I could not work it out so I started to play with the following:
As a simple (not recommended) example, in the backtest manager I select All Time Low + DOW THEORY Long.
So in my mind, this is what I am looking for: When the stock hits an ATL, look for next event to trigger a buy. Once DOW THEORY Long (buy) has been triggered than 2 (or more) of my rules have been met and buy on next open.
This is what I find happens – Nothing
Once the stock has hit an ALL TIME LOW, DOW THEORY cannot be triggered as it will no longer be at an ATL.
I found the same to occur when I wanted to have the backtest trigger when I am using MA. It will only trigger if the 2 events occur at the exact same time, not if one happens and the next event is then waited for.January 13, 2018 at 10:25 pm #44495Mathew
- Topics: 29
- Replies: 1,494
- Posts: 1,523
The approach I will always take with this is to test my logic on a chart first. Put the script in a “Show Bar” tool and see if you get any results. If not, then start breaking up the script into components and see what is going on.
What I suspect is that the ATL and the Dow Long will never happen at the same time since there needs to be a confirmed up move for the Dow to be consider in an up trend (unless there is a different rule that I am not aware of). Nevertheless, the show bar exercise will show you that. You could also put the two components in separate show bars and see if there is ever an overlap of signals.
If you do find that there is not an overlap but taking a Dow Long within 10 days of an ATL, then you can use the TimeSinceSignal() function. You can see the lesson on that here: https://learn.optuma.com/course/advanced-scripting/?course_type=content&course_page=1&lecture=2
Hope that helps
Mathew.March 21, 2018 at 1:56 pm #45507Evan
- Topics: 4
- Replies: 6
- Posts: 10
I am also trying some back testing part of which isn’t going as I would expect. I am using the ranking functionality in Version 1.2 and would like to rank stocks and rebalance the portfolio on a weekly basis based on the Hull ROAR function, this seems ok. However I also have a daily moving average crossover of the XJO as a market filter. ie If MA1 is greater than MA2 I can buy, from the ranking list, otherwise I can only sell. In the back test I am using the MA cross as entry criteria and the Hull ROAR function as the ranking function. I have noticed from the test results that the MA function is ignored and buying and selling occurs during periods when MA1 is less than MA2.
Any advice on how to conditionally buy from the ranking list?
- You must be logged in to reply to this topic.