Easylanguage code
To write the file when you buy or sell contract or stocks from your trader Workstation or Vestics code as following:
to buy :
tsimfile='c:\temp\autotrader\ROC-BUY ' + NumtoStr(Date) + ' ' + NumtoStr(time) + '.txt';
if currentbar = Vlastbar and logtrades = 1 then Fileappend(tsimfile,'SELL ' + NumtoStr(close)) ;
to Sell:
tsimfile='c:\temp\autotrader\ROC-SELL ' + NumtoStr(Date) + ' ' + NumtoStr(time) + '.txt';
if currentbar = Vlastbar and logtrades = 1 then Fileappend(tsimfile,'SELL ' + NumtoStr(close)) ;
to turn around your current position:
tsimfile='c:\temp\autotrader\ROC-TURN ' + NumtoStr(Date) + ' ' + NumtoStr(time) + '.txt';
if currentbar = Vlastbar and logtrades = 1 then Fileappend(tsimfile,'SELL ' + NumtoStr(close)) ;
The file name should start with the settings as you have them in General Settings.