Random Exits
Author: deepbuyer
Creation Date: 9/17/2010 8:28 PM
profile picture

deepbuyer

#1
could somebody suggest a quick fix? the code below is meant to test random entry/exit. it buys when rand(1,100)<=50, the position is exited when rand(1,100)>50. the random number needs to be generated at least once per day. entries/exits occur at five minutes before EOD.

i think the entries are random but my exits won't cooperate. the script either exits after 79 bars (SPY, 5-min bars used for testing) or not at all. it should exit as soon as the correct random number is generated.

also, how could i put the random numbers on the 5-min chart of SPY?
any help is appreciated!


CODE:
Please log in to see this code.
profile picture

Eugene

#2
Here's how I think the code could look like, assuming a multi-position, randomized system:
CODE:
Please log in to see this code.
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).