PureBytes Links
Trading Reference Links
|
Help with time exits please,
I want to exit the market after "X" number of periods. The problem is that when the number of periods is met, TS2000i exits all open positions. Here is a simple example of what I'm talking about.
After 3 consecutive up or down closes a trade to buy or sell is initiated and is scheduled to be offset at the close of the following day. On day2, if the initiating condition is still true it will add another position but offset all open positions. What I’m trying to do I hold the last position till day3.
Since I’m interested in time offsets I can’t see any way around using the “BarSinceEntry” function but I need it to be a little more discriminating about the number and timing of offsets.
Thanks,
Joe
Input: LEConsec(3),SEConsec(3),Length(1);
IF MRO(Close <= Close[1],LEConsec,1) = -1 Then Buy("LCC") on Close;
IF MRO(Close >= Close[1],SEConsec,1) = -1 Then Sell("SCC") on Close;
If BarsSinceEntry = Length Then
Exitlong ("ExitLong") from entry("LCC") 1 contract This Bar on Close;
If BarsSinceEntry = Length Then
Exitshort ("ExitShort") from entry("SCC") 1 contract This Bar on Close;
|