Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print("CP" +Close.GetValueAt(CurrentBar));

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

    Print("CP" +Close.GetValueAt(CurrentBar));

    Hello,

    I rename an indicator and there was a message saying: rename can cause compile errors.
    I try to Print("CP" +Close.GetValueAt(CurrentBar));
    But the value appears only when i refresh the indicator in the output window.

    The close price should be refreshing automatically?

    TY

    #2
    Hello frankduc,

    Thank you for your post.

    Was the indicator that was renamed one of the system indicators or one that you've created?

    Where within the code is your print statement? If it's within OnBarUpdate, is there a particular reason you're not printing the close price using Close[0] instead?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Kate,

      Its my indicator.
      I just copy/paste an indicator i had created.
      By defautl it created the named indicator Myindicator6, than i renamed with the desired name.

      I did a few modification but nothing important. Iv been double checking for an hour, i dont see any reason not to work.

      The Print is in protected override void OnRender(ChartControl chartControl, ChartScale chartScale)

      One of my variable return 0.00007 when it should be returning 0.07 and all variables related to that variable are ok and return the right value.

      I get an error message saying : Indicator 'NEWSDBAdown': Error on calling 'OnRender' method on bar 2575: Sequence contains no elements

      TY

      Comment


        #4
        Hello frankduc,

        Thank you for your reply.

        You'll need to use prints to isolate which line is causing that error, and include that line in your reply. I'd add numbered prints to help you isolate exactly which line is having the issue.

        Likely the not updating is due to the error you're receiving.

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Kate,

          Now i have bid troubles i can modify any of my indicators.

          I get errors in red for every indicators i tried to modify:


          NinjaScript File Error Code Line Column SBDDownTest.cs Type 'NinjaTrader.NinjaScript.Indicators.Indicator' already contains a definition for 'cacheSBDDownTest' CS0102 33 25


          NinjaScript File Error Code Line Column SBDDownTest.cs Type 'NinjaTrader.NinjaScript.Indicators.Indicator' already defines a member called 'SBDDownTest' with the same types of parameters CS0111 36 22


          NinjaScript File Error Code Line Column SBDDownTest.cs Type 'NinjaTrader.NinjaScript.MarketAnalyzerColumns.Mar ketAnalyzerColumn' already defines a member called 'SBDDownTest' with the same types of parameters CS0111 60 33


          NinjaScript File Error Code Line Column SBDDownTest.cs Type 'NinjaTrader.NinjaScript.Strategies.Strategy' already defines a member called 'SBDDownTest' with the same types of parameters CS0111 80 33


          NinjaScript File Error Code Line Column SBDDownTest.cs Type 'NinjaTrader.NinjaScript.Strategies.Strategy' already defines a member called 'SBDDownTest' with the same types of parameters CS0111 87 33


          I try deleting every indicators where the error is coming from but it just keep popping errors for other indicators unrelated.
          I had this problem once but dont remember how its been solve, some of your tech knew the answer.

          TY

          Comment


            #6
            Forget about it, problem solve!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, Yesterday, 10:06 AM
            0 responses
            17 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            16 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            9 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            38 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X