Daytrading Strategy won't exit
Author: dankimel
Creation Date: 10/1/2009 5:21 PM
profile picture

dankimel

#1
I'm trying to backtest a daytrading strategy where my trades will be in the chronological order that they occur, so I'm using time as a priority. This part of the code seems to be working, but now the part of the code which exits the positions never seems to be executed. Any suggestions about what's wrong? Here's the code:


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

Eugene

#2
QUOTE:
but now the part of the code which exits the positions never seems to be executed.

The reason is that your exit routine looks for an entry signal to contain either "Group1|" or "Group2|" in the SignalName property, while your actual signal name is the result of GetTime(bar).ToString("0.00").
profile picture

Eugene

#3
Simply rewrite the exit routine like this:
CODE:
Please log in to see this code.
profile picture

dankimel

#4
Thanks, Eugene, for pointing out the obvious. Now the code works fine.
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).