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

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 aussugardefender, Today, 01:07 AM
        0 responses
        3 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        383 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        4 views
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Working...
        X