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

BarsUp/BarsDown Indicators

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

    BarsUp/BarsDown Indicators

    Regarding the "BarsUp/BarsDown" indicators, I was wondering is there an easy way to have those print as a dot above and below the bars on the price chart rather than a default separate indicator(s)?

    I have tried using different plot commands but I'm not having much luck. Thanks!

    #2
    Create a new custom indicator that checks the BarsUp/BarsDown indicators for a true condition, then call the DrawDot() method to draw the dot. Make sure you have

    Overlay = true;

    In initialize so a new indicator panel will not be created.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray, thanks for the info . . I'll try what you recommended.

      Comment


        #4
        Ray, I tried what you recommended but it's still not compiling correctly. Could you please tell me what I'm doing wrong . . Thanks!

        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        ///</summary>
        protectedoverridevoid Initialize()
        {
        Add (DrawDot(
        "tag1", true, 0, Low[0] - TickSize, Color.Red));
        CalculateOnBarClose =
        true;
        Overlay =
        true;
        }

        Comment


          #5
          Unfortunately I'm not familiar with the BarsUp/Dn indicators, but here's an idea how to plot a blue dot below the Low of the bar when a bar with an Up close was found -
          Code:
          [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] OnBarUpdate()
          {
          [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (Close[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]] > Open[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]])
          DrawDot(CurrentBar.ToString(), [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2], Low[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Verdana]] - TickSize, Color.Blue);[/FONT]
          }
          [/SIZE][/FONT][/SIZE][/FONT]



          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thanks Bertrand and Ray. Never got this to work. Obviously, NT programming is beyond me. This only took a fraction of the coding in Tradestation for me. Like other folks said regarding NT . . one needs to be a programmer first, then a trader. I guess I'll just live with it in a separate panel. Thanks for trying . .

            Comment


              #7
              You are welcome, you could also take a look at our strategy wizard and use this to generate the needed code with a point and click approach - http://www.ninjatrader-support.com/H...rdScreens.html

              You don't have to issue entry / exit orders, just use it to place your dot(s) when then conditions become true.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by z679Gju, Today, 02:37 PM
              0 responses
              2 views
              0 likes
              Last Post z679Gju
              by z679Gju
               
              Started by mintos, 04-02-2024, 08:22 PM
              10 responses
              45 views
              0 likes
              Last Post mintos
              by mintos
               
              Started by cmtjoancolmenero, Yesterday, 02:31 PM
              7 responses
              23 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by hdge4u, 04-29-2024, 12:23 PM
              3 responses
              19 views
              0 likes
              Last Post MisterTee  
              Started by PaulMohn, 04-24-2024, 03:49 AM
              5 responses
              40 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X