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

Help to make the indicator AP down price movement

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

    Help to make the indicator AP down price movement

    If the price makes the tick up and the bar closes is to buy(draw candle green - candle 1), then the transactions transactions are and the price is too purchase(draw candle green candle 2), then the price does tick down and closed(draw a red candle-the candle of 3), next deals deals go and the price is worth it-also selling(painting candle red candle 4).

    #2
    Hello AS007,
    Thanks for your post.

    I'm assuming this is the pseudo code for your strategy? If so, have you tried to implement this pseudo code yet?

    If not, is there a specific part that's holding you up?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi! No it's a time frame that builds a chart on this algorithm:If we have the price tick up-it is written as a purchase
      If the price makes a tick up and stands at a level and there are some transactions, it is still recorded purchase
      If the price makes a tick down-it is recorded as a sale
      If the price makes a tick down and stands at a level and there are some transactions, then the sale is still recorded

      Comment


        #4
        Hello AS007,

        Thank you for your response.

        Do you have an example chart you could take a screenshot of to provide further context to the items detailed in your initial inquiry?
        Originally posted by AS007 View Post
        If the price makes the tick up and the bar closes is to buy(draw candle green - candle 1), then the transactions transactions are and the price is too purchase(draw candle green candle 2), then the price does tick down and closed(draw a red candle-the candle of 3), next deals deals go and the price is worth it-also selling(painting candle red candle 4).
        I look forward to assisting you further.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello AS007,

          Thank you for your response.

          Do you have an example chart you could take a screenshot of to provide further context to the items detailed in your initial inquiry?


          I look forward to assisting you further.
          File in attachment. It is better to watch of course on the time frame of one second, it is clearly understandable.
          Attached Files

          Comment


            #6
            Originally posted by AS007 View Post
            File in attachment. It is better to watch of course on the time frame of one second, it is clearly understandable.
            File in attachment
            Attached Files

            Comment


              #7
              Hello AS007,

              Thank you for your response.

              So this would be a pre-existing bars type in another platform, is that correct? If so, can you provide the name of the bars type?

              In addition, can you help me to expand and elaborate on your initial inquiry?
              • If the price makes the tick up and the bar closes is to buy(draw candle green - candle 1).
                So the Close is greater than the Open, is that correct?
              • Then the transactions transactions are and the price is to purchase(draw candle green candle 2).
                Can you elaborate on the "price is to purchase"?
              • Then the price does tick down and closed(draw a red candle-the candle of 3)
                So a Red down candlestick, correct?
              • Next deals deals go and the price is worth it-also selling(painting candle red candle 4).
                So this is "price to sell"? Can you elaborate on this?


              I look forward to your response.

              Comment


                #8
                Originally posted by NinjaTrader_PatrickH View Post
                Hello AS007,

                Thank you for your response.

                So this would be a pre-existing bars type in another platform, is that correct? If so, can you provide the name of the bars type?

                In addition, can you help me to expand and elaborate on your initial inquiry?
                • So the Close is greater than the Open, is that correct?
                • Can you elaborate on the "price is to purchase"?
                • So a Red down candlestick, correct?
                • So this is "price to sell"? Can you elaborate on this?


                I look forward to your response.
                If we have a price tick up-it is recorded as a purchase
                If the price makes a tick up and stands at a level and there are some transactions, it is still recorded purchase
                If the price makes a tick down-it is recorded as a sale
                If the price makes a tick down and stands at a level and there are some transactions, then the sale is still recorded
                Attached Files

                Comment


                  #9
                  Hello AS007,

                  Thank you for your response.

                  Attached is an example of creating such an indicator. To import please download the file to your Desktop and then go to the NinjaTrader Control Center > Tools > Import > NinjaScript Add On and select the file from the desktop.

                  The indicator uses a bool to set whether the condition was for the green bar or the red bar and then check that bool to see if a prior bar was set and if the current bar should be set.

                  The conditions consist of the following:
                  • Code:
                    if (Close[0] > Close[1] || (Close[0] > Close[1] && Close[0] > Open[0]))
                    This checks if the current price is greater than the prior close or if the current price is greater than the prior close and greater than the current open.
                  • Code:
                    else if (Close[0] < Close[1] || (Close[0] < Close[1] && Close[0] < Open[0]))
                    This checks if the current price is less than the prior close or if the current price is less than the prior close and less than the current open.


                  We then check if the current price is the same as the prior close and if so we check the bool to see which of the earlier conditions returned true on the prior bar.
                  Code:
                  if (Close[0] == Close[1])
                  {
                  	if (ConditionCheck)
                  	{
                  		BarBrushes[0] = Brushes.Green;
                  	}
                  	else if (!ConditionCheck)
                  	{
                  		BarBrushes[0] = Brushes.Red;
                  	}
                  }
                  For information on working with price data in NinjaScript please visit the following link: https://ninjatrader.com/support/help...ice_series.htm
                  For information on BarBrushes please visit the following link: https://ninjatrader.com/support/help...barbrushes.htm

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

                  Comment


                    #10
                    Originally posted by NinjaTrader_PatrickH View Post
                    Hello AS007,

                    Thank you for your response.

                    Attached is an example of creating such an indicator. To import please download the file to your Desktop and then go to the NinjaTrader Control Center > Tools > Import > NinjaScript Add On and select the file from the desktop.

                    The indicator uses a bool to set whether the condition was for the green bar or the red bar and then check that bool to see if a prior bar was set and if the current bar should be set.

                    The conditions consist of the following:
                    • Code:
                      if (Close[0] > Close[1] || (Close[0] > Close[1] && Close[0] > Open[0]))
                      This checks if the current price is greater than the prior close or if the current price is greater than the prior close and greater than the current open.
                    • Code:
                      else if (Close[0] < Close[1] || (Close[0] < Close[1] && Close[0] < Open[0]))
                      This checks if the current price is less than the prior close or if the current price is less than the prior close and less than the current open.


                    We then check if the current price is the same as the prior close and if so we check the bool to see which of the earlier conditions returned true on the prior bar.
                    Code:
                    if (Close[0] == Close[1])
                    {
                    	if (ConditionCheck)
                    	{
                    		BarBrushes[0] = Brushes.Green;
                    	}
                    	else if (!ConditionCheck)
                    	{
                    		BarBrushes[0] = Brushes.Red;
                    	}
                    }
                    For information on working with price data in NinjaScript please visit the following link: https://ninjatrader.com/support/help...ice_series.htm
                    For information on BarBrushes please visit the following link: https://ninjatrader.com/support/help...barbrushes.htm

                    Please let me know if you have any questions.
                    Hi PatrickH
                    Thank you, very cool happened on bars, but the spark stops are not stained sorry(I think you can improve?) Also wanted to ask you to redo this simple indicator for eight (see attachment)
                    Attached Files

                    Comment


                      #11
                      Hello AS007,

                      Thank you for your response.

                      We do not provide programming services. The example I provided was simply an example to help you get started in indicator development. If you are looking for someone to develop indicators for you please let me know and I can have our affiliate NinjaTrader Ecosystem follow up with a list of NinjaScript Consultants.

                      Please let me know if you have any questions.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by bmartz, 03-12-2024, 06:12 AM
                      5 responses
                      32 views
                      0 likes
                      Last Post NinjaTrader_Zachary  
                      Started by Aviram Y, Today, 05:29 AM
                      4 responses
                      13 views
                      0 likes
                      Last Post Aviram Y  
                      Started by algospoke, 04-17-2024, 06:40 PM
                      3 responses
                      28 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by gentlebenthebear, Today, 01:30 AM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by cls71, Today, 04:45 AM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X