Login Page - Create Account

Support Board


Date/Time: Thu, 06 Feb 2025 17:17:03 +0000



Post From: sc.GetOrderByOrderID

[2020-04-29 08:51:27]
User701453 - Posts: 176

No it shouldn't. Are you sure you are using the right variable?
Yes, I know it shouldn't, but it does.
What version of SC are you using?

I can see the value change in local when I step into the break point.
Code block below when i set the persistent variable value.
I have used the code blocks before in previous strats and it has worked as expected.


  if (Result > 0)
              {
                // Remember the order IDs for subsequent modification and cancellation
                 EntryOrderID = NewOrder.InternalOrderID;
                
                Target1OrderID = NewOrder.Target1InternalOrderID;
                Target2OrderID = NewOrder.Target2InternalOrderID;
                Target3OrderID = NewOrder.Target3InternalOrderID;
                Stop1OrderID = NewOrder.Stop1InternalOrderID;
                Stop2OrderID = NewOrder.Stop2InternalOrderID;
                StopAllOrderID = NewOrder.StopAllInternalOrderID;
                BarIndexOfOrder = sc.Index;

              
                sc.AddMessageToLog(sc.GetTradingErrorTextMessage(Result), false);
                
              }