Profile Picture

Can the simulation be run in a separate process, for stability purposes?

Posted By Surgo 5 Years Ago

Can the simulation be run in a separate process, for stability...

Posted Thursday February 04 2016
First of all, just started using RightEdge. Absolutely amazing software. I'm new to trading in general and was really happy to find something that provided actual backtesting through arbitrary code that I write and not some silly proprietary scripting language.

I've written my trading systems so far in Python rather than C# because the numeric/scientific stack is both more mature (settled on numpy/scipy long ago) and faster (uses BLAS/LAPACK so can use Intel MKL and friends). My C# code simply sets up a bridge between Python and C# using Pythonnet ( Disabling and re-enabling the Python engine is highly unstable at the moment, and I've not yet been able to successfully disable and enable it without causing a crash. As a result I need to close and re-start RightEdge every time I want to run a new simulation.

So, is it possible that RightEdge could run its simulations a bit more defensively such as by running them in a separate process, so if the sim crashes it won't take down the whole RightEdge process? Plus that way, when a sim ends, all resources that it launched are cleaned up.

If defending against buggy user code seems beyond the scope of RightEdge, perhaps what I can do instead is write a plugin that holds a single Python engine and funnel all requests through it.

Edited: Thursday February 04 2016 by Surgo
Posted Thursday February 04 2016
You can run a simulation via a command line, on a given watchlist and shutdown afterwards by command line:

Best regards,
Richard Dale
Norgate Data
Posted Friday February 12 2016
Each time you run a simulation in RightEdge, it happens in a separate AppDomain.  An AppDomain is a .NET isolation concept.  It's not full isolation though and the main reason RightEdge uses it is to allow the system code to be unloaded after it's done running.

Do you think IronPython would work for you?  It's Python running natively in .NET so you wouldn't have the same interop issues.


Similar Topics

Reading This Topic

2005-2021 © RightEdge Systems