?? rq_fpml_product_fxdigitaloption.c
字號:
/*** rq_fpml_product_fxdigitaloption.c**** Written by Brett Hutley - brett@hutley.net**** Copyright (C) 2001 Brett Hutley**** This file is part of the Risk Quantify Library**** Risk Quantify is free software; you can redistribute it and/or** modify it under the terms of the GNU Library General Public** License as published by the Free Software Foundation; either** version 2 of the License, or (at your option) any later version.**** Risk Quantify is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU** Library General Public License for more details.**** You should have received a copy of the GNU Library General Public** License along with Risk Quantify; if not, write to the Free** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/#include "fpml/rq_fpml_product_fxdigitaloption.h"#include <stdlib.h>#include <string.h>/* -- structures --------------------------------------------------- */struct rq_fpml_product_fxdigitaloption {};/* -- globals ------------------------------------------------------ */const char *rq_fpml_product_fxdigitaloption_product_type = "fxdigitaloption";/* -- code --------------------------------------------------------- */static void rq_fpml_product_fxdigitaloption_free(void *product_data){ struct rq_fpml_product_fxdigitaloption *p = (struct rq_fpml_product_fxdigitaloption *)product_data; free(p);}intrq_fpml_product_fxdigitaloption_write_xml(void *product_data, rq_stream_t output_stream){ struct rq_fpml_product_fxdigitaloption *p = (struct rq_fpml_product_fxdigitaloption *)product_data; int status = 0; rq_stream_write_string(output_stream, "<fxDigitalOption>"); rq_stream_write_string(output_stream, "<productType>Euro Binary</productType>"); rq_stream_write_string(output_stream, "<buyerPartyReference href = \"#UBSW\"/>"); rq_stream_write_string(output_stream, "<sellerPartyReference href = \"#CITI\"/>"); rq_stream_write_string(output_stream, "<expiryDateTime>"); rq_stream_write_string(output_stream, "<expiryDate>2001-11-26</expiryDate>"); rq_stream_write_string(output_stream, "<hourMinuteTime>1400</hourMinuteTime>"); rq_stream_write_string(output_stream, "<businessCenter>GBLO</businessCenter>"); rq_stream_write_string(output_stream, "<cutName>LONDON</cutName>"); rq_stream_write_string(output_stream, "</expiryDateTime>"); rq_stream_write_string(output_stream, "<fxOptionPremium>"); rq_stream_write_string(output_stream, "<payerPartyReference href = \"#UBSW\"/>"); rq_stream_write_string(output_stream, "<receiverPartyReference href = \"#CITI\"/>"); rq_stream_write_string(output_stream, "<premiumAmount type = \"Money\">"); rq_stream_write_string(output_stream, "<currency>GBP</currency>"); rq_stream_write_string(output_stream, "<amount>53000</amount>"); rq_stream_write_string(output_stream, "</premiumAmount>"); rq_stream_write_string(output_stream, "<premiumSettlementDate>2001-11-14</premiumSettlementDate>"); rq_stream_write_string(output_stream, "</fxOptionPremium>"); rq_stream_write_string(output_stream, "<valueDate>2001-11-28</valueDate>"); rq_stream_write_string(output_stream, "<quotedCurrencyPair>"); rq_stream_write_string(output_stream, "<currency1>GBP</currency1>"); rq_stream_write_string(output_stream, "<currency2>USD</currency2>"); rq_stream_write_string(output_stream, "<quoteBasis>CURRENCY2PERCURRENCY1</quoteBasis>"); rq_stream_write_string(output_stream, "</quotedCurrencyPair>"); rq_stream_write_string(output_stream, "<spotRate>1.4800</spotRate>"); rq_stream_write_string(output_stream, "<fxEuropeanTrigger>"); rq_stream_write_string(output_stream, "<triggerCondition>Above</triggerCondition>"); rq_stream_write_string(output_stream, "<quotedCurrencyPair>"); rq_stream_write_string(output_stream, "<currency1>GBP</currency1>"); rq_stream_write_string(output_stream, "<currency2>USD</currency2>"); rq_stream_write_string(output_stream, "<quoteBasis>CURRENCY2PERCURRENCY1</quoteBasis>"); rq_stream_write_string(output_stream, "</quotedCurrencyPair>"); rq_stream_write_string(output_stream, "<triggerRate>1.4800</triggerRate>"); rq_stream_write_string(output_stream, "<informationSource>"); rq_stream_write_string(output_stream, "<rateSource>REUTERS</rateSource>"); rq_stream_write_string(output_stream, "<rateSourcePage>GBP=</rateSourcePage>"); rq_stream_write_string(output_stream, "</informationSource>"); rq_stream_write_string(output_stream, "</fxEuropeanTrigger>"); rq_stream_write_string(output_stream, "<triggerPayout>"); rq_stream_write_string(output_stream, "<currency>GBP</currency>"); rq_stream_write_string(output_stream, "<amount>750000</amount>"); rq_stream_write_string(output_stream, "<payoutStyle>IMMEDIATE</payoutStyle>"); rq_stream_write_string(output_stream, "</triggerPayout>"); rq_stream_write_string(output_stream, "</fxDigitalOption>"); return status;}rq_fpml_product_t rq_fpml_product_fxdigitaloption_alloc(){ struct rq_fpml_product_fxdigitaloption *p = (struct rq_fpml_product_fxdigitaloption *)calloc(1, sizeof(struct rq_fpml_product_fxdigitaloption)); rq_fpml_product_t product = _rq_fpml_product_alloc( rq_fpml_product_fxdigitaloption_product_type, p, rq_fpml_product_fxdigitaloption_write_xml, rq_fpml_product_fxdigitaloption_free ); return product;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -