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

How to code this: C[1]+C[0] / 2

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

    How to code this: C[1]+C[0] / 2

    Hello,
    can anyone helpe me to write this simple Indicator ? In the end it should be able to be represented as line, point or both. Of course i´m not a programmer - otherwise it would be no problem.

    Thanks!

    #2
    Deongenes,

    Thank you for your post.

    Is this Close[1] + Close[0]?

    And are you adding the two closes together and then dividing them? Or diving the current close (Close[0]) by two and adding the last close (Close[1]) to it?

    I look forward to your response.

    Comment


      #3
      Patrick, Hello
      yes, adding the two closes ( [1] + [0] / 2 ) and then dividing the result.

      Comment


        #4
        Hello Deogenes,

        Thank you for your response.

        So what do you want to do with that calculation? Create a plot based off the value?

        I look forward to your response.

        Comment


          #5
          yes that's right.

          Example in the chart: At the intersections limit orders are possible. At higher high combine the previous low. This produces a cross. When buying reversed. That's the idea behind it.

          So: Close before + current close / 2 .
          Attached Files

          Comment


            #6
            Hello Deogenes,

            Thank you for your response.

            I have created a small sample of your calculation used as a plot for your reference attached to this post.

            You can download this indicator and import using the instructions at the following link: http://www.ninjatrader.com/support/h...nt7/import.htm

            Please let me know if you have any questions.
            Attached Files

            Comment


              #7
              Hello Patrick,
              that was what I wanted.
              But I see now that it corresponds exactly to the SMA with 2 periods. Very funny:-)) but at least now I know where I have to use what, for an indicator. I laugh still, thinking about this error. However, thank you Patrick.
              Regards

              Comment


                #8
                Hello Patrick,
                that was what I wanted.
                But I see now that it corresponds exactly to the SMA with 2 periods. Very funny:-)) but at least now I know where I have to use what, for an indicator. I laugh still, thinking about this error. However, thank you Patrick.
                Regards
                Hi Deongenes

                A year ago, I was totally new to coding! As they say, "the longest road starts with the first step".

                These are essentially the steps I took myself to learn how to code.

                One of the first steps on this long road is to play around with Ninja as much as possible. In the first instance, try and create whatever strategies you like using the Strategy Wizard. When you're playing with the it, click the 'View Code' button to see the coding. This is so important.

                The next big step is to click the 'Unlock Code' button - then you're on your own!

                The next step after that, in my opinion, is to create your own indicators, and then read up about C# and start using loops, etc., to achieve this. That's when you begin to see how fantastically powerful Ninja can be.

                Best of luck.
                Last edited by arbuthnot; 03-08-2013, 02:59 PM.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by andrewtrades, Today, 04:57 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by chbruno, Today, 04:10 PM
                0 responses
                3 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by josh18955, 03-25-2023, 11:16 AM
                6 responses
                436 views
                0 likes
                Last Post Delerium  
                Started by FAQtrader, Today, 03:35 PM
                0 responses
                7 views
                0 likes
                Last Post FAQtrader  
                Started by rocketman7, Today, 09:41 AM
                5 responses
                19 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X