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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X