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

.Set with two parameters

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

    .Set with two parameters

    Hi,

    I have an indicator in NT7 that has this code:

    Linea1.Set(1, Linea2[1]);

    How can I write this code for NT8, please?

    Thanks and regards.

    #2
    Hello soyjesus,

    Thank you for your post.

    You would reference the specific index but 'Set' is no longer present. For example:
    Code:
    Linea1[1] = Linea2[1];
    Please refer to the information on Plots at the following link: http://ninjatrader.com/support/helpG...n-us/plots.htm
    Please also reference the code breaking changes: http://ninjatrader.com/support/helpG...ng_changes.htm

    Please let me know if you have any questions.

    Comment


      #3
      Hi
      I am trying to begin the (lengthy) process of converting to Ninja8, and on one indicator i am down to the last couple of errors but have hit a wall... I have a similar issue with .Set .....In ninja7 it works (obviously) and i have

      if(CurrentBar<tlength+1) return;
      Havg = SMA(High,tlength)[1];
      Lavg = SMA(Low,tlength)[1];
      if(Input[0]<Lavg) swing = -1;
      if(Input[0]>Havg) swing = 1;
      if(swing==-1)
      {
      if(previous_swing!=swing) Draw.ArrowDown(this, CurrentBar.ToString(), true, 0, Havg, Brushes.Gold);
      S=Havg;
      }
      where Lavg is a double. I have tried using the following in Ninja8
      S = Lavg;
      but its saying that the "property or indexer .... cannot be assigned to - it is read only" and also "cannot implicitly convert type 'double' to 'NinjaTrader.NinjaScript.Series<string>'

      Any ideas?

      Thanks in advance....

      Comment


        #4
        Hello Daniel008,

        Thank you for the post.

        I am reviewing your inquiry and will be back with a reply shortly.

        I look forward to assisting further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello Daniel008,

          Thank you for your patience.

          I will need more information about the line where this error is occurring.

          Can you please locate the line of code where this error is occurring and post it in your next reply?

          You reference this line in your initial inquiry:

          S = Lavg;

          If this is the line where the error occurs, please post the lines where these variables are initially declared.

          I look forward to your reply.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Hi Chirs - thanks for replying, but since posting i've soted it out. Thanks again

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            4 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            41 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Working...
            X