RightEdge Forums
Main     Home          Members     Calendar     Who's On

Welcome Guest
        



Set minimum bars to hold Expand / Collapse
Message
Posted 2/13/2010 14:53:19 Post #10853
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
How can I set a profit target on a position after it has been held 1 bar?

The reason for this, is that in my backtest, if I set a profittarget right away, the position exits based on the high of the day, even though, i may have bought it after the high occured. Very tough to prevent this...so I would like to set min bars held somehow and then set profit target

Any idea if this is possibld?
Posted 2/13/2010 17:46:39 Post #10855
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
In the newbar event check for open positions and then set the target if they have been open for more than one bar. You will need to check the trade open date compared to current bar date for the number of bars it was open.
Posted 2/14/2010 07:32:43 Post #10868
 

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru
That is what i Ended up doing...but

SystemData.CreateTicksFromBars = false in the startup fixes my problem as well
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: billb

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 3:18pm

2005-2007 © RightEdge Systems