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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    52 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    29 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    194 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    355 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    274 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X