Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetRealtimeOrder() returns null

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    GetRealtimeOrder() returns null

    Hi,
    when following the guidance in the documentation, valid non-null orders can get returned as null from GetRealtimeOrder(). This wrecks the strategy's order and position management of course.
    I have had to check for this situation with the following code example.

    Code:
    private void UpdateOrdersToRealtime()		// Update per strategy for any relevant Order objects used in the strategy
    		{
    			Print("UpdatingOrdersToRealtime()");
    			if (LE != null)
    			{
    				Print("transition "+LE.ToString());
    				Order o = GetRealtimeOrder(LE);
    				if (o==null)
    					Print("Transition returned null");
    				else
    					LE = o;
    				Print(LE.ToString());
    			}
    		}
    Hope this helps somebody. It sucked up a few hours of my time figuring out what was going on.

    Cheers,
    saltminer.

Latest Posts

Collapse

Topics Statistics Last Post
Started by carnitron, Today, 08:42 PM
0 responses
5 views
0 likes
Last Post carnitron  
Started by strategist007, Today, 07:51 PM
0 responses
6 views
0 likes
Last Post strategist007  
Started by StockTrader88, 03-06-2021, 08:58 AM
44 responses
3,974 views
3 likes
Last Post jhudas88  
Started by rbeckmann05, Today, 06:48 PM
0 responses
8 views
0 likes
Last Post rbeckmann05  
Started by rhyminkevin, Today, 04:58 PM
4 responses
58 views
0 likes
Last Post dp8282
by dp8282
 
Working...
X