Limit trade size as of % of entry bar volume in backtest in AFL

I would like to limit trade size as of % of entry bar volume in backtest in AFL. I want to set it to zero. The settings is shown in screenshot below;

image

The AFL function to set backtest options is setoption.
https://www.amibroker.com/guide/afl/setoption.html

I looked at the documentation but cannot find the option to limit trade size as of % of entry bar volume. Maybe I missed out something. Could the more savvy folks here help?

Thank you.

I don't quite understand what you're asking.
If you want to set it to zero, you leave at default as you have shown.
If you don't want to buy any more than say 5% of the day's trading, just type 5 into the box.

I want to set it in AFL. Not set it in the settings window.

1 Like

You really need to learn and make a habit of using Analysis project files (.APX) instead of attempts to put every option in AFL. Analysis project contains BOTH formula and ALL settings. It makes your AFL run faster, shorter and clearer and preserves all settings.

This setting can only be changed from UI and it is part of Analysis project. So use Analysis project (.APX).

2 Likes

Thanks.

I do use Analysis project files (.APX). They are useful for AFL code that doesn't change often. For code that is changing frequently. I don't save the code in apx.

1 Like