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!
See more
See less

Partner 728x90

Collapse

How to stop drawing Draw.Rectangle()

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

    #31
    Hello,

    Thanks for the reply.

    I am unable to reproduce this with your script. The draw objects will draw to the chart if I comment out the print statement. If there is only a Print statement within an IF condition, this will not affect logic flow for drawing to the chart. Are you sure you are compiling the code and reloading the script on the chart with F5? Are there any errors in the log tab of your Control Center.

    I look forward to your reply.
    Chris L.NinjaTrader Customer Service

    Comment


      #32
      Chris,
      As you can see in the video below, the print statement does affect logic flow. No errors in the log tab. Its the only indicator on the chart.

      https://www.screencast.com/t/pskS8YhjVv6u

      Thanks,Woody.

      Comment


        #33
        Hello,

        Thanks for the reply.

        When you remove the Print statement, then the code underneath it will be evaluated only if the IF statement is true. When you have the Print statement added in, the code underneath the Print statement will always be run, because control is taken away from the IF block once the Print line has been executed.

        Example:

        Code:
        if(true)
                Print("This will be evaluated if true");
        {
                Print("This will be evaluated no matter what.");
        }
        Code:
        if(true)       
        {
                Print("This will be evaluated if true");
        }
        Please let us know if we may be of any further assistance.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderqz, Today, 12:06 AM
        5 responses
        8 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Mongo, Today, 11:05 AM
        2 responses
        7 views
        0 likes
        Last Post Mongo
        by Mongo
         
        Started by guillembm, Today, 11:25 AM
        0 responses
        3 views
        0 likes
        Last Post guillembm  
        Started by Tim-c, Today, 10:58 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by traderqz, Yesterday, 09:06 AM
        4 responses
        27 views
        0 likes
        Last Post traderqz  
        Working...
        X