[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Looking for help with ApplyStop()



PureBytes Links

Trading Reference Links

Thanks Graham.

I see what you mean. So, I tried the following, to specify the risk
per share as the difference between the Close and the lowest low of
the previous two bars, as follows:

RiskPerShare = C - Ref(LLV(L,2),-1);
ApplyStop( stopTypeLoss, stopModePoint, RiskPerShare, 1, True, 1 );

But this also doesn't work. For example with ILE, my system gave me an
entry on 5 August 2005, and I was hoping that the ApplyStop() would
get me out on 9 August, but instead it got me out on 12 August for a
loss of 21%.

Any ideas what I'm doing wrong? I've searched both the AB library and
the posts here, and I can't find any  examples of this:

Regards,
Paul


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> Applystop uses the amount below the entry price, so you need number of
> dollars in the function that you risk per share
> 
> 
> -- 
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://www.aflwriting.com
> 
> On 08/01/07, polomorabe <paul.moore@xxx> wrote:
> >
> > Hello,
> >
> > I've been trying to apply a stop to my backtest formula, but I can't
> > see how it can be done. From what I can see, this function defines its
> > stop as a percentage or point change from the previous bar. I would
> > like to specify an absolute stop loss, which is how I do it in real
> > trading.
> >
> > For example, I would like to set a stop just below the minimum of the
> > previous two bars.So my trade criteria would be something like:
> >
> > Buy = O > Ref(H,-1) AND
> >       Ref(C,-1) > 1.0 AND Ref(C,-1) < 10.0 AND
> >       Ref(V,-1) > 400000 AND
> >       BarNum > MinBarNum AND
> > Sell = HistInd < Ref(HistInd ,-1);
> > ApplyStop( stopTypeLoss, stopModePoint, Ref(LLV(L,2),-1), 1, True,
1 );
> >
> > Is it possible to do this? The ApplyStop() above doesn't work.
> >
> > A second question. In the buy formula above, it it possible to specify
> > a buy limit, so that gap ups aren't immediately triggered at the open?
> >
> > Many thanks,
> > Paul
> >
> >
> >
> > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/620 - Release Date: 1/8/2007 4:12 PM