| 
					
				 | 
			
			
				@@ -6,7 +6,7 @@ import ( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"math" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-const TradingRange = .01 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const TradingRange = .02 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 func NewOrder( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	m sentio.Market, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -36,14 +36,14 @@ func NewOrder( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	opts.StopLoss = sentio.ToFixed(rm.StopLoss(opts.Symbol, bid), 2) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	// Prevent orders those have too small expected profit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	if opts.TakeProfit < bid*(1+TradingRange) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if opts.TakeProfit < bid+TradingRange { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		err = sentio.ErrLowTakeProfit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	// Prevent cases when order will be closed ASAP they were opened. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	// Also, Alpaca requires at least 0.01 gap against base_price 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	if opts.StopLoss > bid*(1-TradingRange) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if opts.StopLoss > bid-TradingRange { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		err = sentio.ErrHighStoploss 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 |