That helps a lot! Thanks.
--- In [email protected], "claudecaruana" <claudecaru...@...> wrote:
>
> Hi,
> you can detect the timeframe you are currently using and then close the
> position accordingly.
>
> E.g. if you are using a 1 minute timeframe, you can close at 15:59, with a 5
> minute, 15:55, 10 minute, 15:50 etc...
>
> The code should look something like:
> if (interval() == 60) {sell=timenum()==155900;}
> if (interval() == 300) {sell=timenum()==155500;}
>
> ...and so on....
>
> refer to the helpfile for the interval values.
>
> hope it helps!
>
>
>
> --- In [email protected], "shakerlr" <ljr500@> wrote:
> >
> > I'm using the backtester (and getting used it it), and would like to close
> > all my positions at the end of the day (between 3:50-3:55). Currently I do
> > it like this in the backtester:
> >
> > Sell = (Cross(Graph0,C) AND Cross(graph1,c))
> > OR TimeNum() >= 155000;
> >
> > But if I use a timeframe higher than than 1,5,10 minutes, it does not get
> > triggered because the bar is not created yet...and I end up closing the
> > position on the next day. Is there anyway to say I want all positioins
> > closed at 1500-1600 hours?
> >
>