INNER CODE UNIT · Go
is24hsHighPrice
aleibovici/cryptopump · algorithms/algorithms.go:146
func is24hsHighPrice(
configData *types.Config,
marketData *types.Market,
sessionData *types.Session) bool {
return marketData.Price >= (marketData.PriceChangeStatsHighPrice * (1 - configData.Buy24hsHighpriceEntry))
}
/* Verify that an order is in a sellable time range
This function help to avoid issue when a sale happen in the same seccond as the Buy transaction. Duration must be provided in seconds */
func isOrderInTimeRangeToSell(
order types.Order,
timeRange time.Duration) bool {
timeNow := time.Now()
timeTransaction := time.Unix(order.TransactTime/1000, 0)