Posted 2/13/2010 14:53:19
|
|
|
|
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
|
|
|
|
| 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
|
|
|
|
That is what i Ended up doing...but
SystemData.CreateTicksFromBars = false in the startup fixes my problem as well
|
|
|
|