So I am left with using prints after almost every single line? Previously, my code worked. But with added code from manual, it started to fail. If you could load it up in your system and run, maybe you as an expert could spot a problem much easier than I would.
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
Cancel EnterLongStopMarket order if it is not triggered after 5 bars
Collapse
X
-
I watched the screencast video and will try to make something with Visual studio tomorrow. But I still don't understand. If it stops the script at breakpoints, how would I know which part contains an error? If I don't set the breakpoint at "correct" (i.e. containing an error) location, it would just run and that's it?
So I am left with using prints after almost every single line? Previously, my code worked. But with added code from manual, it started to fail. If you could load it up in your system and run, maybe you as an expert could spot a problem much easier than I would.
-
Hello UltraNIX,
The break points would let you step through parts of the code. If you hit a break point and the script is still running, the code up to that break point was not the cause and ran without issue, then it gets to the next break point, and the next, until the error occurs and we know the code in between two break points is the issue.
Using prints we would be seeing the prints appear and know the code before the print is ok. When the prints stop appearing and the error occurs, we know the code below the last print is where the issue is.
Yes, using prints and debugging is also the process we all use to find issues.
(This is why I put together videos that demonstrate the process we use to find issues)
I am not able to debug a script on your behalf.
Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.
That said, I am happy to answer any questions you may have about NinjaScript if you decide to continue.
You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostI am not able to debug a script on your behalf.
Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.
That said, I am happy to answer any questions you may have about NinjaScript if you decide to continue.
I am sure that other people would also benefit from this technique and could use in their solutions.
By the way, I downloaded 74 strategies from this site for NinjaTrader 8 and NONE use any CancelOrder method.
I again searched in Google, searched in this forum, found couple other topics, tried to adapt the code, still nothing is working. And it's so painful.
Comment
-
Hello UltraNIX,
We have a sample of using CancelOrder in the help guide reference samples area, you can see it here: https://ninjatrader.com/support/help...thod_to_ca.htm
This specifically uses an EnterLongLimit but otherwise contains what you are asking to do. You could modify this to use a stop market if you would like to see that happen.
I would suggest to review all of the reference samples we have in the help guide. We have most of the basic concepts surrounding common tasks so they can be very useful starting points or can be used to copy/paste concepts into your script.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jesse View PostHello UltraNIX,
We have a sample of using CancelOrder in the help guide reference samples area, you can see it here: https://ninjatrader.com/support/help...thod_to_ca.htm
This specifically uses an EnterLongLimit but otherwise contains what you are asking to do. You could modify this to use a stop market if you would like to see that happen.
I would suggest to review all of the reference samples we have in the help guide. We have most of the basic concepts surrounding common tasks so they can be very useful starting points or can be used to copy/paste concepts into your script.
I look forward to being of further assistance.
Comment
-
Hello UltraNIX,
If you tried something that didn't work out we generally suggest to make a post about that and include a sample of what you tried with the steps to see the problem. We can only assist if we know what problem you are having and because you made modifications we won't know what you did there.
The sample is intended to work as is but if you start making modifications that could certainly prevent it from working. We generally would suggest to use Prints regularly in your code to make sure the code is executing as you expect it to. If its not the prints can help to highlight that as a debugging step. I saw that you were trying to use visual studio to debug it however we won't be able to assist with that specifically so Prints are a good alternative so that we can assist.
Please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by yertle, Yesterday, 08:38 AM
|
7 responses
28 views
0 likes
|
Last Post
by yertle
Today, 12:15 AM
|
||
Started by bmartz, 03-12-2024, 06:12 AM
|
2 responses
20 views
0 likes
|
Last Post
by bmartz
Today, 12:11 AM
|
||
Started by funk10101, Today, 12:02 AM
|
0 responses
4 views
0 likes
|
Last Post
by funk10101
Today, 12:02 AM
|
||
Started by gravdigaz6, Yesterday, 11:40 PM
|
1 response
8 views
0 likes
|
Last Post Yesterday, 11:49 PM | ||
Started by MarianApalaghiei, Yesterday, 10:49 PM
|
3 responses
10 views
0 likes
|
Last Post Yesterday, 11:33 PM |
Comment