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 PaulMohn, Today, 05:00 AM
        0 responses
        8 views
        0 likes
        Last Post PaulMohn  
        Started by ZenCortexAuCost, Today, 04:24 AM
        0 responses
        6 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by ZenCortexAuCost, Today, 04:22 AM
        0 responses
        3 views
        0 likes
        Last Post ZenCortexAuCost  
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        16 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        5 views
        0 likes
        Last Post DanielTynera  
        Working...
        X