Support Board
Date/Time: Sat, 28 Dec 2024 16:11:23 +0000
Missmatch execution times...
View Count: 1171
[2016-01-08 16:27:25] |
User368248 - Posts: 46 |
Hello. With new addition of record milliseconds on activity log its now fantastic because I can debug full my system. ( Pair Trading HFT ). Please check my image, the resume its: 1.- From my acsil code I recorded time when I sent order and when ( result > 0 ) its performed, I supposed ( as your support info example ) that this way its the correct for correct flow of sent orders and wait for fill. In my example, see picture please, all above steps ( via acsil ) start at 01.580 ms and end at 01.580 ms too !.. I noted this strange due I am 20 ms away from fxcm server and 8 ms away to ds5.sierracharts server. 2.- In Trading Activity Log I see "detailed" times too and dont match: * Started at 01.580 too, * But end at 01.819 ! . I assume that times recorded in TAlog are "real", so the question its: How can I know/read/flag within acsil code until the trade was really accepted by FXCM ? Hope be clear. Thanks in advance. |
Attachment Deleted. fxcm_times.png / V - Attached On 2016-01-08 16:27:04 UTC - Size: 107.4 KB - 309 views |
[2016-01-08 18:35:42] |
Sierra Chart Engineering - Posts: 104368 |
The first line in the Trade Activity Log for an order submitted from Sierra Chart, is immediately added at the time the order is submitted. So in your case, that particular order was accepted at 01.655 (seconds.milliseconds) 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 |
[2016-01-08 18:46:54] |
User368248 - Posts: 46 |
Thanks for reply but: How can I know/read/flag within acsil code until the trade was really accepted by FXCM ? This question its due ( result > 0 ) was not real. Also I check with FXCM log fix details and they sent me all flow of order. Thanks in advance Date Time Of Last Edit: 2016-01-08 19:09:55
|
[2016-01-08 18:50:25] |
Sierra Chart Engineering - Posts: 104368 |
There is not a reliable way when using ACSIL to get the exact time that the order was accepted.
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 |
[2016-01-08 19:17:54] |
User368248 - Posts: 46 |
Well, I think its possible get this: a) Waiting for "Executed" word in OrderActionSource column or b) Waiting for number on FillExecutionServiceID. How can I access to this info via acsil? If not its possible then I have a problem because I need to control the real flow open/close of trades. Thanks in advance. Please refer to attached image. |
fxcm_times_2.PNG / V - Attached On 2016-01-08 19:17:50 UTC - Size: 42.03 KB - 287 views |
[2016-01-10 07:52:59] |
Sierra Chart Engineering - Posts: 104368 |
It is possible to access historical order fills. Here is the documentation for that: http://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html#scGetOrderFillEntry 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 |
[2016-01-11 13:17:36] |
User368248 - Posts: 46 |
Thanks, this its good news. Plase provide me a guide/example how to use "if ( result > 0 )" combined with scGetOrderFillEntry. This mean, how to check when a order was filled by LP/Broker, please referr to my code below: s_SCNewOrder order; //order.OrderQuantity = 10000; order.OrderQuantity = sc.TradeWindowOrderQuantity; order.OrderType = SCT_ORDERTYPE_MARKET; order.TimeInForce = SCT_TIF_GTC; int Result = sc.SellOrder(order); if (Result > 0)//order was accepted { RememberedOrderID = order.InternalOrderID; } |
[2016-01-11 17:30:51] |
Sierra Chart Engineering - Posts: 104368 |
We do not provide programming help. We can only refer you to the documentation: http://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html#scGetOrderFillEntry 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 |
[2016-01-15 15:59:53] |
User368248 - Posts: 46 |
Hello, I tried to use this code but dont work: http://www.sierrachart.com/index.php?page=doc/doc_ACSILTrading.html#s_SCTradeOrder ( The price returned its 0.00000 ) Tested on real orders. I am using FXCM and Currenex How can I read the "filled" value on Trading Activity Log? Its seem like acsil code dont work with trade order status, I can not make to work. If I dont have a reliable way to read the "filled" field then my pair trading system can not work and then I will to leave Sierra Chart proyect. I am sure its possible because you already show on TradeActivityLog the track of orders ( very usefull ) Please check the image for clarify, also provide me an example of how to read this, I think this its the last test that I will performance before continue or leave the proyect. Thanks |
Filled_Field.PNG / V - Attached On 2016-01-15 15:57:26 UTC - Size: 33.45 KB - 320 views |
[2016-01-15 19:19:09] |
Sierra Chart Engineering - Posts: 104368 |
The below function contains a code example to get the details of an order submitted using the Internal Order ID. This code is near the bottom of the function. We added the ability to get the most recent fill price, so this will not compile until the next release which will be out today or tomorrow. SCSFExport scsf_TradingExample(SCStudyInterfaceRef sc)
{ //Define references to the Subgraphs and Inputs for easy reference SCSubgraphRef BuyEntrySubgraph = sc.Subgraph[0]; SCSubgraphRef BuyExitSubgraph = sc.Subgraph[1]; SCSubgraphRef SellEntrySubgraph = sc.Subgraph[2]; SCSubgraphRef SellExitSubgraph = sc.Subgraph[3]; SCSubgraphRef SimpMovAvgSubgraph = sc.Subgraph[4]; SCInputRef Enabled = sc.Input[0]; SCInputRef TargetValue = sc.Input[1]; SCInputRef StopValue = sc.Input[2]; if (sc.SetDefaults) { // Set the study configuration and defaults. sc.GraphName = "Trading Example"; BuyEntrySubgraph.Name = "Buy Entry"; BuyEntrySubgraph.DrawStyle = DRAWSTYLE_ARROWUP; BuyEntrySubgraph.PrimaryColor = RGB(0, 255, 0); BuyEntrySubgraph.LineWidth = 2; BuyEntrySubgraph.DrawZeros = false; BuyExitSubgraph.Name = "Buy Exit"; BuyExitSubgraph.DrawStyle = DRAWSTYLE_ARROWDOWN; BuyExitSubgraph.PrimaryColor = RGB(255, 128, 128); BuyExitSubgraph.LineWidth = 2; BuyExitSubgraph.DrawZeros = false; SellEntrySubgraph.Name = "Sell Entry"; SellEntrySubgraph.DrawStyle = DRAWSTYLE_ARROWDOWN; SellEntrySubgraph.PrimaryColor = RGB(255, 0, 0); SellEntrySubgraph.LineWidth = 2; SellEntrySubgraph.DrawZeros = false; SellExitSubgraph.Name = "Sell Exit"; SellExitSubgraph.DrawStyle = DRAWSTYLE_ARROWUP; SellExitSubgraph.PrimaryColor = RGB(128, 255, 128); SellExitSubgraph.LineWidth = 2; SellExitSubgraph.DrawZeros = false; SimpMovAvgSubgraph.Name = "Simple Moving Average"; SimpMovAvgSubgraph.DrawStyle = DRAWSTYLE_LINE; SimpMovAvgSubgraph.DrawZeros = false; Enabled.Name = "Enabled"; Enabled.SetYesNo(0); TargetValue.Name = "Target Value"; TargetValue.SetFloat(2.0f); StopValue.Name = "Stop Value"; StopValue.SetFloat(1.0f); sc.AutoLoop = 1; sc.GraphRegion = 0; // During development set this flag to 1, so the DLL can be modified. When development is completed, set it to 0 to improve performance. sc.FreeDLL = 0; //Any of the following variables can also be set outside and below the sc.SetDefaults code block sc.AllowMultipleEntriesInSameDirection = false; sc.MaximumPositionAllowed = 10; sc.SupportReversals = false; // This is false by default. Orders will go to the simulation system always. sc.SendOrdersToTradeService = false; sc.AllowOppositeEntryWithOpposingPositionOrOrders = false; sc.SupportAttachedOrdersForTrading = false; sc.CancelAllOrdersOnEntriesAndReversals= true; sc.AllowEntryWithWorkingOrders = false; sc.CancelAllWorkingOrdersOnExit = false; // Only 1 trade for each Order Action type is allowed per bar. sc.AllowOnlyOneTradePerBar = true; //This needs to be set to true when a trading study uses trading functions. sc.MaintainTradeStatisticsAndTradesData = true; return; } if (!Enabled.GetYesNo()) return; SCFloatArrayRef Last = sc.Close; // Calculate the moving average sc.SimpleMovAvg(Last, SimpMovAvgSubgraph, sc.Index, 10); // Get the Trade Position data to be used for position exit processing. s_SCPositionData PositionData; sc.GetTradePosition(PositionData) ; float LastTradePrice = sc.Close[sc.Index]; int& r_BuyEntryInternalOrderID = sc.GetPersistentInt(1); // Create an s_SCNewOrder object. s_SCNewOrder NewOrder; NewOrder.OrderQuantity = 1; NewOrder.OrderType = SCT_ORDERTYPE_MARKET; NewOrder.TextTag = "Trading example tag"; int Result; // Buy when the last price crosses the moving average from below. if (sc.CrossOver(Last, SimpMovAvgSubgraph) == CROSS_FROM_BOTTOM && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { Result = sc.BuyEntry(NewOrder); //If there has been a successful order entry, then draw an arrow at the low of the bar. if (Result > 0) { r_BuyEntryInternalOrderID = NewOrder.InternalOrderID; BuyEntrySubgraph[sc.Index] = sc.Low[sc.Index]; } } // When there is a long position AND the Last price is less than the price the Buy Entry was filled at minus Stop Value, OR there is a long position AND the Last price is greater than the price the Buy Entry was filled at plus the Target Value. else if (PositionData.PositionQuantity > 0 && (LastTradePrice <= PositionData.AveragePrice - StopValue.GetFloat() || LastTradePrice >= PositionData.AveragePrice + TargetValue.GetFloat())) { Result = sc.BuyExit(NewOrder); //If there has been a successful order entry, then draw an arrow at the high of the bar. if (Result > 0) { BuyExitSubgraph[sc.Index] = sc.High[sc.Index]; } } // Sell when the last price crosses the moving average from above. else if (sc.CrossOver(Last, SimpMovAvgSubgraph) == CROSS_FROM_TOP && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { Result = sc.SellEntry(NewOrder); // If there has been a successful order entry, then draw an arrow at the high of the bar. if (Result > 0) { SellEntrySubgraph[sc.Index] = sc.High[sc.Index]; } } // When there is a short position AND the Last price is greater than the price the Sell Entry was filled at plus the Stop Value, OR there is a short position AND the Last price is less than the price the Sell Entry was filled at minus the Target Value. else if (PositionData.PositionQuantity < 0 && (LastTradePrice >= PositionData.AveragePrice + StopValue.GetFloat() || LastTradePrice <= PositionData.AveragePrice - TargetValue.GetFloat())) { Result = sc.SellExit(NewOrder); // If there has been a successful order entry, then draw an arrow at the low of the bar. if (Result > 0) { SellExitSubgraph[sc.Index] = sc.Low[sc.Index]; } } //Example to check the status of the order using the internal order ID remembered s_SCTradeOrder TradeOrder; sc.GetOrderByOrderID(r_BuyEntryInternalOrderID, TradeOrder); // Order has been found. if (TradeOrder.InternalOrderID == r_BuyEntryInternalOrderID) { bool IsOrderFilled = TradeOrder.OrderStatusCode == SCT_OSC_FILLED; double FillPrice = TradeOrder.LastFillPrice; } } 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 Date Time Of Last Edit: 2016-01-17 22:21:37
|
[2016-01-15 19:51:50] |
User368248 - Posts: 46 |
Thanks, I will wait until new release for compiling and checking today or tomorrow.
|
[2016-01-17 22:21:06] |
Sierra Chart Engineering - Posts: 104368 |
Update to the latest prerelease for support for the additional Trade Order data fields.
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 |
[2016-01-18 01:03:13] |
User368248 - Posts: 46 |
Thanks, I am checking now!
|
To post a message in this thread, you need to log in with your Sierra Chart account: