Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

-ve/+ve Values

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

    -ve/+ve Values

    need the syntax help for the indicator for MA, that I want to pass negative or positive values
    depending on the Rising or Falling condition for Stcohastics. How do I set the Value with sign ?

    ~kin.,

    #2
    Hello Kin,

    Thank you for your note.

    Which moving average indicator are you attempting to call?

    Are you coding this directly using the code editor window, or are you using the Strategy Wizard?

    The SMA, EMA, and HMA moving averages all take only one overload parameter and that is the period. The period is the amount of bars that you would like the moving average indicator to calculate over. This cannot be a negative value as it would mean that you would like the indicator to calculate for a negative amount of bars which is not possible.


    I look forward to working with you further.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      coding in the code editor window. And did write few custom indicators before. This indicator is for MA and what I'm doing right now in one of the Column in MA is just pass on the Stochastics daily value.
      Right now it is as simple as : Value.set(Stochastics(14,3).D[0]);
      What I want to do now is depending on Rising or Falling of the Stochastics I want to change color in the MA Column.

      How do i do that ?.

      Comment


        #4
        Hello kinshin9,

        To change the color of the plot you can use PlotColors.

        For example:
        Code:
        Value.set(Stochastics(14,3).D[0]);
        PlotColors[0][0] = Color.Red;
        Below is a link to the help guide on PlotColors.
        http://www.ninjatrader.com/support/h...plotcolors.htm


        Please let me know if this does not resolve your inquiry.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Let me try again. What I am doing right nowis , the MA column would show the value of stochastics.
          For example If the daily stochasitcs is 30 it would show 30 if 15 it would show 15. But I do not know is it +30 or -30 / +15 or -15 meaning is the stochasitcs raising or falling ?. What would I do in the code to add this + or - sign to the integer. That's all I want. Hope I am clear this time

          Comment


            #6
            Hello kinshin9,

            Thank you for the clarification.

            Try the following:

            Code:
            if (Falling(Stochastics(14,3).D[0]))
            {
            	Value.Set(-1 * Stochastics(14,3).D[0]);
            }
            else
            {
            	Value.Set(Stochastics(14,3).D[0]);
            }
            What this will do is if the Stochastics is falling it will multiply the .D value with -1 to make the integer negative.


            Also, I am now understanding that the MA is the indicator you are coding and that you are trying to use this with the Market Analyzer.


            Please let me know if this does not resolve your inquiry.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks a bunch I just finished coding it by subtractng (0-stoch[0]) if falling .

              Comment


                #8
                Hi kinshin9,

                That works too :-).

                Please let me know if I can be of any other assistance for you.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GussJ, 03-04-2020, 03:11 PM
                15 responses
                3,271 views
                0 likes
                Last Post xiinteractive  
                Started by Tim-c, Today, 02:10 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Taddypole, Today, 02:47 PM
                0 responses
                2 views
                0 likes
                Last Post Taddypole  
                Started by chbruno, 04-24-2024, 04:10 PM
                4 responses
                51 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by TraderG23, 12-08-2023, 07:56 AM
                10 responses
                403 views
                1 like
                Last Post beobast
                by beobast
                 
                Working...
                X