Backtesting day trading strategies that are flat at end of day
Author: wdfarmer
Creation Date: 1/29/2009 12:39 AM
profile picture

wdfarmer

#1
Subject should read:
Backtesting day trading strategies that are flat at end of day

How can a strategy be designed to exit all positions at the end of each trading day, as a Day Trader would normally do? Ideally, the strategy should avoid entering a position when the time is near market close time. Would this require programming, or can it be done by rules?
profile picture

Eugene

#2
QUOTE:
How can a strategy be designed to exit all positions at the end of each trading day, as a Day Trader would normally do?


What a difference a search makes! ;)

End-of-day Exit condition

To exit all positions, pass Positions.AllPositions instead of LastPosition.

Also a couple of examples in our Wiki:
ID Breakout System
Intraday / Multi-Time Frame | Mixing intraday and daily data

QUOTE:
Ideally, the strategy should avoid entering a position when the time is near market close time.


You could the same WealthScript keyword to check that before making entry:

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).