Prevent re-entering another trade in same week

Questions directed to our Support Team. Responses can be expected within 24 hours.

Prevent re-entering another trade in same week

Postby mandelmus » Tue May 20, 2014 1:30 pm

I'm working on a weekly strategy. For a one-symbol portfolio, is there a way to prevent StrataSearch from re-entering another trade the same week if another trade was already entered and exited? For example, if I went long on AAPL Monday and closed the position on Tuesday, can I prevent StrataSearch from trying to re-enter AAPL on Tuesday, Wednesday, Thursday, or Friday?
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: Prevent re-entering another trade in same week

Postby Overload » Wed May 21, 2014 10:51 am

Sorry, but no, there is no easy way to do that.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: Prevent re-entering another trade in same week

Postby mandelmus » Wed May 21, 2014 1:53 pm

Some things I thought about:
> requiring entry on Mondays (DayOfWeek()=1) and exiting by Friday (daysheld<=5)
> only looking at and/or setting the portfolio size to 1
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm

Re: Prevent re-entering another trade in same week

Postby Overload » Thu May 22, 2014 8:47 am

Those are helpful ideas, but they still will not provide the exact solution you were looking for.

Pete
Overload
 
Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Re: Prevent re-entering another trade in same week

Postby Kevin_in_GA » Thu May 22, 2014 10:04 pm

If you are entering the trade at the open of the trading week, you could require that part of the entry code be dayofweek()>ref(dayofweek(),1) - this would be for backtesting only. This lets you enter only one trade per week, but only on the first trading day of that week.
Kevin_in_GA
 
Posts: 171
Joined: Wed Aug 04, 2010 10:14 am

Re: Prevent re-entering another trade in same week

Postby mandelmus » Thu Apr 16, 2015 1:44 pm

I just discovered that we have to be careful how we use the "or" statement in the exit string:

"dayofweek() > ref(dayofweek(),1) " ... in backtesting, this exits on the last day of the week, as expected

"or dayofweek() > ref(dayofweek(),1)" ... in backtesting, with the "or" statement, this exits one day after the entry, not what I expected


*The entry string was "close > 1.00 and dayofweek() < ref(dayofweek(),-1)" ... to enter on the first day of the week. No other strings were included in the exit string during the backtest.
mandelmus
 
Posts: 141
Joined: Fri Dec 23, 2011 1:51 pm


Return to Technical Support

cron