Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Ninja Script Print command fails to show on chart.
Trading: Index and Stock options, Stocks (seldom), Nadex (just starting), Forex
Posts: 33 since Oct 2012
Thanks Given: 47
Thanks Received: 26
I am trying to use the Print(variable); command in a strategy... DrawDot works and shows on the screen.. but no variable or text will show with the Print. Any idea where the printed output is supposed to show up or how to get it to show up on the chart?
(I need this for debugging code).
Can you help answer these questions from other members on NexusFi?
The methods DrawText() and DrawTextFixed(), described in the Ninjatrader Help, will do what you are requesting.
The Print statement is generally used to print diagnostic statements useful for code development.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
The following user says Thank You to Zondor for this post:
Trading: Index and Stock options, Stocks (seldom), Nadex (just starting), Forex
Posts: 33 since Oct 2012
Thanks Given: 47
Thanks Received: 26
Normally I would say thank you for your rapid response to my simple question but not this time.
I have worked in computer technical support for over 40 years... and one reply to a customer with "RTFM" in it would get me fired at any company I have worked for. Yes, it is OK to think it, but not say it.
I had found the definition of the print command in help, but no description of the window it was to display in. Perhaps you should think back to when you were a new user and didn't know this "non-intuitive platform"... this is my first question on my first actual ninja script program.
So the final result is "YOU ARE FIRED". Please don't respond to any of my questions in the future as I really don't want to put you to any "trouble". And yes, I try to use help and "the non existent" manual before I ask any question.
Response was timely at least.
Sincerely, Gary
The following user says Thank You to TheGaryGuy for this post:
Trading: Index and Stock options, Stocks (seldom), Nadex (just starting), Forex
Posts: 33 since Oct 2012
Thanks Given: 47
Thanks Received: 26
Zondor: Thank you again and you are right the print statement (and having the output window up so you can see the results of your calculations (or anything) is great.
One word of warning however for those who have not experienced this: I have learned that running code with the print() commands active in the optimizer will hang NinjaTrader! It keeps calling for more and more memory and finally there is none to be had. BEWARE Print() when Optimizing!
Trading: Index and Stock options, Stocks (seldom), Nadex (just starting), Forex
Posts: 33 since Oct 2012
Thanks Given: 47
Thanks Received: 26
Thanks for this link! I really needed the PDF so i can read and mark it up like any reference book. Using the online version (for me) is like trying to filter the ocean through a straw.