Support Board
Date/Time: Sat, 15 Mar 2025 13:39:11 +0000
Request for Feature Improvement - Custom Trading Command - Offset from Reference Price
View Count: 87
[2025-03-11 23:33:26] |
E1ite51 - Posts: 3 |
Hello, I'd like to request a small feature improvement. For reference, I'll explain the example below. In the Custom Trading Commands, there is an option to select an Offset from Reference Price. I'm using a Limit Chase order, with let's say a -80 offset from the reference price. The reference price being used is the Last. So, if Price is at 4120, this let's me place an order at 4100, and chase it. Now, functionally, it's perfect as is, and allows me to manage the order quantity, stop + trail and profit brackets from the trade window, exactly what I want! However, I need to be able to select larger, custom chosen offset ticks, beyond the range of 100 that is offered. My Request is this: Rather than a pre-defined range from -100 tick offset to +100, allow me to enter a custom integer number. So I can do -800, or +1400, if that is suitable for me. Particularly for higher timeframes, this is necessary. Alternatively, I tried to create a spreadsheet, and custom code script, but did not have any luck. My chatgpt made script had critical cpu exceptions. And the spreadsheet guidance on gpt is also lacking / incorrect. Lastly, all of that complexity, is unnecessary, as this function works natively. The range simply needs to be unlocked so I can enter larger offset ticks. This is the primary reason I switched back to Sierra Chart, for this convenient and natively functioning setup. Please change this so it's no longer limited to only a 100 tick +- range, and let the user enter in their own desired offset value. Lastly, if at all, it isn't possible to leave it as an open, user enterable integer amount, then extend the range up, from -2000 to +2000. That way, there is plenty of flexibility for various use cases. |
Attachment Deleted. ![]() |
[2025-03-13 16:43:55] |
E1ite51 - Posts: 3 |
Any feedback / confirmation on this? Or timeframe that can be expected for this to be rolled out? I'm trading it live with an eval service, and am not able to fully take advantage of Sierra Charts to its full potential, while this limitation is present. Hopeful to have it unlocked soon!
|
[2025-03-14 15:54:56] |
E1ite51 - Posts: 3 |
I've tried to create a custom study script, it is buggy, but works. For some reason though, it doesn't work for a quantity greater than 1. Any help would be appreciated. I'd like it to use the quantity from the trade window. It is successfully using the bracket from the trade window, but any quantity more than 1, does not enter. And I'd like it to stop running after 1 order is entered. For now, it doesn't keep placing more orders, but the script still keeps running with messages of failed further error placements. Any help in bringing this script to the finish line would be appreciated. --------------------------------------------------------------------------------------- #include "sierrachart.h" // Include the Sierra Chart API SCDLLName("One-Time Buy Limit Chase Order") // Define the study/DLL name SCSFExport scsf_BuyLimitChase(SCStudyInterfaceRef sc) // Main study function { // ------------------- Setting Defaults ------------------- if (sc.SetDefaults) // This block runs once when the study is loaded to set defaults { sc.GraphName = "One-Time Buy Limit Chase Order"; // Name of the study as it appears in the Studies window sc.StudyDescription = "Places a Buy Limit Chase Order at Last Price - 40 Ticks using Trade Window configuration for quantity and attached orders."; // Description for documentation purposes sc.AutoLoop = 1; // Enable AutoLoop so the study is executed on every new bar/tick sc.FreeDLL = 1; // Unload this study from memory after execution (if applicable) // Enable usage of Trade Window configuration: sc.SupportAttachedOrdersForTrading = 1; // Allow the study to use attached (bracket) orders as configured in the Trade Window sc.UseGUIAttachedOrderSetting = 1; // Instruct Sierra Chart to use the GUI (Trade Window) settings for bracket orders return; // Exit the defaults block } // ------------------- End Defaults ------------------- // Prevent repeated execution in the same bar if (sc.LastCallToFunction) { return; // Exit if this is the final call for the bar } // Only execute the order logic on the most recent bar if (sc.Index == sc.ArraySize - 1) { // Retrieve the last traded price from the current bar double LastPrice = sc.Close[sc.Index]; // Calculate the offset for the order (40 ticks) - we ignore C4244 warnings as requested double TickOffset = 40.0 * sc.TickSize; // Determine the price at which to place the order (40 ticks below last price) double OrderPrice = LastPrice - TickOffset; // Use a persistent variable to ensure only one order is placed per study load int &OrderPlaced = sc.GetPersistentInt(1); if (OrderPlaced == 1) { return; // Exit if an order has already been placed } // ------------------- Create New Order ------------------- s_SCNewOrder NewOrder; // Create a new order object to be submitted // Set the order quantity to use the value configured in the Trade Window: NewOrder.OrderQuantity = sc.TradeWindowOrderQuantity; // This ensures that the quantity from the Trade Window is used (do not hardcode) // Specify the order type as Limit Chase NewOrder.OrderType = SCT_ORDERTYPE_LIMIT_CHASE; // Set the order price calculated above (40 ticks below the last traded price) NewOrder.Price1 = OrderPrice; // Set the order's time in force to Good-Til-Canceled (GTC) NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED; // ------------------- End New Order Creation ------------------- // Submit the order using BuyEntry. The attached orders (bracket orders) and quantity will be taken from the Trade Window settings. int Result = sc.BuyEntry(NewOrder); if (Result > 0) { sc.AddMessageToLog("✅ Buy Limit Chase Order Placed at Last Price - 40 Ticks (Using Trade Window Config)", 1); // Log success if the order submission returns a positive result OrderPlaced = 1; // Mark that an order has been placed so that duplicate orders are prevented } else { sc.AddMessageToLog("❌ Order Submission Failed", 1); // Log failure if the order submission returns 0 or a negative value } } } |
To post a message in this thread, you need to log in with your Sierra Chart account: