Support Board
Date/Time: Sun, 28 Apr 2024 05:55:23 +0000
Post From: GetBidMarketLimitOrdersForPrice
[2021-03-01 22:57:37] |
Sierra Chart Engineering - Posts: 104368 |
Here is an example we put together but it has not been tested : /*============================================================================
----------------------------------------------------------------------------*/ SCSFExport scsf_MarketLimitOrdersForPriceExample(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { // Set the configuration and defaults sc.GraphName = "MarketLimitOrdersForPrice Example"; sc.AutoLoop = 0; return; } // Do data processing int BidNumLevels = sc.GetBidMarketDepthNumberOfLevels(); int AskNumLevels = sc.GetAskMarketDepthNumberOfLevels(); const int NumberOfMarketOrderDataElements = 20; n_ACSIL::s_MarketOrderData MarketOrderData[NumberOfMarketOrderDataElements]; for (int LevelIndex = 0; LevelIndex < BidNumLevels; LevelIndex++) { s_MarketDepthEntry MarketDepthEntry; sc.GetBidMarketDepthEntryAtLevel(MarketDepthEntry, LevelIndex); int ActualLevels = sc.GetBidMarketLimitOrdersForPrice(sc.Round(MarketDepthEntry.Price / sc.TickSize), NumberOfMarketOrderDataElements, MarketOrderData); for (int OrderDataIndex = 0; OrderDataIndex < ActualLevels; OrderDataIndex++) { uint64_t OrderID = MarketOrderData[OrderDataIndex].OrderID; t_MarketDataQuantity MarketDataQuantity = MarketOrderData[OrderDataIndex].OrderQuantity; } } for (int LevelIndex = 0; LevelIndex < AskNumLevels; LevelIndex++) { s_MarketDepthEntry MarketDepthEntry; sc.GetAskMarketDepthEntryAtLevel(MarketDepthEntry, LevelIndex); int ActualLevels = sc.GetAskMarketLimitOrdersForPrice(sc.Round(MarketDepthEntry.Price / sc.TickSize), NumberOfMarketOrderDataElements, MarketOrderData); for (int OrderDataIndex = 0; OrderDataIndex < ActualLevels; OrderDataIndex++) { uint64_t OrderID = MarketOrderData[OrderDataIndex].OrderID; t_MarketDataQuantity MarketDataQuantity = MarketOrderData[OrderDataIndex].OrderQuantity; } } } Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |