if ("ToTime(Time[0]) > DailyTradingFinishTime &&" QuantityBeforeExecution != OrderCountLong && Position.Quantity == 0)
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Skip Part of Code
Collapse
X
-
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)Tags: None
-
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.Brandon H.NinjaTrader Customer Service
-
Originally posted by shahabjet1 View PostHi, 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)
Use the delete key on your keyboard to delete the characters between the quotes.
Comment
-
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 bortz, 11-06-2023, 08:04 AM
|
47 responses
1,603 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
12 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment