Dear Support,
I am trying to write various technical indicators to csv file, when I take a trade (to analyse correlation)
I use this code in the onBar Function
if (bidPrice < prevWeekLow) {
sell(instrument, engine, profitLimit, lossLimit, 0.1);
try {
out.append( sdf2.format(bidBar.getTime()) + ";" + bidPrice )
.append(";" + openPrice)
.append(";" + sma14).append(";" + ema12).append(";" +sma50).append(";" + ema26).append(";" + sma200)
.append("\n");
} catch (IOException e) {
writeMessage("File write error " );
e.printStackTrace();
found on this strategy-api page:
https://www.dukascopy.com/wiki/en/devel ... ars-in-csvThis, however, prints the indicators to CSV file for each bar, and not - as intended - only when a trade is taken.
Can you guide me to a functional solution? It would be helpful if the code also prints the result of the trade (open, close, profit in Pips) at the close of that trade