Build script and language config for Iron python based algorithms
This commit is contained in:
@@ -14,57 +14,12 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Python.Runtime;
|
||||
using System.Reflection;
|
||||
using QuantConnect.Data.Market;
|
||||
|
||||
namespace QuantConnect.Algorithm.Python
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the initial implementation of the Python.NET Runtime to pipe .NET events through to a Python Script.
|
||||
/// </summary>
|
||||
public class PythonAlgorithm : QCAlgorithm
|
||||
{
|
||||
|
||||
private IntPtr _gs;
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the Python Algorithm
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
//Start the Python Connector:
|
||||
PythonEngine.Initialize();
|
||||
_gs = PythonEngine.AcquireLock();
|
||||
|
||||
//const string s = @"../../../../tests";
|
||||
//Type RTClass = typeof(Runtime.Runtime);
|
||||
|
||||
///* pyStrPtr = PyString_FromString(s); */
|
||||
//MethodInfo PyString_FromString = RTClass.GetMethod("PyString_FromString", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
//object[] funcArgs = new object[1];
|
||||
//funcArgs[0] = s;
|
||||
//IntPtr pyStrPtr = (IntPtr)PyString_FromString.Invoke(null, funcArgs);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pass Data TradeBars Events Through to Python Algorithm Instance
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
public void OnData(TradeBars data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Tear down the Python engine:
|
||||
/// </summary>
|
||||
public override void OnEndOfAlgorithm()
|
||||
{
|
||||
PythonEngine.ReleaseLock(_gs);
|
||||
PythonEngine.Shutdown();
|
||||
}
|
||||
}
|
||||
/* This is a place holder project for the build script & python file configurations.
|
||||
*
|
||||
* It compiles to a DLL which is deleted after compilation by the python builder.
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user