# only 1 entry per day

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
raven
Posts: 31
Joined: 17 Oct 2009
Been thanked: 1 time

### only 1 entry per day

When trading on 5 minute bars on a multi-day chart (=day after day is charted on a 5 minute base), how to manage it that only 1 entry per day is made if condition for entry is met? (Problem: conditions are met several times a day but only the first match should be traded.)

Does anybody know? Many thanks in advance.

TJ
Posts: 7372
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2105 times
just add a counter to the code.

if an order is filled... counter = 1.

if counter is larger than zero, then don't trade anymore.

the above is called pseudo code...
it is plain English... written in semi computer logic.
organize your thoughts into programming codes.

raven
Posts: 31
Joined: 17 Oct 2009
Been thanked: 1 time
That's a good idea, but to use it on a chart with more than one day with 5 minute bars (as described above) I would have to reset the counter at the end of each day. Otherwise trading would stop after the first trade for all following days. This is a matter especially when backtesting.

Thanks for any suggestion.

TJ
Posts: 7372
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 996 times
Been thanked: 2105 times
you have the right idea...

you just have to reset the counter everyday !!!

QED

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times
I'm not a great EL programmer but to reset the counter, I think you could do something simple like-

if date <> date[1] then counter = 0;

Maybe someone else could supply an example of the counter code, to help him out. We're not all programmers here, most are traders, learning to program.

raven
Posts: 31
Joined: 17 Oct 2009
Been thanked: 1 time
Special thanks to steven for the code. Here is my way (and it works):

variable: counter(0);

condition1 = marketposition <> 0;
if condition1 then counter = counter + 1;
if time this bar = 1000 then counter = 0;

"time this bar" is the time when I want to reset the counter.