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

[amibroker] ApplyStop Exit Order??



PureBytes Links

Trading Reference Links

Hi

With multiple ApplyStop exits how do you control the order they are executed?

 

In the below code I want to exit first using this line

ApplyStop( stopTypeProfit, stopModePoint, 0.00001, 0 );

 

But if the above is not true then exit using the line

ApplyStop(stopTypeLoss,   stopModePoint, 30, 1 );

 

I notice if both exits are true on the same bar then the exit defaults to the points stop loss.

How do you code it so the stopTypeProfit exit is checked first and if true then the stopTypeLoss exit is ignored

 

 

Buy = DayOfWeek() == 1;

BuyPrice = Open;

Sell = 0;

 

/* --------------------- Exits ------------------------------*/

SellPrice = Open;

ApplyStop( stopTypeProfit, stopModePoint, 0.00001, 0 );           // First Profitable Open Exit

ApplyStop(stopTypeLoss,   stopModePoint, 30, 1 );                   // Points Exit

 

Any help would be appreciated.

Peter



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