Truncate trade rate wma window sizes
							parent
							
								
									c985c01c62
								
							
						
					
					
						commit
						49f3e15a3c
					
				| 
						 | 
					@ -167,6 +167,7 @@ def _wma(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert length == len(weights)
 | 
					    assert length == len(weights)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # lol, for long sequences this is nutso slow and expensive..
 | 
				
			||||||
    return np.convolve(signal, weights, 'valid')
 | 
					    return np.convolve(signal, weights, 'valid')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -309,7 +309,7 @@ async def flow_rates(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if period > 1:
 | 
					        if period > 1:
 | 
				
			||||||
            trade_rate_wma = _wma(
 | 
					            trade_rate_wma = _wma(
 | 
				
			||||||
                dvlm_shm.array['trade_count'],
 | 
					                dvlm_shm.array['trade_count'][-period:],
 | 
				
			||||||
                period,
 | 
					                period,
 | 
				
			||||||
                weights=weights,
 | 
					                weights=weights,
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
| 
						 | 
					@ -332,7 +332,7 @@ async def flow_rates(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if period > 1:
 | 
					        if period > 1:
 | 
				
			||||||
            dark_trade_rate_wma = _wma(
 | 
					            dark_trade_rate_wma = _wma(
 | 
				
			||||||
                dvlm_shm.array['dark_trade_count'],
 | 
					                dvlm_shm.array['dark_trade_count'][-period:],
 | 
				
			||||||
                period,
 | 
					                period,
 | 
				
			||||||
                weights=weights,
 | 
					                weights=weights,
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue