Announcement

Collapse
No announcement yet.

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.

    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.

        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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X