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

Drawline

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

    Drawline

    I am trying to setup some draw items in my NT script for when and where I am bid or offered and where my stop and target is when in a position. However Here is one line of my code below and I am not seeing an items draw on the chart, what am i missing:-
    Code:
    DrawLine("bid @ bar " + item.Key + CurrentBar, false, 0, item.Key, 0, item.Key, Color.Black, DashStyle.Solid, 2);
    every draw item has a unique tag so they should all be drawn, but nothing.

    #2
    Hello,

    Thank you for the question.

    I see that this is likely being called in a Loop based on the item.Key being used.

    Can you confirm the Price values you are using are valid? I.E. if you use Close[0] instead of item.Key do you see the lines? If the item.Key is not a price value, and you have false for AutoScale, likely the line is being plotted by off screen. You could try turning AutoScale to true instead to have the scale adjust to check for that.

    Otherwise, if this is in a loop, are there items in the collection or is the loop iterating? Have you tried using prints to confirm the logic is being executed where you have this DrawLine?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      I am stepping tho the code with Visual Studio, the item.Key is valid double price. I have tried switching auto scale to true but still no lines.

      Comment


        #4
        Hello,

        Thank you for the reply.

        I would be unsure without further context of the code, have you tried drawing using specific values such as Close[0]? Or have you taken the drawing objects out of the loop scope and placed it somewhere you can verify it works correct?

        Also is this on the main panel or in a secondary panel?

        If you can ensure the draw command works somewhere outside of the current scope using generic prices, you could move it more into the scope of the loop and locate the problem that way possibly. It would be hard to say at this point without a sample that shows the issue so we could look at what my be happening.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DayTradingDEMON, Today, 09:28 AM
        4 responses
        21 views
        0 likes
        Last Post DayTradingDEMON  
        Started by geddyisodin, Yesterday, 05:20 AM
        9 responses
        50 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by George21, Today, 10:07 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by Stanfillirenfro, Today, 07:23 AM
        9 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by navyguy06, Today, 09:28 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X