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

[amibroker] How does it work III



PureBytes Links

Trading Reference Links

DJ, I think I can help with one part of your question.  You need to 
have two separate functions for long and short stop losses.

Here's my code:
Lpos=Flip(Buy,Sell);
Spos=Flip(Short,Cover);
LSL=3;//Optimize("LongStopLoss",3,3,4.5,.10);
SSL=4.7;//Optimize("ShortStopLoss",5,4.5,5,.10);
SL=IIf(Lpos,LSL,IIf(Spos,SSL,0));
ApplyStop(0,1,SL,2);

As you can see the amount used for this stop loss depends on whether 
the trade was long or short.  Hope this helps somewhat!  Sorry I 
cannot be of more help with your other ?'s.



--- In amibroker@xxxxxxxxxxxxxxx, "hotdayinlimbo" <dj@xxxx> wrote:
> Hi all,
> 
> I have an indicator (volatility stop) that sits under the price 
bars 
> and only re-draws lower when taken out by a low value, otherwise it 
> holds its value or creeps up.  
> 
> My Q:  How does Applystop work with an indicator in the 'amount' 
> field?  Does it take the entry price and subtract the value for a 
> long entry?  Should I use Sell=Low < Volstop?  I am having trouble 
> with either solution.  I also don't understand how applystop can 
> work for longs and shorts at the same time.  If I want to use the 
> high of the entry bar for shorts and the low for longs how does 
> applystop accomplish this?
> 
> Thank you,
> 
> DJ



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/