Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Text Pattern Matching Problem

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

    Text Pattern Matching Problem

    NT7 seems to have a problem with text pattern matching. If I run the following code:


    strCode ="UAAA";
    Print("UAAA");
    if (strCode =="UAAA") Print("UAAA recognized");
    if(strCode=="ADAA")Print("Error! ADAA is not UAAA");



    the output window prints:

    UAAA recognized
    Error1! ADAA is not UAAA

    Can anyone please explain this?

    #2
    This level of programming is pure C# .NET and outside of anything that NinjaTrader controls. Looking at your code I would be baffled as well since for sure you should not have the second print line thus, you must some other code else where that would trigger the second print line.
    RayNinjaTrader Customer Service

    Comment


      #3
      Pattern Matching Problem

      Hello Ray,

      That is the only code in the "indicator", since I wrote it specifically to check out a problem that I was having somewhere else. However, the Substring function works as expected to check for the presence of specific characters at specific locations in the string, That is the workaround I am using for now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X