PureBytes Links
Trading Reference Links
|
I am having a similar problem with eliminating a second (or more)
trades on the same stock during the same day. I have included exrem
to eliminate multiple buys before a sell signal is given and I don't
want to use a time restriction.
What my 3 minute bar system has (in part) is the following:
in_trade = 0; // to control one trade per day
nuday = Day() != Ref(Day(),-1); // to indicate a new day
Then my Buy code is
Buy = in_trade == 0 AND LongCond1 AND {the rest of my buy conditions}
then comes my Sell code
followed by
Buy = exrem(buy,sell);
and
in_trade = Flip( Buy, nuday); / to reset in_trade for the next day
but retain the value (which becomes "1" on the bar where the first
buy is executed).
The system will occasionally issue a second buy signal on the SAME
stock on the SAME day (I can tell because I plot the buy arrows) EVEN
THOUGH the Interpretation window tells me the value of in_trade at
that point is 1 (not 0 as required by the Buy code).
So - 2 questions
1 how can I eliminate the second trade on the same stock on the same
day (my primary objective)?
2. why does the Buy code ignore the in_trade ==0 part of the code?
TIA
Rick
--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>
> you can use exrem to remove additional signals
> you can use code to only include the first signal of the day, or
even
> withi certain time paramters, and exclude others
> It is just matter of adding the right conditions to the buy/sell
statements
>
> Buy = ???;
> Sell = ???;
> Buy = exrem(buy,sell);
>
> eg if you only want to buy beofre 10am in the morning
> Buy = YourBuyConditions and timenum()<100000;
>
> There are a few other ways but could need tailoring to your system
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
>
> On 12/7/05, siu_john <siu_john@xxxx> wrote:
> > Hi Tomasz or anyone,
> > I am doing AA scans/explores on a group or all of my stocks and
in
> > too many times, the signal happens multiple times thru out the
day for
> > the same stock. Thus my results are flooded with too many siganls
> > instead of the only few stocks that are actually returned.
> > I am wondering how do I return either:
> > - the latest signal only per stock (for latest signal purpose)
> > and/or
> > - the first signal and skip to analyse next stocks in question
(for
> > execution speed purpose)
> >
> > Also, is there a _REAL_ reason to seperate the functionality of
Scans
> > and Explorations? I find it that I like reporting power of
> > explorations (Scans don't execute Filters, AddColumn()s, etc.)
and the
> > automation of scans (checkbox of "Scan every x-minutes" don't
apply to
> > explorations). But seems like I can't have both because of the
> > artifically created distinctions.. It would be so great if we can
> > have both! (unless there's a much better reason for the
seperation).
> >
> > thank you so much,
> > -john
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|