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 JonesJoker, 04-22-2024, 12:23 PM
            8 responses
            41 views
            0 likes
            Last Post JonesJoker  
            Started by timko, Today, 06:45 AM
            0 responses
            3 views
            0 likes
            Last Post timko
            by timko
             
            Started by Waxavi, 04-19-2024, 02:10 AM
            2 responses
            39 views
            0 likes
            Last Post poeds
            by poeds
             
            Started by chbruno, Yesterday, 04:10 PM
            1 response
            44 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Max238, Today, 01:28 AM
            1 response
            25 views
            0 likes
            Last Post CactusMan  
            Working...
            X