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

[amibroker] Re: Forumla For Stops



PureBytes Links

Trading Reference Links




Thanks Cdkeylstra for your reply

The problem I was having was because I was not defining the BuyPrice.
I found this code on the web in Back Testing Your Trading Ideas which solved the problem.

Buy = buyformula;
priceatbuy = 0;

  for ( i = 0; i < BarCount; i++)
   (
     if ( priceatbuy == 0 && Buy[i]
       priceatbuy = BuyPrice[i];
   }


--- In amibroker@xxxxxxxxxxxxxxx, "cdkylstra" <cdkylstra@xxx> wrote:
>
> Hi Austin,
> 
> Don't know if you will ever see this, or have already figured out the solution.
> 
> It is a simple IF test, that you already expressed.
> 
> if( TrailingStop > BuyPrice )  Stop = TrailingStop;  
> else Stop = InitialStop;
> 
>  
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "austin.lawrence24" <austin.lawrence24@> wrote:
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "austin.lawrence24" <austin.lawrence24@> wrote:
> > >
> > > I need help with formula for the following task and will be grateful for any guidance.
> > > 
> > > Buy = "buy formula"
> > > Buyprice = open
> > > initial stop = Buyprice - LLV(L,period)
> > > trailing stop = "trailing stop formula"
> > > trailing stop becomes effective when it's value is > Buyprice
> > > 
> > > Thanks to anyone who can help.
> > >
> > In view of the fact no one has responded to my request for help I can only assume my query was too difficult or too stupid to warrant a response.  I am new to AmiBroker and Computer programming at this level so I would be really grateful if anyone could suggest where a novice like myself can get help with programming issues.  Most problems I have had I have been able to solve by refering to articles on the website but sometimes the answers are not that easy to find.
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/