1 minute strategy appears to hang before Execute() ?
Author: haytac
Creation Date: 3/2/2020 10:44 AM
profile picture

haytac

#1
Hi,

My 1 minute strategy worked on Saturday, Feb 29 for Friday Feb 28.
The exact same strategy was hanging on Sunday March 1.
Same result early Monday morning.

I have a PrintDebug statement right after "protected override void Execute()".
I do not see it in the debug window.

Could there be an issue with WL Pro checking one minute data for Friday and not finding it as it expects?
For example due to Saturday being Feb 29m once every four years?
Or some other inconsistency in the data?

I uninstalled WL Pro and re-installed.
Cleared all data (provider Fidelity).
Nothing seems to help.

I am hoping that after market open on Monday it will start working again.

I have a per day strategy to prepare for the 1 minute one: setting values for globals. It works fine.
Also I open the per day first. So when I open the per minute it runs in day mode first.
That run (1m strategy running in day mode) works with a typical error message.
This leads me to believe: WL Pro does not like the 1m data somehow.
What could have changed in that data from Saturday to Sunday?

Thanks
profile picture

Eugene

#2
Hi,

Your thinking that "hangs before "protected override void Execute()"" is most likely incorrect. Unless FlushDebug follows the first PrintDebug statement, something else down in the code may have caused the script to hang. Check out the QuickRef to learn more on how PrintDebug actually works.

There are not enough details in your question and too many factors are at play: your unknown script of 130K lines (yes I keep this in mind), unknown symbols, unknown "typical error message" etc.

Instead of reinstalling WLP (which is harmless but useless), your best bet is to debug your strategy under Visual Studio. Otherwise it's just guesswork.
profile picture

haytac

#3
I was using .SPX
Switched to .DJI
after downloading 1 minute data (I can see it in Fidelity Static Provider folder) and running the strategy got the following message:
run time error: root element is missing
in XLinkedListElementArray; Read18_item()
I had seen this with fresh .SPX data and fresh .IXIC data.
Wonder if this is a clue?

I am now experimenting with Apple data.
Will see what happens after market open.
Post results then.
Thank you for your time.
profile picture

haytac

#4
If you have a one minute strategy handy perhaps running it might provide a clue.
AAPL gives the same root element is missing message
it turns out AAPL instead of hanging the second time around with 1m strategy
Keeps giving the same root element missing message and I see a bunch of printdebug message
in the debug window.

this gives me enough to work on today (Monday).
Will post results later today (I am in California).
profile picture

Eugene

#5
QUOTE:
after downloading 1 minute data (I can see it in Fidelity Static Provider folder) and running the strategy got the following message:
run time error: root element is missing
in XLinkedListElementArray; Read18_item()
I had seen this with fresh .SPX data and fresh .IXIC data.
Wonder if this is a clue?

This may be a clue. How many 1-minute bars do these symbols contain (Data Manager > Symbol Details)?
profile picture

haytac

#6
AAPL 7114
.DJI 7114
.IXIC 7114
.SPX 7115

not clear if this is for 1m data or day data
profile picture

Eugene

#7
Looks quite like EOD on the surface (but Minute data may end up abruptly if you're hitting a "bad" server at Fidelity). You will be certain about the Scale if you simply look at synonymous column in the Data Manager. If you run a system on intraday data you should have a DataSet containing them.
profile picture

Eugene

#8
profile picture

haytac

#9
Not sure if this is relevant:
since the new update with new login (like ATP) I noticed that

using System.Xml;
using System.Xml. Serialization;

have Xml underlined in red by the compiler.
Although this did not prevent running normally.

Notice that WL Pro 6 requires .NET Framework 4.5
My machine is Windows 10 and it has .NET Framework 4.8

Not able to download 4.5 as it says you have a later version.

Question: is WL Pro compatible with .NET 4.8 especially for Xml parts.
profile picture

Eugene

#10
No it's not relevant. If you search for 6.9.20...22 related topics you will find find this question answered many times by Cone and yours truly.
profile picture

haytac

#11
Thanks!
Is there a viewer for the Fidelity 1 minute data?
I opened it in Notepad++ not possible to make sense of it.
Tried to upload it but it is a 75 MB file.

Added PrintDebug statements to see:
Bars.Count - 1
date
idbn
High

but the program hangs with no output to PrintDebug

I wonder if there is something an alert box in JavaScript to see program flow, to see the last line before it hangs.

Wonder if:
a) you have other customers who have raise a similar issue
b) if you have a 1minute strategy to try at your end
c) or if you recommend one from the ones that come in the WL package?

I have been at this for about 8 years now. Never lost more than one day of work. This might become an exception.
Thank you for your time.
profile picture

Eugene

#12
How about the simple test in my posts #5 & 7 above?
profile picture

Cone

#13
QUOTE:
Is there a viewer for the Fidelity 1 minute data?
The chart's a pretty good viewer (and of course you can right click the chart and copy the data). If it doesn't load in the chart - or simply because it seems like a symbol's data has a problem - just delete the WL data file and refresh the data.
profile picture

haytac

#14
Thank you for your support. And steering me away from wrong paths.
I was able to see that the last bar of the day had the correct value and correct IDBN.

I am working to locate the issue in my code.
Started by placing PrintDebug right after Execute() section and at the end of it.
The strategy did not hang. This pointed the issue to my code.

By inserting stops in various places I am inching closer to pinpointing the issue.
Will share results if it is more than an assumption that I made that the market invalidated.

Thanks again. Being a lone developer can be a tough experience from time to time.
Fidelity was helpful too.
I made the input to consider providing WL level C# functionality in ATP.
They said they heard this before.
profile picture

Eugene

#15
QUOTE:
I am working to locate the issue in my code.
Started by placing PrintDebug right after Execute() section and at the end of it.
The strategy did not hang. This pointed the issue to my code.

You can trust me on that it almost always comes down to an "issue in my code" even though it doesn't seem so initially. ;)

But it must be hard to be in your position, troubleshooting a 130K line strategy by "pinpointing the issue" with PrintDebug() rather than VS2019. :)
profile picture

haytac

#16
Here is an update:
- I had a fixup for option name if third Friday of April was also Good Friday.
- This code did not take into account the 29th of February every four years
I commented the code out and everything works fine.
At some point I will try to fix the code.

By the way my code is approaching 300,000 lines.
It is a way of adding patterns.
Visually the logic is not complicated.
But to translate it into code is a different issue.
Difference between human perception and translating it into words.
The problem of AI really.

A good treatment is in Hubert Dreyfus' 40 year old book: "What Computers Can't Do".

Keep adding patterns and still stuck between 25 - 30 % hit ratio.
Good enough to make money as each loss is much smaller than gains.

However, I do not quite understand why this is so. If you have any insight would be appreciated.

Another good book is James Simons technical biography: "The man who solved the market" by Gregory Zuckerman.
Renaissance Capital hit ratio is a little over 50%.

Thanks again for all the help. Hope you two are not retiring soon. Maybe you have replaced yourselves with code already.
profile picture

Eugene

#17
QUOTE:
By the way my code is approaching 300,000 lines.

Wow, you're nearing Quake 3 engine! :) Someday soon you'll get introduced to this hall of fame, you deserved it:

https://informationisbeautiful.net/visualizations/million-lines-of-code/

QUOTE:
Maybe you have replaced yourselves with code already.

Well, it's a long term goal. ;) For a couple of years I've been running an auto-response bot trained for the typical support tasks like program crash and display issues, to reset a Wealth-Lab Developer trial on request of a returning user etc. Of course it has its share of false positives but overall works nice.

Another bot inserts comments to the forum on schedule, notifying about monthly Wealth-Lab Extension updates (like fixes and implemented feature requests), changes to W-D Classification Groups etc.

A now decommissioned bot had been saving me from the manual task of processing Wealth-Lab Developer maintenance renewals before such feature appeared in our backend. It even had a behavioral activity analyzer (AI) to determine the actual user and his key (customers can own multiple license keys and cooperate). To err is human, and you would not believe how many people specified erratic Wealth-Lab accounts or unknown names when making a purchase order. But the bot was able to crack this.

Of course there are numerous other internal "daemons" but they aren't designed to represent me.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).