• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ price函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中price函数的典型用法代码示例。如果您正苦于以下问题:C++ price函数的具体用法?C++ price怎么用?C++ price使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了price函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: market_history_record

 market_history_record(price highest_bid = price(),
                       price lowest_ask = price(),
                       share_type volume = 0,
                       fc::optional<price> recent_average_price = fc::optional<price>())
   : highest_bid(highest_bid),
     lowest_ask(lowest_ask),
     volume(volume),
     recent_average_price(recent_average_price)
 {}
开发者ID:371061198,项目名称:bitshares_toolkit,代码行数:9,代码来源:market_records.hpp


示例2: market_history_record

 market_history_record(price highest_bid = price(),
                       price lowest_ask = price(),
                       price opening_price = price(),
                       price closing_price = price(),
                       share_type volume = 0)
   : highest_bid(highest_bid),
     lowest_ask(lowest_ask),
     opening_price(opening_price),
     closing_price(closing_price),
     volume(volume)
 {}
开发者ID:drltc,项目名称:bitshares_toolkit,代码行数:11,代码来源:market_records.hpp


示例3: price

int StaticHashTableBuilder::calcBestModulus (){
	int bestPrice  = price (1);
	int bestMod    = 1;
	for (size_t i = 2; i < 3 * mHashes.size(); i++){
		int p = price (i);
		if (p < bestPrice){
			bestPrice = p;
			bestMod   = i;
		}
	}
	return bestMod;
}
开发者ID:byzhang,项目名称:sfserialization,代码行数:12,代码来源:StaticHashTableBuilder.cpp


示例4: main

int main(int argc, char **argv) {
  parse_args(argc, argv);

  float res = price(n);
  printf("Price is: %f\n", res);

  for (int i = 0; i < runs; i++) {
    start_run();
    res = price(n);
    end_run();
    printf("Price is: %f\n", res);
  }
}
开发者ID:HIPERFIT,项目名称:futhark-fhpc16,代码行数:13,代码来源:blackscholes-baseline.c


示例5: rate

void KEquityPriceUpdateDlg::storePrices()
{
  // update the new prices into the equities

  MyMoneyFile* file = MyMoneyFile::instance();
  QList<MyMoneySecurity> equities = file->securityList();

  QTreeWidgetItem* item = 0;
  MyMoneyFileTransaction ft;
  QString name;

  try {
    for (int i = 0; i < lvEquityList->invisibleRootItem()->childCount(); ++i) {
      item = lvEquityList->invisibleRootItem()->child(i);
      // turn on signals before we modify the last entry in the list
      MyMoneyFile::instance()->blockSignals(i < lvEquityList->invisibleRootItem()->childCount() - 1);

      MyMoneyMoney rate(item->text(PRICE_COL));
      if (!rate.isZero()) {
        QString id = item->text(ID_COL).toUtf8();

        // if the ID has a space, then this is TWO ID's, so it's a currency quote
        if (QString(id).contains(" ")) {
          QStringList ids = id.split(' ', QString::SkipEmptyParts);
          QString fromid = ids[0].toUtf8();
          QString toid = ids[1].toUtf8();
          name = QString("%1 --> %2").arg(fromid).arg(toid);
          MyMoneyPrice price(fromid, toid, QDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL));
          file->addPrice(price);
        } else
          // otherwise, it's a security quote
        {
          MyMoneySecurity security = MyMoneyFile::instance()->security(id);
          name = security.name();
          MyMoneyPrice price(id, security.tradingCurrency(), QDate().fromString(item->text(DATE_COL), Qt::ISODate), rate, item->text(SOURCE_COL));

          // TODO (Ace) Better handling of the case where there is already a price
          // for this date.  Currently, it just overrides the old value.  Really it
          // should check to see if the price is the same and prompt the user.
          MyMoneyFile::instance()->addPrice(price);
        }

      }
    }
    ft.commit();

  } catch (const MyMoneyException &) {
    qDebug("Unable to add price information for %s", qPrintable(name));
  }
}
开发者ID:CGenie,项目名称:kmymoney,代码行数:50,代码来源:kequitypriceupdatedlg.cpp


示例6: simulation

double MUPD::calc_mu_per_d(
        const SharedMember<Consumer::Differentiable> &con,
        Member::Lock &lock,
        id_t mkt_id,
        const allocation &alloc,
        const Bundle &b) const {

    if (mkt_id == 0)
        return con->d(b, money);

    auto sim = simulation();
    auto mkt = sim->market(mkt_id);
    lock.add(mkt);

    double mu = 0.0;
    // Add together all of the marginal utilities weighted by the output level, since the market may
    // produce more than one good, and quantities may not equal 1.
    for (auto g : mkt->output_unit)
        mu += g.second * con->d(b, g.first);

    double q = alloc.quantity.count(mkt_id) ? alloc.quantity.at(mkt_id) : 0;
    auto pricing = mkt->price(q);

    lock.remove(mkt);

    if (!pricing.feasible) {
        throw market_exhausted_error(mkt_id);
    }

    return mu / pricing.marginal * price_ratio(mkt);
}
开发者ID:erisproject,项目名称:eris,代码行数:31,代码来源:MUPD.cpp


示例7: main

int main()
{
  typedef float T;
  double t(0),v(0);
  {
    std::vector<T> price     (128000);
    std::vector<T> strike    (128000);
    std::vector<T> rate      (128000);
    std::vector<T> time      (128000);
    std::vector<T> volatility(128000);
    std::vector<T> call      (128000);
    std::vector<T> put       (128000);

    std::fill(price.begin(),price.end(),1.);
    std::fill(strike.begin(),strike.end(),1.);
    std::fill(rate.begin(),rate.end(),1.);
    std::fill(time.begin(),time.end(),1.);
    std::fill(volatility.begin(),volatility.end(),1.);

    std::cout << "std::vector\n";
    for(int k=0;k<100;++k)
    {
      nt2::tic();
      for(std::size_t i=0;i<price.size();++i)
      blackscholes( price[i], strike[i] , rate[i] , time[i] , volatility[i]
                  , call[i] , put[i]
                  );
      t += nt2::toc(false);
    }
    std::cout << t/100 << "\n";
  }

  v = call();
  std::cout << "Speed-up: " << t/v << "\n";
}
开发者ID:alphaprime,项目名称:nt2,代码行数:35,代码来源:blackscholes.cpp


示例8: run

function run()
{
	vars Price = series(price());
	vars Trend = series(LowPass(Price,1000));
	
	Stop = 100*PIP;
	TakeProfit = 100*PIP;
	if(valley(Trend)) {
		//plotPriceProfile(50,0);
		enterLong();
	} else if(peak(Trend)) {
		//plotPriceProfile(50,PMINUS);
		enterShort();
	}

	PlotWidth = 1000;
	PlotHeight1 = 320;
	PlotScale = 4;
	
	//plotDay(Equity,PDIFF); 
	//plotWeek(Equity,PDIFF); 
	//plotMonth(Equity,PDIFF); 
	//plotYear(Equity,PDIFF); 
	plotTradeProfile(50);
}
开发者ID:AttilaForgacs,项目名称:zorro,代码行数:25,代码来源:profile.c


示例9: name

void MainWindow::populateStore()
{

    int row = 0;
    int i = 0;
    for(auto item : store) {
        QString name(item.first.c_str());
        QString price(QString::number(item.second));
        QPushButton *button = new QPushButton(name);
        QLabel *label = new QLabel("$"+price);
        button->setObjectName(name);
        label->setObjectName(price);
        shopSignalMapper->setMapping(button, name);
        connect(button, SIGNAL(clicked()), shopSignalMapper, SLOT(map()));
        label->setAlignment(Qt::AlignCenter);
        ui->shopLayout->addWidget(button, row, i, Qt::AlignCenter);
        ui->shopLayout->addWidget(label, row+1, i, Qt::AlignCenter);
        QSize widgetSize(50, 50);
        button->setFixedSize(widgetSize);
        label->setFixedSize(widgetSize);
        i++;
        if(i == 9) {
            i = 0;
            row += 2;
        }
    }
}
开发者ID:vladimiroff,项目名称:regularity,代码行数:27,代码来源:mainwindow.cpp


示例10: run

function run()
{
	BarPeriod = 240;	// 4 hour bars
	
// calculate the buy/sell signal
	vars Price = series(price());
	vars DomPeriod = series(DominantPeriod(Price,30));
	var LowPeriod = LowPass(DomPeriod,500);
	vars HP = series(HighPass(Price,LowPeriod));
	vars Signal = series(Fisher(HP,500));
	var Threshold = 1.0;

// buy and sell
	Stop = 4*ATR(100);
	Trail = 4*ATR(100);
	if(crossUnder(Signal,-Threshold))
		enterLong(); 
	else if(crossOver(Signal,Threshold))
		enterShort();

// plot signals and thresholds
	plot("DominantPeriod",LowPeriod,NEW,BLUE);
	plot("Signal",Signal[0],NEW,RED);
	plot("Threshold1",Threshold,0,BLACK);
	plot("Threshold2",-Threshold,0,BLACK);
	PlotWidth = 600;
	PlotHeight1 = 300;
} 
开发者ID:AttilaForgacs,项目名称:zorro,代码行数:28,代码来源:Workshop5_1.c


示例11: PyInt

void Contract::GetContractRow( PyPackedRow* into )
{
    into->SetField( "contractID",			new PyInt(		contractID() ) );
    into->SetField( "issuerID",				new PyInt(		issuerID() ) );
    into->SetField( "issuerCorpID",			new PyInt(		issuerCorpID() ) );
    into->SetField( "type",					new PyInt(		type() ) );
    into->SetField( "availability",			new PyInt(		avail() ) );
    into->SetField( "assigneeID",			new PyInt(		assigneeID() ) );
    into->SetField( "numDays",				new PyInt(		0 ) );
    into->SetField( "startStationID",		new PyInt(		startStationID() ) );
    into->SetField( "endStationID",			new PyInt(		endStationID() ) );
    into->SetField( "startSolarSystemID",   new PyInt(		startSolarSystemID() ) );
    into->SetField( "endSolarSystemID",		new PyInt(		endSolarSystemID() ) );
    into->SetField( "startRegionID",		new PyInt(		startRegionID() ) );
    into->SetField( "endRegionID",			new PyInt(		endRegionID() ) );
    into->SetField( "price",				new PyFloat(	price() ) );
    into->SetField( "reward",				new PyFloat(	reward() ) );
    into->SetField( "collateral",			new PyFloat(	collateral() ) );
    into->SetField( "title",				new PyWString(	title().c_str(), title().length() ) );
    into->SetField( "description",			new PyWString(	description().c_str(), description().length() ) );
    into->SetField( "forCorp",				new PyBool(		forCorp() ) );
    into->SetField( "status",				new PyInt(		status() ) );
    into->SetField( "acceptorID",			new PyInt(		acceptorID() ) );
    into->SetField( "dateIssued",			new PyLong(		dateIssued() ) );
    into->SetField( "dateExpired",			new PyLong(		dateExpired() ) );
    into->SetField( "dateAccepted",			new PyLong(		dateAccepted() ) );
    into->SetField( "dateCompleted",		new PyLong(		dateCompleted() ) );
    into->SetField( "volume",				new PyFloat(	volume() ) );
    into->SetField( "issuerAllianceID",		new PyInt(		issuerAllianceID() ) );
    into->SetField( "issuerWalletKey",		new PyInt(		issuerWalletKey() ) );
    into->SetField( "acceptorWalletKey",	new PyInt(		0 ) );
    into->SetField( "crateID",				new PyInt(		0 ) );
}
开发者ID:Almamu,项目名称:evemu_apocrypha,代码行数:33,代码来源:Contract.cpp


示例12: upc

 // Copy Constructor
 Good::Good(const Good& other) {
   upc(other._upc);
   name(other._name);
   price(other._price);
   qtyNeeded(other._qtyNeeded);
   taxed(other._taxed);
   quantity(other._quantity);
 }
开发者ID:QingLianLiu,项目名称:OOP244,代码行数:9,代码来源:Good.cpp


示例13: main

int main(void){
	int rep = 0;
	for (scanf("%d", &rep); rep > 0; --rep){
		double x;
		scanf("%lf", &x);
		printf("f(%.2lf) = %.2lf\n", x, price(x));
	}
	return 0;
}
开发者ID:My-Favorites,项目名称:CProgrammingLanguage,代码行数:9,代码来源:30053.c


示例14: makePrice

void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMoney& _price )
{
  MyMoneyFileTransaction ft;
  MyMoneyFile* file = MyMoneyFile::instance();
  MyMoneySecurity curr = file->currency(_currencyid);
  MyMoneyPrice price(_currencyid, file->baseCurrency().id(), _date, _price, "test");
  file->addPrice(price);
  ft.commit();
}
开发者ID:sajidji94,项目名称:kmymoney2,代码行数:9,代码来源:reportstestcommon.cpp


示例15: upc

  // operator=
   Item& Item::operator=(const Item& RO){
      upc(RO._upc);
      name(RO._name);
      price(RO._price);
      quantity(RO._quantity);
      taxed(RO._taxed);
      qtyNeeded(RO._qtyNeeded);

      return *this;
   }
开发者ID:NikitaKoren,项目名称:oop345,代码行数:11,代码来源:Item.cpp


示例16: run

function run()
{
	NumYears = 2;
	BarPeriod = 1440;
	PlotWidth = 800;
	PlotHeight1 = 300;
	ColorUp = ColorDn = 0; // don't plot a real price curve
	set(PLOTNOW);
	
	asset("EUR/USD");
	plot("Price",price(),0,RED);	
	
	vars Random = series(0);
	if(Bar == 1)
		Random[0] = price();
	else
		Random[0] = Random[1] + 0.01*random();
	plot("Random",Random[0],0,BLUE);	
}
开发者ID:AttilaForgacs,项目名称:zorro,代码行数:19,代码来源:RandomPrice.c


示例17: sku

		Product::Product(const char* s, const char* n, double x, int i, bool tax) {
				//	Copies the SKU into the corresponding member variable up to MAX_SKU_LEN characters. 
				//still hae to implement  as just does (strcpy(x,y)) right now
				sku(s);
				name(n);
				price(x);
				qtyNeeded(i);
				quantity(0);
				taxed(tax);
		}
开发者ID:BrooksPatola,项目名称:OOP244,代码行数:10,代码来源:Product.cpp


示例18: main

int main()
{
  double r, t, a;
  
  printf("Input the radius ");
  scanf("%lf", &r);

  printf("Input the thickness ");
  scanf("%lf", &t);
  
  printf("gold   %f\n", price(1324.0, 19.3, r, t));

  printf("silver %f\n", price(17.76, 10.5, r, t));

  printf("copper %f\n", price(0.2211, 8.93, r, t));

  
  return 0;
}
开发者ID:her0m31,项目名称:Studys,代码行数:19,代码来源:medal.c


示例19: plotPriceProfile

// plot price difference profile
void plotPriceProfile(int bars,int type)
{
	if(!is(TESTMODE)) return; // [Test] only
	if(!bars) bars = 50;
	set(PLOTNOW+PEEK); // peek in the future 
	var vProfit;
	int count;
	for(count = 1; count < bars; count++) 
	{
		if(type&PDIFF) 
			vProfit = (price(-count-1)-price(-count))/PIP;
		else
			vProfit = (price(-count-1)-price(-1))/PIP;
		if(type&PMINUS) 
			vProfit = -vProfit;
		plotBar("Price",count,count,vProfit,NEW|AVG|BARS|LBL2,COLOR_AVG);
		plotBar("StdDev",count,0,vProfit/4,DEV|BARS,COLOR_DEV);
	}
}
开发者ID:AttilaForgacs,项目名称:zorro,代码行数:20,代码来源:profile.c


示例20: qt_static_metacall

int MealModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 3)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 3;
    }
#ifndef QT_NO_PROPERTIES
    else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0:
            *reinterpret_cast< QString*>(_v) = type();
            break;
        case 1:
            *reinterpret_cast< QString*>(_v) = name();
            break;
        case 2:
            *reinterpret_cast< QString*>(_v) = price();
            break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0:
            settype(*reinterpret_cast< QString*>(_v));
            break;
        case 1:
            setname(*reinterpret_cast< QString*>(_v));
            break;
        case 2:
            setprice(*reinterpret_cast< QString*>(_v));
            break;
        }
        _id -= 3;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 3;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 3;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:BenedicteGiraud,项目名称:ProjetINFSI351,代码行数:55,代码来源:moc_MealModel.cpp



注:本文中的price函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ primaryFont函数代码示例发布时间:2022-05-30
下一篇:
C++ prg32函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap