"Snap in" solutions don't exist for this. The logic has to be integrated into
your code. Also, if the strategy trades multiple symbols and idea is to use all the free cash to purchase an ETF, so that you're always 100% in the market, then the complexity rises a bit more.
Just thinking about one way you could go about
that, and assuming that market orders must be used...
1. Use the "Position Priority" PosSizer to size positions according to the priority value you assign to a position (See Position Object: Priority in the QuickRef, F11). Assuming that you use 20% sizing for 5 max "signal" positions, you'd configure the sizer like this:
CODE:
Please log in to see this code.
2. For "signal" positions, you always assign a priority between 0.01 and 1.01
ETF logic
3. To always make full use of capital for the ETF, the logic buys the ETF everyday and sells it the next day (even though you may buy fewer or more shares again). The priority that you assign to the ETF will determine how much you buy as follows:
3a. Count how many signals (alerts) you have and add it to how many active positions you'll continue to hold tomorrow, which is the ActivePosition.Count minus exits. Be careful to store the AP.Count before actually exiting positions on bar + 1, since executing exits will cause the count to change during backtesting.
3b. Subtract the number above from the number of max Positions (which is 5 in our example) to obtain the priority for the ETF Position.
Example: Lets say you'll have 3 signals positions (e.g., 1 active position and 2 alerts). That means you need to buy a 40% ETF position. The priority is 5 minus 3 = 2, which corresponds to the 40% position in the PosSizer.
If the number is 0 or less, then the priority assigned to the ETF trade is 0 (for 0% sizing).
Hopefully that helps (and makes sense).