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

[amibroker] Re: Using different stops for Buy and Short trades.



PureBytes Links

Trading Reference Links

Different stops for Long and Short Trades.

1. set a variable inLong and inShort to tell you when you are in a 
long trade versus a short trade.
Note that the following works for me because of the settradedelay. 
Might not work for you:
inLong = Ref(Flip(Buy,Sell),-1);
inShort = Ref(Flip(Short,Cover),-1);
2. Then you might want to use the following: (different percentages 
for long versus short)
ApplyStop(stopTypeProfit,stopModePercent,IIf(InLong, LPerCentProfit, 
SPerCentProfit), True, False) ;  

--- In amibroker@xxxxxxxxxxxxxxx, Keith McCombs <kmccombs@xxx> wrote:
>
> I would like to use|
> ApplyStop(*stopTypeNBar*, *stopModeBars*, numbars);
> with two different values of numbars, one for long trades and the 
other 
> for short ones.
> 
> Is there any straight forward way to do this?
> 
> I am pretty sure that I can implement the effect without using 
> ApplyStop(), but I would be using looping (and probably be 
reinventing 
> the wheel).
> 
> TIA.
> -- Keith
> |
>



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

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

*********************
TO GET TECHNICAL 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

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