while EasyLanguage is very good for developing trading strategies, it is missing a lot of the functionality typical programming languages have. These include more fancy data types and access to the file system. One way to overcome these issues, is to use ELCollections, which admittedly is great. Here is a different approach how to do this: By integrating the Lua language interpreter w/ MultiCharts.
Here is a quick example what you can do with this:
Code: Select all
//==============================================================================
// Name: _fub_Lua_Test
// Description: simple Lua test project
// History: 2015xii11, FUB: created
//==============================================================================
variables:
LuaState (0);
once begin
ClearPrintLog;
//==============================================================================
// demo #1: set and get global variables, run calculation
LuaState = Lua.New();
// set global variables
Lua.SetGlobalNumber(LuaState, "a", 17);
Lua.SetGlobalNumber(LuaState, "b", 4);
// run calculation
Lua.Exec(LuaState, "c = a + b");
// get global variables
value1 = Lua.GetGlobalNumber(LuaState, "c");
print("c = ", value1);
Lua.Close(LuaState);
//==============================================================================
// demo #2: save data to file
LuaState = Lua.New();
Lua.Exec(LuaState, "f = io.open([[C:\Users\Felix Bertram\Desktop\Lua.txt]], [[w]])");
Lua.Exec(LuaState, "f:write([[Lua says hello!]])");
Lua.Exec(LuaState, "f:close()");
Lua.Close(LuaState);
end;
//==============================================================================
// end of file
http://www.lua.org/docs.html
This code requires the Lua 5.3 DLL. You will most likely want the Windows 64 DLL package, which you find here:
http://luabinaries.sourceforge.net/download.html
This code is in early stages, more as a proof of concept. There is lots more to do, e.g. passing strings back and forth between MultiCharts and Lua. However, I believe it might already useful "as is". Any comments welcome!
Cheers, Felix