Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check if OrderName contains a string

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

    Check if OrderName contains a string

    Hi there,

    I have multiple entry /exit points. Each signal name is unique, "EMA"+CurrentBar, "MACD"+CurrentBar and so on.

    Is there any way to check if I have any EMA order open, searching by the string name?

    Something like, if the order name contains "EMA", do something.

    I'm just trying to find a way to match the order based on a substring.

    Thank you

    #2
    Hello chbruno,

    Thank you for your post.

    First, to find a signal name, you will need to save your entries as an Order object.

    For example,
    Code:
    Order myOrder = EnterLong( 1, "mySignal" );
    
    Print(myOrder.Name);
    
    Print(myOrder.FromEntrySignal);
    Then, you can use String.Contains() to see if the signal name contains "EMA".

    String.Contains method- https://learn.microsoft.com/en-us/dotnet/api/system.string.contains?view=netframework-4.8.1

    Order - https://ninjatrader.com/support/help.../nt8/order.htm

    Please let me know if you have any other questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    20 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    119 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X