Hi Mike, thanks.
I am talking about one symbol, just take the first
signal that appears and remove all others.
Further i made a mistake in my
previous postings, i said "Sell" but it should be "Short".
So for a recap:
I want to take the first signal that appears (Buy or Short) and remove all
other signals for that symbol for that day.
Right now i'm working with
Exrem and got all excessive Buys and Shorts removed, but that still leaves me
with 1 Buy and 1 Short signal a day.
How can i remove this last
excessive Buy or Short signal?
Your idea should work, but i'm not a
great coder so i hope there is a simpler way to do this.
--- In amibroker@xxxxxxxxxps.com,
"Mike" <sfclimbers@...> wrote:
>
> Sorry,
>
> I think that I misread your question. Though, the answer is laregely
the same; you could use custom backtester.
>
> Iterate through
the signals at each bar. If an open position already exists for the symbol,
reset the position size to zero for the new signal if the date of the bar is
the same as the entry date of the open position.
>
> Any attempt
to use arrays outside of the custom backtester using such approaches as flip,
exrem, etc. do not take into account that some signals simply will not get
filled due to portfolio limitations. Thus, custom backtester is the only
reliable way of knowing if a position was *actually* taken.
>
>
Mike
>
> --- In amibroker@xxxxxxxxxps.com,
"Mike" <sfclimbers@> wrote:
> >
> > One sure fire
way to do it would be to write custom backtester code that iterated through
the trade signals at each bar and simply reset the position size to 0 for all
remaining signals.
> >
> > Regardless of how you accomplish
your task, if you are trading more than a single symbol you are at risk of
getting highly biased results. How do you determine which signal occured
first? If you get 3 Buys from 3 symbols on the same bar, which one do you
take? Whatever logic you use to make that determination will bias your
results. You would likely be best to select from the 3 at random.
> >
> > Mike
> >
> > --- In amibroker@xxxxxxxxxps.com,
"chaoss45" <chaoss45@> wrote:
> > >
> > >
> > > Hello all,
> > >
> > > I'm trying
to write code for a breakout system.
> > > Right now i have my
system working (demo) but i'm having trouble to
> > > remove all
excessive signals.
> > > I want to take the first Buy or Sell
signal of the day, and all other
> > > signals for the day
removed.
> > > For example: if the first signal is a buy signal,
all other buy and sell
> > > signals should be removed (or
ignored) but i cannot do it.
> > > I tried Exrem and that is
working fine only for removing the other buy
> > > or sell
signals, but not for removing all the other buy and sell
> > >
signals.
> > > I think it is something simple, but for some reason
i do not see it.
> > > Could somebody help me with the
code?
> > >
> >
>