Thanks Robert but this page is tricky for web scraping from a technical standpoint, making the resulting example code for @gchudublin a bit lengthy / challenging to read. Fortunately, they host a RSS feed for halts at
http://www.nasdaqtrader.com/rss.aspx?feed=tradehalts so I managed to come up with a 10-liner as parsing RSS is trivial in .NET.
PREREQUISITES:1. In the Strategy Editor, click "References..." and check
System.Xml on the .NET Framework tab.
2. Switch to "Other assemblies...", click "Add a reference...", navigate to c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ and add
System.ServiceModel.dllCode:
CODE:
Please log in to see this code.
@gchudublin
To improve script's performance I suggest caching the
Halts() output in Wealth-Lab's global memory (GOP) and working with the cached copy. Otherwise my script makes an RSS request each time it runs. Server may penalize excessive requests by banning the user.
UPDATEHere's a caching version. To reset the cache, make sure to either call ClearGlobals() in your script once a day or restart WLP.
CODE:
Please log in to see this code.
To automate GOP cleanup, a possible enhancement might be to save halt date (delivered in the RSS feed) and check whether it's current (no action required) or is out of date (and call ClearGlobals() then).