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

NT7 charts all over the place

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

    NT7 charts all over the place

    Hello friends, My name is Juan, and I am writing to see if you can help me with a little problem that I have, I am making an indicator and I have a small problem, and I want to see if you can help me solve it, it happens that the Indicator I put a rectangle But when I throw the rectangle No forward does not run does not move forward Stationary, and so that it can move I have to refresh the chart, see if you can help me solve that problem please Thank you beforehand.

    And here below he left what I did.
    --------------------------------------------------------------------------------------------------------------------
    protected override void OnBarUpdate()
    {
    if (CurrentBar == 0) return;

    if(Open[0] == Close[0])
    {
    if (showshadow) base.DrawRectangle("Rect"+ CurrentBars[0],false,Times[0][15],High[0]+(HighestBar(High,1)),Times[0]
    [-shadowlength],Low[0]-(LowestBar(Low,-1)),tr,shadowcolor,opacity);

    }

    }

    #2
    Hello adonm5,

    Anytime DrawRectangle() is called with the same tag name, this will re-draw the object using the new parameters. This means the existing object will be updated and moved.

    Anytime a unique tag name is used, a new drawing object will be made.

    With "Rect"+ CurrentBars[0] as the tag name, I would expect a new object to be made each time the Open[0] is equal to the Close[0] and showshadow is true.

    If you want a single object, remove the +CurrentBars[0] from the tag name so the tag name is no longer unique. This will cause the existing object to be updated and moved instead of a new object drawn.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi guys, I hope you are well. I am trying to communicate with you to see if you can help me with a problem with an indicator that is treated as it should be but I have not been able to complete it, it happens that when I put the object it does not move forward, and I am not really programmer I do not have much experience is just what I want to do, to see if you can help me how to modify the rectangle that runs to the right every time a candle saw every time the price moves forward the bar moves forward I also want to move the indicator along with it to see if you can help me with that please, if you can give an example of how I can do it and remember that I am not a programmer, it is a very simple indicator but I can not fix it that is everything if you can help me please thank you very much.

      And the indicator is left below so they can tell me what I should do.

      #region Variables
      // Wizard generated variables
      int opacity = 6;
      bool showshadow = true;
      int shadowlength = 105;
      Color shadowcolor = Color.Gold;
      private Color transp = Color.Transparent;
      // User defined variables (add any user defined variables below)
      #endregion

      /// <summary>
      /// This method is used to configure the strategy and is called once before any strategy method is called.
      /// </summary>
      protected override void Initialize()
      {
      CalculateOnBarClose = true;
      Overlay = true;
      }

      protected override void OnBarUpdate()
      {
      // Condition set 1
      if (Open[0] == Close[0])
      {
      // DrawRectangle("tag1", showshadow,-shadowlength, Low[0] - TickSize, 5, High[0] + TickSize, transp, shadowcolor, opacity);

      // DrawRectangle("Rect" + CurrentBar ,showshadow,Times[0][15],High[0],Times[0][-shadowlength],Low[0],transp,shadowcolor,opacity);
      }
      }

      Comment


        #4
        Hello adonm5,

        Thank you for writing in.

        I would suggest checking out the following example which contains the logic for drawing rectangles ahead from the point they are found,
        https://ninjatraderecosystem.com/user-app-share-download/colored-zones/
        https://ninjatraderecosystem.com/user-app-share-download/colorzone3/



        You may also find this sample helpful,
        https://ninjatraderecosystem.com/user-app-share-download/insidebar/
        https://ninjatraderecosystem.com/user-app-share-download/dynamicsrlines/


        If you are still unable to get the indicator working as desired and would like a list of third parties that would be interested in building this for you please let us know.

        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        2 responses
        21 views
        0 likes
        Last Post maybeimnotrader  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        7 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by merzo, 06-25-2023, 02:19 AM
        10 responses
        823 views
        1 like
        Last Post NinjaTrader_ChristopherJ  
        Started by frankthearm, Today, 09:08 AM
        5 responses
        22 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X