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

Re: [amibroker] Frustrated with fixed stops



PureBytes Links

Trading Reference Links

Hello,o

The simplest way is just to use ApplyStop

LongStopAmount = BuyPrice - ( L - 0.01 ); 
ShortStopAmount = ( H + 0.01 ) - ShortPrice; 
ApplyStop( stopTypeLoss, stopModePoint, IIf( Short, ShortStopAmount, LongStopAmount ) ); 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "moneypro" <protrader0668@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, December 30, 2005 5:06 AM
Subject: [amibroker] Frustrated with fixed stops


>   Can anybody help me with my codes here, please. I am trying to buy
> at Inside bar high, put a fixed stop at low. Sell at fixed number of
> bars later (eg, End of day). 
>   
> BuySetup = inside();
> BuyStop = ValueWhen(BuySetup,H+0.01);
> SellStop = ValueWhen(BuySetup,L-0.01);
> Buy = Cross(H,BuyStop);
> Sell = Cross(SellStop,L);
> 
> ExRem(Buy,Sell);
> ExRem(Sell,Buy);
> BuyPrice = Max( BuyStop, O );
> SellPrice = Min(SellStop,H);
> 
> The problem is: if another "inside()" bar shows up before SellStop is
> hit, a new SellStop will be automatically set at higher level (because
> of the new BuySetup. So, the SellStop level is moved up. I just want
> to keep it where it is. What can I do? Use Flip()? How? Thanks
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 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/