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.
only 1 entry per day
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 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.
writing out your thoughts this way will help you to
organize your thoughts into programming codes.
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.
writing out your thoughts this way will help you to
organize your thoughts into programming codes.
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.
Thanks for any suggestion.
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
-
- Posts: 407
- Joined: 01 Jan 2008
- Been thanked: 3 times