AccountTradeLog
Posted: Thu Jul 20, 2017 4:50 am
Your last stop on a way to find a fast growing community of forex traders and software developers. Best forex charts indicators are available here for download. Custom development of indicators and translation to .LUA is also available on request.
http://fxcodebase.com/code/
function logTable(fileHandle, tableName, tableColumns)
local enum, row,value;
enum = core.host:findTable(tableName):enumerator();
row = enum:next();
while row ~= nil do
for column = 1, #tableColumns do
value = row:cell(tableColumns[column])
fileHandle:write(tostring(value) .. Separator);
end
symbol=row.Instrument
local enum2, row2;
enum2 = core.host:findTable("offers"):enumerator();
row2 = enum2:next();
while row2 ~= nil do
if row2.Instrument==symbol then
pips=row2.PointSize;
end
row2 = enum2:next();
end
limit= math.abs(row.Close - row.Limit) / pips;
stop= math.abs(row.Close - row.Stop) / pips;
limit=math.floor(limit)
stop=math.floor(stop)
fileHandle:write(limit);
fileHandle:write(",");
fileHandle:write(stop);
fileHandle:write("\n")
row = enum:next();
end
---fileHandle:flush(MergeFileHandle);
fileHandle:close()
end