Intraday - Max Entries Per Day
Author: dchristopher
Creation Date: 11/3/2009 11:43 AM
profile picture

dchristopher

#1
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.
profile picture

Eugene

#2
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.
profile picture

trader rog

#3
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.
profile picture

Eugene

#4
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.
profile picture

Sammy_G

#5
Set the counter to 0 at beginning of each trading day.
profile picture

trader rog

#6
Great! Thank you Eugene.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).