// NewTypPrice creates a Typical Price Indicator (TypPrice) for online usage
548385
func NewTypPrice() (indicator *TypPrice, err error) {
	ind := TypPrice{}
	ind.TypPriceWithoutStorage, err = NewTypPriceWithoutStorage(func(dataItem float64, streamBarIndex int) {
		ind.Data = append(ind.Data, dataItem)
	})

	return &ind, err
}
935252
func NewTernaryIfExpr(cond, tx, fx Expr, pos Pos) *TernaryIfExpr {
	return &TernaryIfExpr{pos, cond, tx, fx}
}
869642
func (pgb *ChainDB) TicketsByPrice(maturityBlock int64) (*dbtypes.PoolTicketsData, error) {
	ctx, cancel := context.WithTimeout(pgb.ctx, pgb.queryTimeout)
	defer cancel()
	ptd, err := retrieveTicketByPrice(ctx, pgb.db, maturityBlock)
	return ptd, pgb.replaceCancelError(err)
}
908598
func (s *Offering) SetFixedPrice(v float64) *Offering {
	s.FixedPrice = &v
	return s
}
475219
func newToplist(s *Session, ttype toplistType, r ToplistRegion, user *User) *toplist {
	var cusername *C.char
	if user != nil {
		cusername = C.CString(user.CanonicalName())
		defer C.free(unsafe.Pointer(cusername))
	}

	t := &toplist{session: s, ttype: ttype}
	t.wg.Add(1)
	t.sp_toplistbrowse = C.toplistbrowse_create(
		t.session.sp_session,
		C.sp_toplisttype(ttype),
		C.sp_toplistregion(r),
		cusername,
		unsafe.Pointer(t),
	)
	runtime.SetFinalizer(t, (*toplist).release)
	return t
}
1129432
func (c *MempoolDataCache) GetTicketPriceCountTime(feeAvgLength int) *apitypes.PriceCountTime {
	c.mtx.RLock()
	defer c.mtx.RUnlock()

	numFees := len(c.allFees)
	if numFees < feeAvgLength {
		feeAvgLength = numFees
	}
	var feeAvg float64
	for i := 0; i < feeAvgLength; i++ {
		feeAvg += c.allFees[numFees-i-1]
	}
	feeAvg /= float64(feeAvgLength)

	return &apitypes.PriceCountTime{
		Price: c.stakeDiff + feeAvg,
		Count: numFees,
		Time:  dbtypes.NewTimeDef(c.timestamp),
	}
}
1187798
func (s *ReservedNodeOffering) SetFixedPrice(v float64) *ReservedNodeOffering {
	s.FixedPrice = &v
	return s
}
896361
func (s *LaunchConfiguration) SetSpotPrice(v string) *LaunchConfiguration {
	s.SpotPrice = &v
	return s
}
411892
func (dc DefaultClock) NewTicker(d time.Duration) Ticker {
	return &defaultTicker{*time.NewTicker(d)}
}
289316
func (s *DescribeReservationOutput) SetFixedPrice(v float64) *DescribeReservationOutput {
	s.FixedPrice = &v
	return s
}
683291
func (s *DeleteReservationOutput) SetFixedPrice(v float64) *DeleteReservationOutput {
	s.FixedPrice = &v
	return s
}
1101919
func (s *ReservedDBInstancesOffering) SetUsagePrice(v float64) *ReservedDBInstancesOffering {
	s.UsagePrice = &v
	return s
}
503421
func TypPrice(inHigh []float64, inLow []float64, inClose []float64) []float64 {

	outReal := make([]float64, len(inClose))
	outIdx := 0
	startIdx := 0

	for i := startIdx; i < len(inClose); i++ {
		outReal[outIdx] = (inHigh[i] + inLow[i] + inClose[i]) / 3.0
		outIdx++
	}
	return outReal
}
552605
func parsePrice(data []string) *Price {
	p := &Price{}
	p.Bid, _ = strconv.ParseFloat(data[2], 64)
	p.Ask, _ = strconv.ParseFloat(data[3], 64)
	p.Open, _ = strconv.ParseFloat(data[4], 64)
	p.PreviousClose, _ = strconv.ParseFloat(data[5], 64)
	p.Last, _ = strconv.ParseFloat(data[6], 64)
	p.Date, _ = parseDate(data[7])

	return p
}
434487
func (s *ReservedDBInstance) SetFixedPrice(v float64) *ReservedDBInstance {
	s.FixedPrice = &v
	return s
}
491881
func MidPrice(high, low []float64, timePeriod int32) []float64 {
	var outBegIdx C.int
	var outNBElement C.int
	outReal := make([]float64, len(high))
	C.TA_MIDPRICE(0, C.int(len(high)-1), (*C.double)(unsafe.Pointer(&high[0])), (*C.double)(unsafe.Pointer(&low[0])), C.int(timePeriod), &outBegIdx, &outNBElement, (*C.double)(unsafe.Pointer(&outReal[0])))
	return outReal[:outNBElement]
}
953866
func (p *Packet) NewTCPPayload(newPayload string) error {

	if p.tcpLayer.Payload != nil {
		return errors.New("payload already exists")
	}

	p.tcpLayer.Payload = []byte(newPayload)

	return nil
}