API
Version 2.0.1
Low-Latency HFT API
|
The SGContext class The main class to be inherited for creating a new Strategy. More...
#include <sgContext.h>
Public Member Functions | |
virtual | ~SGContext () |
~SGContext A destructor | |
SGContext (StrategyParameters *params, const std::string sgName) | |
SGContext Constructor. More... | |
COMMON::Instrument * | createNewInstrument (UNSIGNED_LONG symbolId, bool regMktData, bool useSnapShot=false, bool useOhlc=true) |
createNewInstrument To add a new Instrument in the strategy The Pointer to the added Instrument is set in instrument passed as reference More... | |
COMMON::Instrument * | createNewInstrument (const std::string &instrumentName, bool regMktData=false, bool useSnapShot=true, bool useOhlc=false) |
createNewInstrument To add a new Instrument in the strategy The Pointer to the added Instrument is set in instrument passed as reference More... | |
SingleOrder * | createNewOrder (COMMON::Instrument *instrument, const UNSIGNED_LONG &qty=0, const UNSIGNED_LONG &discQty=0, const DATA_TYPES::OrderMode &mode=CONSTANTS::CMD_OrderMode_BUY, const DATA_TYPES::OrderType &type=CONSTANTS::CMD_OrderType_LIMIT, const DATA_TYPES::OrderValidity &validity=CONSTANTS::CMD_OrderValidity_DAY, const DATA_TYPES::ProductType &product=CONSTANTS::CMD_ProductType_DELIVERY, const UNSIGNED_LONG &price=0, const UNSIGNED_LONG &stopPrice=0) |
createNewOrder To create a New Order for an instrument More... | |
COMMON::OrderId * | createNewOrderId (COMMON::Instrument *instrument, const API2::AccountDetail &accountDetail, const DATA_TYPES::OrderMode &mode) |
createNewOrderId Creates and Inserts a new OrderId Instance to the Instrument for the requested OrderMode and sets the pointer to orderId More... | |
bool | reqNewSingleOrder (DATA_TYPES::RiskStatus &riskStatus, COMMON::Instrument *instrument, SingleOrder *&order, COMMON::OrderId *orderId) |
reqNewSingleOrder To Send a new Order More... | |
bool | reqReplaceOrder (DATA_TYPES::RiskStatus &riskStatus, COMMON::Instrument *instrument, SingleOrder *&order, COMMON::OrderId *orderId) |
reqReplaceOrder To send a replace Order More... | |
bool | reqCancelOrder (DATA_TYPES::RiskStatus &riskStatus, COMMON::OrderId *orderId) |
reqCancelOrder To Cancel Order More... | |
void | reqCancelAllOrders () |
reqCancelAllOrders To cancel all Orders ( Confirmed or Partial Filled ) | |
virtual void | reqTerminateSquareOffStrategy () |
reqTerminateSquareOffStrategy Called to Terminate strategy and Square-Off all Positions Can be overriden Default behaviour: 1) Cancel All Orders 2) Send Opposite Orders for closing Position 3) Terminate the strategy | |
virtual void | reqTerminateStrategy (bool reqCancelAllOrders=true) |
reqTerminateStrategy Called to Terminate Strategy Can be overriden Default behaviour: 1) Cancel All Pending Orders 3) Terminate the strategy | |
void * | reqStartAlgo (bool marketDataEventRequired, bool tradeTicksEventRequired) |
reqStartAlgo function call to Start the Strategy More... | |
void * | reqStartOHLCAlgo () |
reqStartOHLCAlgo function call to Start the Strategy listening to OHLC update events More... | |
bool | reqProcessTradeTicks (bool &error, SYMBOL_ID symbolId) |
reqProcessTradeTicks More... | |
void | reqRemoveInstrument (COMMON::Instrument *instrument) |
reqRemoveInstrument To remove Instrument from the context. Removing will remove all the data relating the Instrument's Position More... | |
void | reqRemoveAllInstruments () |
reqRemoveAllInstruments This will remove all Instrument from the registered Instrument list | |
bool | reqUpdateMarketData () |
reqUpdateMarketData To manually update Market Feed for all registered Instruments. Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo() More... | |
bool | reqUpdateMarketData (UNSIGNED_LONG symbolId) |
reqUpdateMarketData To manually update Market Feed for requested API2::DATA_TYPES::SYMBOL_ID. Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo() More... | |
void | reqAddStrategyComment (DATA_TYPES::StrategyComment com) |
reqAddStrategyComment To set the current Startegy Comment Whenever a strategy Response is sent to frontend this will be the sent as the strategy Comment More... | |
void | reqSendStrategyResponse (DATA_TYPES::ResponseType responseType, DATA_TYPES::RiskStatus riskStatus, DATA_TYPES::StrategyComment strategyComment=CONSTANTS::RSP_StrategyComment_MAX) |
reqSendStrategyResponse To send a Response to the frontend More... | |
void | reqExitStrategy () |
reqExitStrategy To exit a strategy terminates the Strategy thread and returns the StrategyDriver. | |
virtual bool | reqQryTestSegment (const DATA_TYPES::ExchangeId &exch, const DATA_TYPES::SecurityType &securityType=CONSTANTS::CMD_SecurityType_MAX) |
reqQryTestSegment To know whether a given exchange segment is being used in the strategy or not More... | |
int | reqQryClientID () |
reqQryClientID To get ClientId More... | |
StrategyParameters * | reqQryStrategyParams () |
reqQryStrategyParams To get StartegyParameters More... | |
COMMON::MktData * | reqQryUpdateMarketData (SYMBOL_ID symbolId) |
reqQryUpdateMarketData This function call will return the Pointer to API2::COMMON::MktData structure after updating it. Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo() More... | |
COMMON::MktData * | reqQryMarketData (SYMBOL_ID symbolId) |
reqQryMarketData This function call will return the Pointer to API2::COMMON::MktData structure Here it will contain the last updated Market Snapshot More... | |
COMMON::OhlcQuote * | reqQryOHLCQuote (bool &error, SYMBOL_ID symbolId) |
reqQryOHLCQuote More... | |
SIGNED_LONG | reqQryNetMarkToMarkPL () |
reqQryNetMarkToMarkPL This function will return net Mark To Market Profit and Loss for the strategy( sum of all Instruments being traded) More... | |
SIGNED_LONG | reqQryNetBookedPL () |
reqQryNetBookedPL This function will return net Booked Profit and Loss for the strategy( sum of all Instruments being traded) More... | |
DATA_TYPES::SYMBOL_ID | reqQrySymbolID (std::string instrumentName) |
reqQrySymbolID This function will return System Unique ID for the Instrument as API2::DATA_TYPES::SYMBOL_ID More... | |
std::list < API2::COMMON::Instrument * > | reqQryInstrumentList (UNSIGNED_LONG symbolId) |
reqQryInstrumentList To get list of all Instruments added for the requested SymbolId More... | |
API2::SingleOrder * | reqQryOrder (long clOrderId) |
reqQryOrder To get Pointer to Single Order using a clientOrderId More... | |
API2::DATA_TYPES::STRATEGY_ID | reqQryStrategyId () |
reqQryStrategyId To get StartegyId of current running Strategy. More... | |
DebugLog * | reqQryDebugLog () |
reqQryDebugLog To get Pointer to the DebugLog Object used to dump debug messages. Sample Usage: DEBUG_MESSAGE(reqQryDebugLog()"<Message>"); More... | |
UNSIGNED_LONG | reqQryPendingQty (COMMON::Instrument *instrument, DATA_TYPES::OrderMode mode) |
reqQryPendingQty To get Pending Quantity of an Instrument More... | |
DATA_TYPES::QTY | reqQryPendingQty (COMMON::OrderId *orderId) |
reqQryPendingQty To get Pending Quantity of requested Order as orderId More... | |
DATA_TYPES::CLORDER_ID | reqQryClientOrderId (COMMON::OrderId *orderId) |
reqQryClientOrderId To get ClientOrderId of requested Order More... | |
DATA_TYPES::OrderStatus | reqQryOrderStatus (COMMON::OrderId *orderId) |
reqQryOrderStatus To get OrderStatus of requested Order More... | |
DATA_TYPES::String | reqQryExchangeOrderId (COMMON::OrderId *orderId) |
reqQryExchangeOrderId To get Exchange OrderId of requested Order More... | |
DATA_TYPES::String | getStrConfirmation (const OrderConfirmation &confirmation) |
getStrConfirmation. Prints OrderConfirmation fields More... | |
DATA_TYPES::String | getStrSingleOrder (SingleOrder *order) |
getStrSingleOrder. Prints Single Order fields More... | |
DATA_TYPES::String | getStrOrderId (const COMMON::OrderId *orderId) |
getStrOrderId. Prints OrderId Fields More... | |
virtual void | onCMDAdminCommand (DATA_TYPES::CommandCategory command) |
onCMDAdminCommand Called when ever a command from frontend is issued. More... | |
virtual void | onCMDDisconnection (const DATA_TYPES::CommandCategory &command) |
onCMDDisconnection Called whenever a disconnection is received disconnected entity to be determined from CommandCategory More... | |
virtual void | onCMDModifyStrategy (AbstractUserParams *newParams)=0 |
onCMDModifyStrategy Called when strategy modify command is received | |
virtual void | onCMDTerminateStartegy () |
onCMDTerminateStartegy Called when strategy receives Terminate Command from Frontend | |
virtual void | onCMDTerminateSqOffStrategy () |
onCMDTerminateSqOffStrategy Called when strategy receives Terminate SqOff Command from Frontend | |
virtual void | onCMDPauseStartegy () |
onCMDPauseStartegy Called when strategy receives Pause Command from Frontend | |
virtual void | onCMDRunStrategy () |
onCMDRunStrategy Called when strategy receives Run Command from Frontend | |
virtual void | onCMDInit () |
OnCMDInit To Set Initial state of the algo. | |
virtual void | onDefaultEvent () |
onDefaultEvent Called as an event if Not configured to received marketData Event while Running Algo | |
virtual void | onMarketDataEvent (UNSIGNED_LONG symbolId) |
onMarketDataEvent Called if Configured to received marketData Event while Running Algo More... | |
virtual void | onOhlcTimeOutEvent () |
onOhlcTimeOutEvent Called if Configured to received OHLC update Event while Running Algo Callback is provided each time the OHLC Data is updated | |
virtual void | onTradeTickEvent (COMMON::TradeTick tradeTick) |
onTradeTickEvent Called if Configured to received Trade Ticks update Event while Running Algo Callback is provided each time the Trade Tick is received through the TBT Server This event is specific to NSE-TBT Trade Tick currently | |
virtual void | onProcessOrderConfirmation (OrderConfirmation &confirmation) |
onProcessOrderConfirmation Call back after OrderConfirmation Processing is done Not necessary to override this To be overridden only If any additional Processing is reqd at the algo end More... | |
virtual void | onConfirmed (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onConfirmed Call back when a new Order gets confirmed by exchange. More... | |
virtual void | onReplaceRejected (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onReplaceRejected Call back when a replace order gets rejected by the exchange More... | |
virtual void | onCanceled (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onCanceled Call back when a cancel order gets accepted by the exchange More... | |
virtual void | onCancelRejected (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onCancelRejected Call back when a cancel order gets rejected by the exchange More... | |
virtual void | onReplaced (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onReplaced Call back when a Order gets replaced sucessfully at the exchange. More... | |
virtual void | onNewReject (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onNewRejected Call back when a new order gets rejected by the exchange More... | |
virtual void | onIOCCanceled (OrderConfirmation &Confirmation, COMMON::OrderId *orderId) |
onIOCCanceled Call back when an IOC order gets canceled the exchange More... | |
virtual void | onFilled (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onFilled Call back when an order gets filled at the exchange More... | |
virtual void | onPartialFill (OrderConfirmation &confirmation, COMMON::OrderId *orderId) |
onPartialFill Call back when an order gets partially filled at the exchange More... | |
virtual void | onMarketToLimit (API2::OrderConfirmation &confirmation, API2::COMMON::OrderId *orderId) |
onMarketToLimit Call back when Orderstatus changes from Market To Limit by exchange More... | |
virtual void | onFrozen (API2::OrderConfirmation &confirmation, API2::COMMON::OrderId *orderId) |
onFrozen Call back when an order gets frozen by exchange More... | |
The SGContext class The main class to be inherited for creating a new Strategy.
API2::SGContext::SGContext | ( | StrategyParameters * | params, |
const std::string | sgName | ||
) |
SGContext Constructor.
params | API2::StrategyParameters |
sgName | Unique String for Strategy Name |
COMMON::Instrument* API2::SGContext::createNewInstrument | ( | UNSIGNED_LONG | symbolId, |
bool | regMktData, | ||
bool | useSnapShot = false , |
||
bool | useOhlc = true |
||
) |
createNewInstrument To add a new Instrument in the strategy
The Pointer to the added Instrument is set in instrument passed as reference
symbolId | System Unique ID for the Instrument as API2::DATA_TYPES::SYMBOL_ID |
regMktData | set True to register for Market Data for the Instrument |
useSnapShot | Set True if Snapshot Feed is to be used and False to use TBT-Feed |
useOhlc | Set True if OHLC Heed is also required |
MarketDataSubscriptionFailedException |
COMMON::Instrument* API2::SGContext::createNewInstrument | ( | const std::string & | instrumentName, |
bool | regMktData = false , |
||
bool | useSnapShot = true , |
||
bool | useOhlc = false |
||
) |
createNewInstrument To add a new Instrument in the strategy
The Pointer to the added Instrument is set in instrument passed as reference
instrumentName | Instrument Name Format: [ExchangeName] [Symbol] [Expiry(YYYYMMDD)] [StrikePrice] [C/P(For Call/Put)] Example: Cash Segment: NSE RELIANCE Futures Segment: NSE RELIANCE 20140828 Options Segment: NSE RELIANCE 20140828 980.00 C |
regMktData | set True to register for Market Data for the Instrument |
useSnapShot | Set True if Snapshot Feed is to be used and False to use TBT-Feed |
useOhlc | Set True if OHLC Heed is also required |
MarketDataSubscriptionFailedException |
SingleOrder* API2::SGContext::createNewOrder | ( | COMMON::Instrument * | instrument, |
const UNSIGNED_LONG & | qty = 0 , |
||
const UNSIGNED_LONG & | discQty = 0 , |
||
const DATA_TYPES::OrderMode & | mode = CONSTANTS::CMD_OrderMode_BUY , |
||
const DATA_TYPES::OrderType & | type = CONSTANTS::CMD_OrderType_LIMIT , |
||
const DATA_TYPES::OrderValidity & | validity = CONSTANTS::CMD_OrderValidity_DAY , |
||
const DATA_TYPES::ProductType & | product = CONSTANTS::CMD_ProductType_DELIVERY , |
||
const UNSIGNED_LONG & | price = 0 , |
||
const UNSIGNED_LONG & | stopPrice = 0 |
||
) |
createNewOrder To create a New Order for an instrument
order | Reference to Pointer of API2::SingleOrder Pointer to created object will be set into this. For creating an Order |
instrument | Pointer to the Instrument for which a new SingleOrder is to be created |
qty | Order Quantity |
discQty | Diclosed Order Quantity |
mode | OrderMode as API2::CONSTANTS::CMD_OrderMode_BUY or API2::CONSTANTS::CMD_OrderMode_SELL |
type | OrderType as API2::DATA_TYPES::OrderType |
validity | Order Validity |
product | Product |
price | Price |
stopPrice | Stop Price |
COMMON::OrderId* API2::SGContext::createNewOrderId | ( | COMMON::Instrument * | instrument, |
const API2::AccountDetail & | accountDetail, | ||
const DATA_TYPES::OrderMode & | mode | ||
) |
createNewOrderId Creates and Inserts a new OrderId Instance to the Instrument
for the requested OrderMode and sets the pointer to orderId
instrument | should be valid and Not null |
mode | should be valid API2::CONSTANTS::CMD_OrderMode_BUY or API2::CONSTANTS::CMD_OrderMode_SELL |
DATA_TYPES::String API2::SGContext::getStrConfirmation | ( | const OrderConfirmation & | confirmation | ) |
getStrConfirmation. Prints OrderConfirmation fields
confirmation |
DATA_TYPES::String API2::SGContext::getStrOrderId | ( | const COMMON::OrderId * | orderId | ) |
getStrOrderId. Prints OrderId Fields
orderId |
DATA_TYPES::String API2::SGContext::getStrSingleOrder | ( | SingleOrder * | order | ) |
getStrSingleOrder. Prints Single Order fields
order |
|
inlinevirtual |
onCanceled Call back when a cancel order gets accepted by the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onCancelRejected Call back when a cancel order gets rejected by the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onCMDAdminCommand Called when ever a command from frontend is issued.
command |
|
virtual |
onCMDDisconnection Called whenever a disconnection is received disconnected entity to be determined from CommandCategory
command |
|
inlinevirtual |
onConfirmed Call back when a new Order gets confirmed by exchange.
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onFilled Call back when an order gets filled at the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onFrozen Call back when an order gets frozen by exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onIOCCanceled Call back when an IOC order gets canceled the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
virtual |
onMarketDataEvent Called if Configured to received marketData Event while Running Algo
symbolId | SymbolId of the Instrument that received marketData SymbolId should be subscribed for Market Data while initializing |
|
inlinevirtual |
onMarketToLimit Call back when Orderstatus changes from Market To Limit by exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onNewRejected Call back when a new order gets rejected by the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onPartialFill Call back when an order gets partially filled at the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onProcessOrderConfirmation Call back after OrderConfirmation Processing is done
Not necessary to override this
To be overridden only If any additional Processing is reqd at the algo end
confirmation | Reference to the API2::OrderConformation |
|
inlinevirtual |
onReplaced Call back when a Order gets replaced sucessfully at the exchange.
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
|
inlinevirtual |
onReplaceRejected Call back when a replace order gets rejected by the exchange
confirmation | Contains the information received from Exchange |
orderId | Pointer to the API2::COMMON::OrderId type |
void API2::SGContext::reqAddStrategyComment | ( | DATA_TYPES::StrategyComment | com | ) |
reqAddStrategyComment To set the current Startegy Comment Whenever a strategy Response is sent to frontend this will be the sent as the strategy Comment
com |
bool API2::SGContext::reqCancelOrder | ( | DATA_TYPES::RiskStatus & | riskStatus, |
COMMON::OrderId * | orderId | ||
) |
reqCancelOrder To Cancel Order
riskStatus | passed by reference This is the risk status for sending Canceled Order |
orderId |
bool API2::SGContext::reqNewSingleOrder | ( | DATA_TYPES::RiskStatus & | riskStatus, |
COMMON::Instrument * | instrument, | ||
SingleOrder *& | order, | ||
COMMON::OrderId * | orderId | ||
) |
reqNewSingleOrder To Send a new Order
riskStatus | |
instrument | |
order | |
orderId |
bool API2::SGContext::reqProcessTradeTicks | ( | bool & | error, |
SYMBOL_ID | symbolId | ||
) |
reqProcessTradeTicks
error | |
symbolId |
int API2::SGContext::reqQryClientID | ( | ) |
reqQryClientID To get ClientId
DATA_TYPES::CLORDER_ID API2::SGContext::reqQryClientOrderId | ( | COMMON::OrderId * | orderId | ) |
reqQryClientOrderId To get ClientOrderId of requested Order
orderId |
DebugLog* API2::SGContext::reqQryDebugLog | ( | ) |
reqQryDebugLog To get Pointer to the DebugLog Object used to dump debug messages.
Sample Usage:
DEBUG_MESSAGE(reqQryDebugLog()"<Message>");
DATA_TYPES::String API2::SGContext::reqQryExchangeOrderId | ( | COMMON::OrderId * | orderId | ) |
reqQryExchangeOrderId To get Exchange OrderId of requested Order
orderId |
std::list<API2::COMMON::Instrument *> API2::SGContext::reqQryInstrumentList | ( | UNSIGNED_LONG | symbolId | ) |
reqQryInstrumentList To get list of all Instruments added for the requested SymbolId
symbolId | System Unique Id for the Instrument |
COMMON::MktData* API2::SGContext::reqQryMarketData | ( | SYMBOL_ID | symbolId | ) |
reqQryMarketData This function call will return the Pointer to API2::COMMON::MktData structure
Here it will contain the last updated Market Snapshot
symbolId |
SIGNED_LONG API2::SGContext::reqQryNetBookedPL | ( | ) |
reqQryNetBookedPL This function will return net Booked Profit and Loss for the strategy( sum of all Instruments being traded)
SIGNED_LONG API2::SGContext::reqQryNetMarkToMarkPL | ( | ) |
reqQryNetMarkToMarkPL This function will return net Mark To Market Profit and Loss for the strategy( sum of all Instruments being traded)
COMMON::OhlcQuote* API2::SGContext::reqQryOHLCQuote | ( | bool & | error, |
SYMBOL_ID | symbolId | ||
) |
reqQryOHLCQuote
error | |
symbolId |
API2::SingleOrder* API2::SGContext::reqQryOrder | ( | long | clOrderId | ) |
reqQryOrder To get Pointer to Single Order using a clientOrderId
clOrderId |
DATA_TYPES::OrderStatus API2::SGContext::reqQryOrderStatus | ( | COMMON::OrderId * | orderId | ) |
reqQryOrderStatus To get OrderStatus of requested Order
orderId |
UNSIGNED_LONG API2::SGContext::reqQryPendingQty | ( | COMMON::Instrument * | instrument, |
DATA_TYPES::OrderMode | mode | ||
) |
reqQryPendingQty To get Pending Quantity of an Instrument
instrument | API2::COMMON::Instrument |
mode | Ordermode as API2::CONSTANTS::CMD_OrderMode_BUY or API2::CONSTANTS::CMD_OrderMode_SELL |
DATA_TYPES::QTY API2::SGContext::reqQryPendingQty | ( | COMMON::OrderId * | orderId | ) |
reqQryPendingQty To get Pending Quantity of requested Order as orderId
orderId |
API2::DATA_TYPES::STRATEGY_ID API2::SGContext::reqQryStrategyId | ( | ) |
reqQryStrategyId To get StartegyId of current running Strategy.
StrategyParameters* API2::SGContext::reqQryStrategyParams | ( | ) |
reqQryStrategyParams To get StartegyParameters
DATA_TYPES::SYMBOL_ID API2::SGContext::reqQrySymbolID | ( | std::string | instrumentName | ) |
reqQrySymbolID This function will return System Unique ID for the Instrument as API2::DATA_TYPES::SYMBOL_ID
instrumentName | Instrument Name Format: [ExchangeName] [Symbol] [Expiry(YYYYMMDD)] [StrikePrice] [C/P(For Call/Put)] Example: Cash Segment: NSE RELIANCE Futures Segment: NSE RELIANCE 20140828 Options Segment: NSE RELIANCE 20140828 980.00 C |
|
virtual |
reqQryTestSegment To know whether a given exchange segment is being used in the strategy or not
exch | The DATA_TYPES::ExchangeId |
securityType | The DATA_TYPES::SecurityType |
COMMON::MktData* API2::SGContext::reqQryUpdateMarketData | ( | SYMBOL_ID | symbolId | ) |
reqQryUpdateMarketData This function call will return the Pointer to API2::COMMON::MktData structure after updating it.
Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo()
symbolId | SymbolId for which MarketData is required |
void API2::SGContext::reqRemoveInstrument | ( | COMMON::Instrument * | instrument | ) |
reqRemoveInstrument To remove Instrument from the context.
Removing will remove all the data relating the Instrument's Position
instrument |
bool API2::SGContext::reqReplaceOrder | ( | DATA_TYPES::RiskStatus & | riskStatus, |
COMMON::Instrument * | instrument, | ||
SingleOrder *& | order, | ||
COMMON::OrderId * | orderId | ||
) |
reqReplaceOrder To send a replace Order
riskStatus | |
instrument | |
order | |
updateQuantity | |
orderId |
void API2::SGContext::reqSendStrategyResponse | ( | DATA_TYPES::ResponseType | responseType, |
DATA_TYPES::RiskStatus | riskStatus, | ||
DATA_TYPES::StrategyComment | strategyComment = CONSTANTS::RSP_StrategyComment_MAX |
||
) |
reqSendStrategyResponse To send a Response to the frontend
responseType | the response Type as DATA_TYPES::ResponseType |
riskStatus | the Risk Status as DATA_TYPES::RiskStatus |
strategyComment | the Strategy Comment as DATA_TYPES::StrategyComment |
void* API2::SGContext::reqStartAlgo | ( | bool | marketDataEventRequired, |
bool | tradeTicksEventRequired | ||
) |
reqStartAlgo function call to Start the Strategy
marketDataEventRequired | Set True to register for call-backs on Market-Data Event on registered Instruments |
tradeTicksEventRequired | Set True to register for call-backs on Trade Tick Events on registered Instruments |
void* API2::SGContext::reqStartOHLCAlgo | ( | ) |
reqStartOHLCAlgo function call to Start the Strategy listening to OHLC update events
bool API2::SGContext::reqUpdateMarketData | ( | ) |
reqUpdateMarketData To manually update Market Feed for all registered Instruments.
Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo()
bool API2::SGContext::reqUpdateMarketData | ( | UNSIGNED_LONG | symbolId | ) |
reqUpdateMarketData To manually update Market Feed for requested API2::DATA_TYPES::SYMBOL_ID.
Not required if marketDataEventRequired is set to be True while starting the strategy using API2::SGContext::reqStartAlgo()