Plot particular Trades

Posted By: dr_panther

Plot particular Trades - 09/08/16 07:39

I would like to visually analyze some particular trades after testing. Therefore I'd like to plot each of these trades individually, to have a microview on them. That means each trade on one plot, eg. 10 trades => 10 plots.

I am aware of the fies testtrades.csv, and the log. Basically I need the testtrades.csv on a singleton chart for each trade.

What is the fastest way to achieve that?
Posted By: jcl

Re: Plot particular Trades - 09/08/16 09:56

You could create an individual plot on a new chart, with a name derived from the trade ID.
Posted By: dr_panther

Re: Plot particular Trades - 09/08/16 12:32

Thanks for the tipp, I tried it, but the x-axis stays the same for all trades. I would like to zoom into each particular trade.
Posted By: jcl

Re: Plot particular Trades - 09/08/16 12:35

The charts have all the same scale, so for zooming you must run a separate test for every trade.
Posted By: webradio

Re: Plot particular Trades - 09/16/16 14:47

I hat a somewhat similar need of viewing long time series and ended up with saving a bunch of plots in R and viewing them with IrfanView (or any other viewer understanding left and right arrow keys...)

Code:
N <- 1100
set.seed(1234)
mkt <- data.frame(EURUSD=1+0.01*cumsum(rnorm(N)), GBPCHF=1+0.01*cumsum(rnorm(N)))
#just random numbers... could you guess that by looking on charts?

plt.wid <- 250
plt.overlap <- 50
for (i in seq(from=0, to=nrow(mkt), by=plt.wid-plt.overlap)) {
  idx.from <- max(c(i,1))
  idx.to <- min(c(idx.from+plt.wid, nrow(mkt)))
  idx <- idx.from:idx.to
  png.file.name <- paste0("./plot_",formatC(idx.from, width = 5, format = "d", flag = "0"),"-",formatC(idx.to, width = 5, format = "d", flag = "0"),".png")
  png(file=png.file.name, width = 1600, height = 900, units = "px", pointsize = 16)
  old.par = par(mfcol=c(2,1), mar=c(2,4,1,2), bg="#555555")
  plot.default(idx, ylab="EURUSD", as.vector(mkt$EURUSD[idx]), pch=19, col=topo.colors(24))
  plot.default(idx, ylab="GBPCHF", as.vector(mkt$GBPCHF[idx]), pch=19, col=topo.colors(24))
  par(old.par)
  dev.off()
  if (idx.to>=nrow(mkt)) break
}
#never mind plot.default() and as.vector(), it was written for working with xts
#the color is just to help synchronizing top and bottom series while viewing


This code produces plots like this one. You "just" need to read.csv("testtrades.csv") and plot lines between entries and exits.



Disclaimer: I do not compare MC vs Zorro nor do I recommend anything



If convenient zooming down to particular trade after test run is important for you, you might want to take a look on downloads.ampfutures.com/multicharts-free
They will offer you also a demo (time-limited) data feed account with e.g. CQG, but you don't have to open it, as long as you are ready to import price data yourself (QuoteManager.exe).
No clue if and when they'll let the platform stop working, the text says currently "forever".

I stumbled upon MC as I was looking for a charting tool able e.g. to paint different aggregations (like 1000tick and 5minutes) synchronized by time

(never mind "LMAX", it was made completely offline from ASCII data)
© 2024 lite-C Forums