Coding/Backtesting my strategy where the signals are generated from FA/TA hybrid and saved in excel

Hi everyone,

First time posting but have been reading the threads for a few months now and learning alot along the way. In that time I havent really come across anything that ive been able to mould into what it is im trying to do. Perhaps its because im a newb coder at best and so I fail to see the similarities between others code and what im trying to do. I have some (basic) understanding of VBA and have used prorealtime for a couple years to write scans and indicators etc. Trying to step things up a notch.

Ok so…for simplicity sake…

I would like to backtest a strategy I have been using and get some hard stats on it. However, instead of the buy/sell signals being generated by a set of mechanical parameters that is the same regardless of stock or instrument I derive the signals from a mix of FA/TA etc. So each buy and sell is unique to each code if that makes sense.

I have an excel sheet with my historical signals in it. Stock codes, target buy prices and dates at which I derived the target price and id like to be able to analyse this data in Amibroker.

For example Id like to be able to calculate the probability of the SP hitting my buy target (most of the buy targets are below current SP), how many days it takes, the MFE in the meantime, the MAE and MFE once target is hit etc. and plenty more but I think if I can get this far I can learn the rest along the way.

Id also like to be able to plot the target price and date derived on that date/bar on the chart, in a text box or something.

I’m definitely not expecting someone to code this up for me and id much prefer to learn to do it myself as I have many other projects/ideas collecting dust but Id love to know if this is at least possible before I go grey trying to figure it out on my own.

I really appreciate the help in advance.

Read example given here How to generate backtest statistics from a list of historical trades stored in a file
(Needless to say that the symbols historical price data has to be present in AmiBroker database)

1 Like

Cheers for the reply, it was all I needed really, just to know that what i was aiming for was possible. I went through that same thread numerous times before I posted my question but couldn’t for the life of me get it to work. But to be honest I had very little understanding of AFL or any language for that matter. Anyway, I kept at it and I have managed to do everything I was aiming for in the original Q pretty much. Learned a lot along the way too. Thanks