ApplyTo filter must include all symbols you are trading

Moderator comment: This has been moved to a new thread as [completely unrelated](Hidden windows don't paint in Windows OS, was: Signal not getting fired, unable to reproduce to the other question from the other thread (OP did not use CBT)

What version of Amibroker are you using? And what version of MS MFC/VS library files?

I'm asking because I have a problem with a CBT where I call Amibroker's backtester object bo.EnterTrade() and it never returns, even though nothing seems wrong with the inputs. I am suspecting perhaps an incompatibility of some type with the MS environment since I recently updated it. It would be useful to hear someone else running into similar issues. Perhaps it could be hunted down.

I'm running AB 6.16 and VS 2019 (with all the implied updated libraries).

@anon55440944: one thing that will make bo.EnterTrade() never return is if you try to simultaneously open more positions than 2x the number of symbols in your watchlist.

Yes, the number of positions being opened is greater than 2x. Is there any way around this limitation? I use watchlists to point to other watchlists, encoding a hierarchical network I use for inference and position sizing. The filter setting just points to the entry into the hierarchy. It's pretty fundamental to what I'm doing and would require a lot of re-coding not to do it.

This is NOT limitation. This is COMMON SENSE.

Quite OBVIOUSLY the Apply to: Filter setting must include ALL symbols you are trading.

That is totally obvious: "Apply to" setting by definition means APPLY MY system to that selection of symbols.

Why obviously? Because AmiBroker MUST prepare and cache data for symbols you are trading !!!

Actually it cares about number of simultaneously open positions on different symbols. You can't have more simultaneously (on any given bar) active (traded) symbols than number of symbols in "Apply to". (In fact AmiBroker keeps track of 2x as much because at least in theory each symbol may be trading in different currency and then for each trade you need to keep track of symbol being traded and extra currency)

Without that AmiBroker would be slow as OTHER products on the market. But it is orders of magnitude faster. Why? Because it does miracles with caching. But to do those miracles you have to play by the rules.

You need to note that it is NOT limitation of ANY kind because the fact that you are INCLUDING symbols in "Apply To" filter does not mean that you actually have to generate SIGNALS for any of them in first phase. You can easily have Buy=Sell=0 rules for all of them but they MUST be in "Apply To" since complex caching system requires to know the number of symbols under test.

In fact it is virtually impossible to normally include symbols outside of Apply To selection because signals are generated only on such symbols. The only exception is LOW LEVEL backtest. But when you are using LOW LEVEL backtest, you are on your own. Power brings responsibility. You should expect unexpected if you are using unexpected things.