Multi code backtest seems off (sorry for the duplicate)

Sorry for the duplicate, thought I had found an issue but turned out it was unrelated.

I may just be miss understanding how the multi code test works, but it is giving me trades that don’t accurately match my rules.

I understand that it won’t enter a trade if cash isn’t available, but it just seems plain wrong.

Single Code

On a single code chart it enters correctly:
(Rule is clear the peak after consecutively higher troughs (Gann swing entry) AND a green histogram within a 10 bar lookback)

Multi Code

This is the same period and stock when run as part of a multi code backtest of the asx100.

It pretty much completely ignores the lookback for the histogram, but if I remove that from the rules the trades changes so it is still taking it into account somehow. The histogram is a pascal tool if that makes any difference, but should just spit out +1, -1 or 0.

Once again, any ideas or help would be greatly appreciated.

Entry rule script:

Rev = REVERSALPATTERNSBACKTESTING(); //The Pascal histogram tool
RevBack = BarsTrue(Rev == -1, Lookback = 10) > 0; //Check if it's been -1 in the last 10 bars 
Res = (RevBack and SCRIPT(ScriptName = GannSwingEntry)); //Check for higher trough and cleared peak AND reversal pattern in last 10 bars. 
Res; 

This is usually the result of no more capital being available. In the multi-code test, there are other potential signals that could have been traded at times when these signals have fired. If you look at the trade list around that time, you will be able to work out if this is the case.

This also highlights why Signal Testing is so important (I discuss the path dependency of backtests in https://optuma.com/quant)

Thank you for the reply Mathew. The video was great and I will definitely be checking out the course.

I do understand that the availability of cash and other factors may prevent a buy from occurring. However, the issue is that I am getting buys when there shouldn’t be any.

I only have one buy script/rule going during that test, indicated by the green bands, and a single sell script/rule indicated by the red bands (and a stoploss). So I cannot figure out why the trade entry in the image has occurred.

Ended up recreating the pascal tool in script and it now functions as expected (I assumed it was going to be something on my end but was hoping someone had come across the issue before.)

Presumably how I was indexing the indicator was not playing nicely with how the backtester looks for things and it ended up being out of sync.