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

Drawing Objects on Chart

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

    Drawing Objects on Chart

    Hi
    I am trying to make a simple indicator test where the indicator reads the lines drawn on a chart. But it seems thar the line that was drawn on the chart is not registered in the DrawObjects colleaction as the collection comes up empty. I have attched a image of the simple code and the chart. What am I doing wrong here ?

    Regards,
    Sune
    Attached Files

    #2
    Hello SuneSorgenfrei,

    Thanks for your post.

    Please see the DrawObjects documentation for notes on accessing the DrawObjects collection. There is no guarantee a manually drawn object or object drawn from a separate script will be added to the DrawObjects collection before an indicator starts processing data, but you can consider checking after State.Realtime.

    DrawObjects - https://ninjatrader.com/support/help...rawobjects.htm

    States - https://ninjatrader.com/support/help...tatechange.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim
      What this also mean that the Chart instrument needs to have the Markets open ? Or does thtat not matter ?

      Best Regards,
      Sune

      Comment


        #4
        Hello Sune,

        If you check for State == State.Realtime in OnStateChange, then you can capture when the script is ready to process realtime data, without needing incoming ticks.

        You may place a print in a check for State == State.Realtime in OnStateChange, and test on a chart when you are disconnected to confirm.

        Let us know if you have any additional questions.
        Last edited by NinjaTrader_Jim; 06-30-2020, 10:25 AM.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ScottWalsh, Today, 06:52 PM
        0 responses
        0 views
        0 likes
        Last Post ScottWalsh  
        Started by ftsc2022, 10-25-2022, 12:03 PM
        5 responses
        255 views
        0 likes
        Last Post KeyonMatthews  
        Started by ScottW, Today, 06:09 PM
        0 responses
        3 views
        0 likes
        Last Post ScottW
        by ScottW
         
        Started by Board game geek, 10-29-2023, 12:00 PM
        14 responses
        244 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        4 responses
        56 views
        0 likes
        Last Post sonia0101  
        Working...
        X