Trading Options through underlying

I have created an afl for backtesting options as mentioned by many using a watchlist and it worked wonderfully well. Multiple options can be traded at a time in this afl.

For deeper understanding i want to change variables based on the chronological order of the trade on each day.

But i am running into an issue as the trades in backtest report are not in order as you can see in the image below.

How can i fix this?

Any help is greatly appreciated.

Trade list IS in order of Trade EXIT. You can change this by sorting by any column (in the Analysis window).

Thank you for your response sir.

This is the query. In the basic afl that I have written I only have access to the current ticker, but I would like to know the number of trades and the order of the trades across all the tickers in a specific day so that I can further manipulate the variables and indicators for deeper understanding of the system.

It seems (it is NOT clear) that you want to programmatically access trade list on bar by bar basis. If that guess is correct, then the answer is in the Users Guide:

https://www.amibroker.com/guide/h_custombacktest.html

When asking questions please follow this advice: How to ask a good question
It is important that your post SUBJECT line reflects what you are asking for. Current subject does not reflect the question.

Thank you for you patience sir.

Yes I do want to access trade list because in my current risk management I also looks for the no. of a particular trade in a day to size it to my need. But in portfolio backtester I am unable to do this.
It seems that custom backtest is the answer to my query.

My current thinking is to access trade signals and then sort them using entry time and then apply the position size to the trades as I want.
Am I in the right direction?

Any help is hugely appreciated.

Did you click on the link I have given? It contains answer to your question.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.