I do not understand, how can different date ranges produce different signals for the last bar. The data is the same and expressions like _av_close = MA(C, 200) should work the same regardless the length of the date range, shouldn't they?
For some cases, the rule that does not allow entry and exit at the same bar is the reason but not for all of them. For example, TDY is present in the list on the right but missing from the trades entered on 10th and 11th of February on the left.
Thanks, I found it. TDY was not present among long positions on the left but was present among raw buy signals on Feb 11 on the left but not traded because of low score.
All positions are closed on the next day open at the latest. Now, if the "allow same bar exit / entry signal" flag works on the raw signal level (as its name suggests), not on the actual trade level (as I previously thought), then the referred outcome is completely expectable.
The solution would be to run the backtest from the Feb 12th to the Feb 12th. Among the raw signals, TDY is present but the score is not high enough for trade.
Signals not, but trades taken can depend on date range.
Typically, you have limited cash/buying power and you can't act on all signals. If you change date range it might happen that money is allocated earlier to other trades and you don't have money to open positions that would be opened if trading started on later day.
As always "Detailed log" answers all questions as it lists signals that are not acted upon due to insufficient funds.
To get better understanding of what is happening in your code and how functions work, use advice given here: How do I debug my formula?
It took 3 positions, the 4th was correctly rejected, but what about the following ones? It feels like it is automatically skipping all remaining signals after rejecting TPL. Could that be so?
After turning on frictional shares, the result was following: