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

AddRenko() problem

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

    AddRenko() problem

    protected override void Initialize()
    {
    AddRenko("YM 03-17", 3, MarketDataType.Last);
    Overlay= true;
    DrawOnPricePanel = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    if(BarsInProgress == 1 ){
    DrawTextFixed("Tag1", "TEST", TextPosition.BottomLeft);
    }
    }


    Any Idea why this isn't working?

    #2
    Hello,

    Thank you for the post.

    Could you provide the error you are getting or result you are seeing that is not correct?

    The syntax seems to look correct so I would need to know more details on what is happening or what is not happening to further assist.

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

    Comment


      #3
      My text does not appear with the above code. I have tried moving the DrawTextFixed() method outside of the if statement and it still does not work. This leads me to believe OnBarUpdate() is not being called. If I comment out the AddRenko() line, OnBarUpdate() gets called and my Text appears in the bottom left.

      Comment


        #4
        Hello,

        Thank you for the reply.

        Yes this would be a good observation, likely something surrounding the data request is holding the script from continuing.

        Can you look in the Control Center -> Logs tab, and also the Tools -> Output window to see if any errors are being generated?

        Also are you subscribed for the instrument and can receive live/historical tick data?

        One final item, because this change was to Initialize, have you removed the script from the chart and then re applied it, or had you only F5/reload all NinjaScript? If you have only used F5, that would likely not allow the Initialize code to be run again, instead try to remove it and re add it.


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

        Comment


          #5
          Ah. Yes I am getting this error in the output window,
          "Error on calling 'OnBarUpdate' method for indicator 'Renko50SMACross' on bar 0: Bar index needs to be greater/equal 0".

          Comment


            #6
            Hello,

            Thank you for the reply.

            Could you provide an export of the script as it is currently?

            I am unsure of the result you are getting. The code you provided originally seems to work on my end, this could potentially be something else in the script. I could try to identify if that is the case, otherwise if that is not the case and it works on my end, it may be data related.



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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            6 views
            0 likes
            Last Post Belfortbucks  
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            151 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            6 views
            0 likes
            Last Post mattbsea  
            Working...
            X