Hi, I am trying to modify the Max Entries simuscript for intraday backtesting on a 5min. My understanding is that the Max Entries is limiting the number of entries per bar. Since a 5min intraday has lots of bars per day, it seems like I need to convert the intraday bars to daily. I have made many attempt using SetScaleDaily and ChangeScale (#Daily) and GetDaily but I just cannot figure out the right combination. Can someone point me in the right direction? Thank you.
Size:
Color:
SetScaleDaily/ChangeScale do not work in simuscripts.
You need to count all active positions taken "today" using time functions (OK to use in simuscripts) and don't take the position if that counter > max allowed entries (by setting the size to 0 or breaking out of the loop). When new day comes, you reset the counter.
Size:
Color:
Hi, I would like to limit entries to one per day using intraday bars. I use a counter in my code just not sure how to apply it to intraday positions.
In a nutshell, how to make PositionsToday counter below apply to positions initiated today only?
CODE:
Please log in to see this code.
Thanks to anyone that can help.
Size:
Color:
This is a legacy Wealth-Lab 4 discussion.
In Wealth-Lab 6, the
Position Option PosSizer will do it. Unlike the built-in "Max Positions Per Day", it sums up intraday positions taken during the day.
Size:
Color:
Set the counter to 0 at beginning of each trading day.
Size:
Color:
Great! Thank you Eugene.
Size:
Color: