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

Variable rounded

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

    Variable rounded

    I coded the attached indicator which has two inputs, Upper and Lower, each set to .03. When applied to a chart, the indicator window shows them at that value.

    But the indicator doesn't work. To debug, I print the values to the Output Window which shows that both upper and lower or Upper and Lower are rounded to 1 -- which throws everything out of range.

    I'm pretty sure that the double data type allows for the .03.

    What's changing this?

    ALSO: My square now print in the price window. Is there a way to make them print in the MACD window?

    Thanks.
    Attached Files

    #2
    Two things:

    1. Your public variables in the properties section are ints not doubles.

    2. You have "Math.Max(1, value)" in the properties section which will always round the number up to at least 1.

    The other problem:

    All draw objects will output to the price window unless you specify 'DrawOnPricePanel' to false in Initialize() (as I mentioned earlier).
    Last edited by Gumphrie; 08-02-2007, 04:52 PM.

    Comment


      #3
      Thanks. The Math.Max setting was done automatically by the NinjaTrader code generator. But I changed the settings of those and the function works fine.

      Thanks also for the panel info. I must have missed it in your posts to others.

      Thanks so much.

      Comment


        #4
        The wizard does allow you to set a "double" type input instead of integer.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        31 views
        0 likes
        Last Post love2code2trade  
        Started by cls71, Today, 04:45 AM
        2 responses
        10 views
        0 likes
        Last Post eDanny
        by eDanny
         
        Started by proptrade13, Today, 11:06 AM
        0 responses
        4 views
        0 likes
        Last Post proptrade13  
        Started by kulwinder73, Today, 10:31 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X