Support Board
Date/Time: Thu, 20 Feb 2025 20:24:13 +0000
[Programming Help] - FixedValueArray - Re-Submitting
View Count: 465
[2021-01-19 13:53:50] |
User184576 - Posts: 20 |
Hi, I'd like to execute code after market price has cleared position entry + 10 points. If I hard code a price, it works - however if I reference the position data, I can't seem to get it to trigger. Any assistance would be appreciated - code is included below. Thanks //Positon Data s_SCPositionData PositionData; int openPosition = sc.GetTradePosition(PositionData); float positionEntryPrice = PositionData.AveragePrice; //Place Confirmation Price Into A Float Array To Evaluate At Crossover SCFloatArrayRef FixedValueArray= sc.Subgraph[0].Arrays[4]; FixedValueArray[sc.Index] = positionEntryPrice + 10.00; //Modify Stop Order if (sc.CrossOver(MarketPrice, FixedValueArray) == CROSS_FROM_BOTTOM) { //Modify Stop s_SCPositionData PositionData; int openPosition = sc.GetTradePosition(PositionData); float positionEntryPrice = PositionData.AveragePrice; s_SCNewOrder ModifyStopOrder; ModifyStopOrder.InternalOrderID = StopOrderID; ModifyStopOrder.Price1 = positionEntryPrice + 1.00; sc.ModifyOrder(ModifyStopOrder); } |
To post a message in this thread, you need to log in with your Sierra Chart account: