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

[amibroker] Stop issue



PureBytes Links

Trading Reference Links

I can't figure out why the stop in the following example doesn't work 
right Could someone help me understand why?
under applystop in the users guide it says the following: 
 Scenario 2: 
you trade on today's close and want to exit intraday on stop price
Correct settings: 
ActivateStopsImmediately turned OFF
ExitAtStop = 1
Trade delays set to zero
Trade price set to close

OK, that's what I want to do. What happens is the system buys at the 
close as it should. On the day following the trade, the system 
sometimes stops out based on the high of the buy bar instead of 
calculating the stop based on the buy price. Why does this happen?
Here's an example of the code:
//Set Parameters						
			   
SetOption("NoDefaultColumns",0);				
	   
SetOption("InitialEquity",25000);				
			   
SetOption("AllowSameBarExit",0);				
			   
SetOption("ActivateStopsImmediately",0);			
				   
SetOption("AllowPositionShrinking",1);				
			   
SetOption("FuturesMode",0);					
		   
SetOption("InterestRate",0);					
		   
SetOption("MaxOpenPositions",1000);				
			   
SetOption("MinShares",.001);					
						   
SetOption("CommissionMode",2); //$ per trade			
				   
SetOption("CommissionAmount",10);				
			   
SetOption("MarginRequirement",100); //No margin			
				   
SetOption("ReverseSignalForcesExit",0);				
			   
SetOption("UsePrevBarEquityForPosSizing",1);			
				   
SetTradeDelays(0,0,0,0); 					
			
BuyPrice = SellPrice = C;		   			
		   		
BuyPrice = C;                                                    
							   
SellPrice = C;  						
	
Buy = C>MA(C,20) ;                                                    
					   
Sell = 0;                                       	
	                                                   
ApplyStop( stopTypeTrailing, stopModePercent, 5,1); 		
					   
		  


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

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