Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

similar indicator plots not working similarly?

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

    similar indicator plots not working similarly?

    The following logic works fine except the blue line, PlotXXO_1, should, but does not, behave just like PlotXXO_2 ???? The code places 3 indicator plots on 3 different charts. one of the charts is depicted in the attachment. The intended blue line logic has no effect in an attempt to change it from its original black solid line to a blue dotted line.

    no problem with the red line, PlotXXO.
    no problem with the green line, PlotXXO_2.
    the intended blue line will not change. It remains a black line, as it was initially created a few days ago [ie] it does not change with the updated current logic although it works for the green line ????

    ***INITIALIZE REGION***
    protected override void Initialize()
    {
    Overlay=true;
    Add(new Plot(new Pen(Color.Red, 2), "PlotXXO"));
    Add(new Plot(new Pen(Color.Blue, 2), PlotStyle.Dot, "PlotXXO_1"));
    Add(new Plot(new Pen(Color.Green, 2), PlotStyle.Dot, "PlotXXO_2"));
    CalculateOnBarClose = false;
    }

    ***from OnBarUpdate() REGION***
    if (Instrument.FullName == "$EURUSD")/
    {
    PlotXXO.Set(XXOpen);
    EURUSDticks=150;
    PlotXXO_1.Set(XXOpen + (TickSize*EURUSDticks));
    PlotXXO_2.Set(XXOpen - (TickSize*EURUSDticks));

    else if (Instrument.FullName == "$USDJPY")
    {
    PlotXXO.Set(XXOpen);
    USDJPYticks=75;
    PlotXXO_1.Set(XXOpen + (TickSize*USDJPYticks));
    PlotXXO_2.Set(XXOpen - (TickSize*USDJPYticks));
    }
    else if (Instrument.FullName == "ZN 12-13")
    {
    PlotXXO.Set(XXOpen);
    ZNticks=75;
    PlotXXO_1.Set(XXOpen + (TickSize*ZNticks));
    PlotXXO_2.Set(XXOpen - (TickSize*ZNticks));
    }
    Attached Files

    #2
    Hello joemiller,

    When changing the Properties inside of Initialize() for a Plot you will need to remove the Indicator from the Chart and then Add it back in for the changes to take effect.

    If you remove the Indicator and Add it back in do you see the "PlotXXO_1" change to a Blue Dot?

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      wow that was a fast reply [10 mnutes].
      yes I have been doing what you suggest. that is why the changes for the green dotted line took effect. and the changes for the green dotted line appear to me to be the same as for the intended blue dotted line.

      Comment


        #4
        Hello joemiller,

        Do you have a Default template saved for that Indicator by chance? You can verify this by going to (My) Documents -> NinjaTrader 7 -> templates -> Indicator folder and inside of this folder if you have a template saved you may see a file named "<NameOfYourIndicator>.xml". This can automatically settings of your indicator, so if you see this you may want to delete this so your changes in your code can take effect.

        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          That did the trick JC.

          thanks,
          JC [Miller]

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,227 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          7 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          440 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          12 views
          0 likes
          Last Post FAQtrader  
          Working...
          X