Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy opens a null order

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

    Strategy opens a null order

    Hi i have a strategy that opens a null limit order and i dont know how to debug it and dont understand why it is doing it.

    my Entry condition

    Code:
    if(shortPrice <= GetCurrentBid() && entryOrderS == null && profitTargetS == null && stopLossS == null)
                    {
                    entryOrderS        = placeHolderOrderS;
                    suppressOcoS    = false;
                    EnterShortStopMarket(0,true, PositionSize, shortPrice,"MyEntryShort");
                        
                    }​
    As soon as I enter I print entryOrder
    Print("entryOrder"+entryOrder);

    and iN output I get null entryorder entryOrder and order seems like staying in strategy and not taking more trades. Usually strategy takes order and prints full order details but sometimes i get this.




    #2
    Hello tkaboris,

    The code you provided does not contain a variable named entryOrder and I also don't see your print included in that code.

    To assign an order to a variable you would need to use OnOrderUpdate, you can see an example of that concept in the help guide link below.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    53 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X