I could not find the code for this in the manual or the WIKI. I want to exit a position after 10 days if it didn't hit my profit target or stoploss. I'm looking for something like:
if (BarsSinceEntry > 10)
{
.........sell........
}
Thanks
Andy
Size:
Color:
QUOTE:
I want to exit a position after 10 days if it didn't hit my profit target or stoploss.
The correct way to approach this problem is by putting the time-based exit first and letting the stop/target follow:
CODE:
Please log in to see this code.
For more details, please refer to Programming Trading Strategies > Peeking >
Order of Trading Signals in the WealthScript Programming Guide.
Size:
Color:
Thx for the quick help.
Size:
Color:
Hi Eugene,
Would it is possible to implement time out exit (close positions after X days) in real time trading?
Thanks
Size:
Color:
Size:
Color:
Eugene,
Thank you very much for your help pointing to these examples.
Size:
Color: