Setting in Code vs Settings in the UI

If we writing some settings on the code like below:

PosQty = 20;
SetOption("MaxOpenPositions", PosQty );
SetPositionSize( 5, spsPercentOfEquity );

And then also define the settings in the UI

image

Which of these settings will be applied (since both are different) during backtesting?

In my experience, the lower value for max open positions will apply, irrespective if it is in the code or the analysis settings.

By sheer coincidence, I actually leave my Analysis settings Max Open Positions set to 25 and just rely on the afl (where it is set anywhere from 5 to 20 depending on the strategy).

1 Like

What you have set in the FORMULA (SetOption) takes precedence over the settings.
This applies to everything.

No, that is not the case. Code always has precedence. If code says 20 max open positions, it will open 20 positions, regardless if you have less in the settings dialog.

3 Likes

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