- ago
After countless hours of processing through the evolution of multiple strategies, some of them simply not execute. I've narrowed these down to what appears to be any strategy using an ATR indicator with a -1 or a -2 lookback producing an "out of range" error. The strategy produces metrics without incident during optimization and ranking, and also when in execution, but will not execute orders over my TDA API. I know the problem is not the TDA API since other strategies I run that do not employ the ATR indicator (with a negative lookback) will push orders just fine.

Have you run into this before?

0
814
Solved
17 Replies

Reply

Bookmark

Sort
- ago
#1
Hmm, even a 1-bar ATR is nonsense because the underlying TrueRange (TR) indicator requires at least 2 bars of data to build. Let alone negative numbers. We need to take a look into this.
0
- ago
#2
Thx Eugene. But, ... are you asking me to send you something or not?
0
Cone8
 ( 21.65% )
- ago
#3
ATR(1) shouldn't be a problem, same as TR.
An image of the evolved Strategy would help!
0
- ago
#4
Thanks Cone! The strategies I refer to are Evolved using this platform, and they all backtest and optimize properly with no apparent issue. It's just that, when the strategy(s) are dragged to the Strategy Monitor and then activated to place orders to the Dummy Broker, what I received instead of order opportunities are errors referring to an "out of range" condition.

I'll send over the image you request along with the wording of the order asap.
Thanks again.
0
- ago
#5
Things like that can happen when evolving so you have to do sanity check to drop strategies with impossible parameter combos like 1-day ATR or below.
0
- ago
#6
OK, so far I've read that it will work, and that it will not work.
I don't know what a sanity check is (if you mean that technically ;-)) but here is a copy of the error produced when I try to execute the strategy ...

Timestamp Source Message Exception
"4/13/2022 10:11:48:282" "Dummy Broker" "Dummy Broker Broker: Welcome Neverlong, you are now connected to our Dummy Broker!"
"4/13/2022 10:11:50:184" "TD Ameritrade" "TD Ameritrade Broker: Connected to TD Ameritrade."
"4/13/2022 10:13:38:857" "TD Ameritrade" "Connected"
"4/13/2022 10:22:03:824" "WL7" "Specified argument was out of the range of valid values. (Parameter 'Index out of Range: ( ATRBandLower(Bars,Close,21,1.89), 1007) ')" "Specified argument was out of the range of valid values. (Parameter 'Index out of Range: ( ATRBandLower(Bars,Close,21,1.89), 1007) ')"

Having difficulty getting you an image of the strategy though.

0
Cone8
 ( 21.65% )
- ago
#7
The problem is definitely not a 1-period ATR. ATR(1) is just TrueRange, totally valid.

Please, post an image of the troubled Strategy. You can capture a screen image by striking Windows Key+Shift+S, drag around the image to capture. It's saved to the clipboard, but when the thumbnail pops up in the system tray, click on it to open. Then in the upper right corner, click the disk icon to save it as a png.

Just noticed - this is WL7, not WL8?

Also - it just occurred to me to ask, are you using any of the 6-10 Slots in the Evolver Preferences? If so, I need to see those Strategies too.
0
- ago
#8


How is that?
0
Glitch8
 ( 15.20% )
- ago
#9
Well, the Evolver has free reign to try anything, and in this case it did something that I think we need to prevent! I'm going to add some logic to ensure that parameter never goes below 0 during a mutation. Thanks for bringing this to light.
0
Best Answer
- ago
#10
Glitch, OK, I understand the evolver will try everything, but when the strategy is backtested, and then Optimized and re-backtested, it consistently produces positive profitable results as well as other positive metrics. My expectation is that if an ATR(1) is impossible or "insane" then I would not receive positive backtest results.

I only receive error messages when the strategy is "activated" wherein an "out of range" error is thrown.

Thanks for looking at this for me.
0
- ago
#11
After reading your last response, I ran a couple dozen more runs to see what that produced, as I was hopeful that Cone's comments (above) might have merit. What I found was that the evolver can be materially inconsistent.

For example...
The "exact" same strategy parameters, when executed against the exact same updated datasets produce completely and materially different results, on the same computer. A real bummer.

Furthermore, I found that the "exact" same strategy parameters, when executed against the exact same (Cloned) updated datasets also produce completely and materially different results, run at the same time on DIFFERENT computers.

I really want to be wrong about something here, so why do you think this is the case?

PS: In all cases however, the ATR-1 strategy I presented above consistently produces profit, APR and win rates considerably higher than all others, even with minor variations to the other blocks.
0
Glitch8
 ( 15.20% )
- ago
#12
The exact same strategy with the exact same parameters of course can produce materially different results. This is just the effect of having more entry signals than simulated equity. It results in NSF position, that WL draws from randomly unless a transaction weighting is used. Here’s a video that explains it more:

https://youtu.be/HXA-AetQ3Jk
0
Glitch8
 ( 15.20% )
- ago
#13
To remove the effect and get consistent results run to run you’ll have to decrease the position size until you get zero NSF Positions in your Metrics Report.
0
- ago
#14
Aha, so if I employ a weighting method, as Robert's Youtube explains should I expect the ranking tool to produce results that are more consistent? I'll give that a shot and see what happens. Thx

PS: I'm sticking with WL7 for now as WL8 is having problems with many of my evolved strategies. Most were wiped out.
0
Glitch8
 ( 15.20% )
- ago
#15
Yes if you employ a transaction weight then the same simulated trades will be taken each run.
0
- ago
#16
OK thanks. The variations from run to run seems to have improved, bu employing the methods you recommended below.

However, this ATR-1 issue (above) continues to reappear with nearly every genetic evolution I run, every day. I'm still running WL7 for now, but do you thisk this problem has been resolved with WL8?
0
Cone8
 ( 21.65% )
- ago
#17
Yes, this was fixed in Build 3, version 8.
○ Genetic Evolver will no longer mutate negative values for Indicator Compare to Indicator N Bars Ago.

Even if that wasn't fixed yet, I can't think of any reason to be dabbling in Version 7 any longer.
0

Reply

Bookmark

Sort