I have built a custom indicator that produces entry signals given some conditions that I was interested in watching. The indicator works great, and it does the thinking for me so that I can focus on context.
I would like to do a bit of back testing on it, and I am seeking some advice and counsel on how I might go about accomplishing the following high level objectives:
1. I want to assign each indicator entry with an entry price, Maximum Adverse Excursion ("MAE") and Maximum Favorable Excursion ("MFE") for each incoming tick.
2. Then, for each incoming tick, I want each entry's MAE and MFE to be updated.
3. If the incoming tick pulls price through a user defined stop value (in ticks) for one of the entries, I would like the "stopped" entries to set the MAE to the stop loss value, and then stop incrementing the MFE because the stop has been hit and therefore that trade would be finished.
4. Therefore, with each incoming tick, entries that had a MAE equal to the stop value would be skipped over.
5. I then want to export the entries' MAE and MFE to a csv file--or if that is too difficult, to a output window where I could copy the results and then paste them into excel, where I could massage the data to extract the entry number, MAE and MFE from the copied data.
Given the above, it seems that some sort of an array or DataSeries would be the best vehicle to use, but I'm not quite sure how to go about this. So I'm looking for some high level structure advice and recommendations that I can use to get going. I would hope that the initial high level advice would then allow me to get going, at which point I would ask progressively more detailed questions as necessary.
So to start off, I'm looking for initial direction (ie, use an array or use a DataSeries or use an ArrayList or whatever), at which point I can google my google off to get going.
Please do not hesitate to shoot me any questions.
Thanks in advance!
Aventeren
Comment