[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

System reports & exporting system data



PureBytes Links

Trading Reference Links



I've always found exporting system data  from TS 4 to be difficult - you can
'include systems' of reporting code to produce .txt or .csv file but has
anyone written code to run a batch file of reports on systems at periodic
intervals, say hourly or daily and export that information to Excel or MS
Access?   Anyone identified the code in TS which produces the existing
system report -would it be possible to execute that command automatically?

As a csv file the report below works once and then second time there are
difficulties opening the file, same with a txt file but the data is less
user friendly to work with. As an excel file its hopeless.   It also
produces a run of zeros for an open position - excepting fixed perameters.
So if you want to write system results per trade and add that to the report
the only way i see is an 'append file' command  which requires fairly
complex string code.   Using a variable and string to declare the system
name for instance would be extremely useful although the example I have is
fairly limited - calculating ROA produces an error message.

Any thoughts or examples of reporting code which you have that works would
be greatly appreciated.

Here is an include system that was posted to the list perhaps a year ago.

Vars: Direct(0);

Direct=MarketPosition;
If CurrentBar=1 then Print(file("c:\report\new.csv"),
"EntryDate",",",
"EntryTime",",",
"ExitTime",",",
"EntryPrice",",",
"ExitPrice",",",
"MarketPosition",",",
"MaxPositionLoss",",",
"MaxPositionprofit",",",
"Slippage",",",
"Commission",",",
"PercentProfit",",",
"MaxConsecWinners",",",
"MaxConsecLosers",",",
"LargestLosTrade",",",
"LargestWinTrade",",",
"GrossProfit",",",
"GrossLoss",",",
    "PositionProfit");
If Direct<>Direct[1] then Print(file("c:\report\new.csv"),
EntryDate(1),",",
EntryTime(1),",",
ExitTime(1),",",
EntryPrice(1),",",
ExitPrice(1),",",
MarketPosition(1),",",
MaxPositionLoss(1),",",
MaxPositionprofit(1),",",
Slippage,",",
Commission,",",
PercentProfit,",",
MaxConsecWinners,",",
MaxConsecLosers,",",
LargestLosTrade,",",
LargestWinTrade,",",
GrossProfit,",",
GrossLoss,",",
PositionProfit(1));