Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjatrader if then question

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

    Ninjatrader if then question

    Hi,

    I am trying to plot a simple dot formula on the chart under 2 conditions.

    I want condition one to exist and then plot a simple dot formula either with one color or another color.
    If condition one does not exist, plot nothing.

    1) How can I test to see if the current bars typical price is within the previous bars high to low range please?

    2) How can I then change the color of the simple dot formula?
    - plotting one color for when the previous bars close is less than or equal to the simple dot formula.
    - else plotting a different color when the previous bars close is greater than the simple dot formula.

    Thanks

    #2
    Hello tradethebonds,

    1. You may Print out some data that will help you determine that inside of the Output window (Tools -> Output). Here is a thread that you may view for more information about this.


    2. To change the colors of a single plot you may use the PlotColors method inside of NinjaTrader. Here is a link to our Help Guide that Demonstrates this.


    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Thanks,

      How might I ONLY plot this if

      Low[0] < Low[1]

      up = (Low[0]*2) - Low[1];

      please?

      Comment


        #4
        Hello tradethebonds,

        You would use an if() statement with that condition and then inside of the if statement place our code to plot the value.

        Code:
        if(Low[0] < Low[1])
        {
            // Do something like Plot0.Set(Close[0]);
        }

        You may view a tutorial similar to this inside of our Help Guide at the following link.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        132 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        74 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        117 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        113 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        89 views
        0 likes
        Last Post CarlTrading  
        Working...
        X