Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Skip Part of Code

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

    Skip Part of Code

    Hi, is there a way to use certain characters in coding so we can skip part of code? For instance I know using "//" any code after that in that line won't be executed but I am more interested in skipping on part of the line; for example, in code below what if I wanted program to skip part of the line between quotation markers and execute excluding that part:

    if ("ToTime(Time[0]) > DailyTradingFinishTime &&" QuantityBeforeExecution != OrderCountLong && Position.Quantity == 0)

    #2
    Hello shahabjet1,

    Thank you for your post.

    To clarify, are you wanting to comment out a certain section of code from your condition?

    Please note that in the support department at NinjaTrader we do not provide C# programming education services. This is so that we can maintain a high level of service for all of our clients as well as our partners.

    That said, to comment out a section of your condition you could use a Multiple Line Comment ( /*Text here*/ ). See the publicly available link for more information - https://www.w3schools.com/cs/cs_comments.asp

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Originally posted by shahabjet1 View Post
      Hi, is there a way to use certain characters in coding so we can skip part of code? For instance I know using "//" any code after that in that line won't be executed but I am more interested in skipping on part of the line; for example, in code below what if I wanted program to skip part of the line between quotation markers and execute excluding that part:

      if ("ToTime(Time[0]) > DailyTradingFinishTime &&" QuantityBeforeExecution != OrderCountLong && Position.Quantity == 0)
      Yes.

      Use the delete key on your keyboard to delete the characters between the quotes.

      Comment


        #4
        shahabjet1 , this is what you looking for.

        Use goto code.
        You can refer the link below to know how to used it :
        C# jump statements (break, continue, return, and goto) unconditionally transfer control from the current location to a different statement.


        Example :
        Code:
        goto exampleNAME;
        
        This is where the part you want to skip
        ......
        .....
        ....
        
        
        exampleNAME :  do anything here

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        45 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        31 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X