AFAIK, you can't pass values to a <<macro>> that way. You have to use the macrocall widget. Then, to get the result of that call into a single variable, you'll need the wikify widget.
I couldn't test, because I don't have your macro. In the following, I guessed that your macro parameters were w, p, and f. Change appropriately. Also, be sure to have a backup:
\define my-actions()
<$wikify name=myval text="""<$macrocall $name=TLfilter w={{!!window}} p={{!!period}} f='[tag[test-2]sort[date]]'/>""" >
<$action-setfield $field="stampId" $value=<<myval>> />
</$wikify>
\end