Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Icons will not plot on indicator

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

    Icons will not plot on indicator

    I cannot get a dot/diamond etc to plot on an indicator line, but the back ground colour will plot. The main part of my code is as follows
    ----------------------------------------
    MyDiff.Set((EMA(Close, 8)[0] - EMA(Close,17)[0]));
    MyAvg.Set(EMA(MyDiff,9)[0]);

    if (CrossBelow(MyDiff, MyAvg[0], 1))
    {
    DrawDot(CurrentBar.ToString(), false, 0,0, Color.Blue);
    BackColor = Color.Aqua;
    }
    -------------------------------------------
    Both the MyDiff and MyAvg lines will plot, and the Back Colour will plot, but the Draw Dot or other similar icons, will not plot.
    I have got similar code to plot with other indicators.
    I have spent at least 6 hrs trying different ideas, as well as looking at the Manual, even copying working code and only changing the special indicator names.
    If I had any hair, it would have been pulled out by now.
    Any suggestions would be greatly appreciated. Thank you
    Last edited by oldhiker; 11-01-2011, 06:58 PM. Reason: More info

    #2
    oldhiker, that's because you set a Y Axis value of 0 :

    DrawDot(CurrentBar.ToString(), false, 0,0, Color.Blue);

    Please try something like :

    DrawDot(CurrentBar.ToString(), false, 0, High[0] + TickSize, Color.Blue);
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello Bertrand,
      using High[0] will not work, as I am trying to plot the icons on a modified MACD. This is the reason for using *0*, as it is visible all the time.
      On another indicator, using CCI, the followind code works OK
      ------------------------------------------------
      if (CrossBelow(CCI(14), 100, 1)) // This is OK
      {
      DrawArrowDown("Down", true, 0, -50, Color.Red); // arrow referenced to the zero line
      DrawTriangleDown(CurrentBar.ToString() , false, 0, 120 , Color.Red );
      Print("---redCCI");
      DrawLine(CurrentBar.ToString(), true, 0, 140, 0, 50, Color.Red, DashStyle.Solid, 3);
      ClearOutputWindow(); // Only the last ClearOutputWindow() is activated.
      //DrawVerticalLine("MyVerticalLine", 0, Color.Black);
      }
      ---------------------------------------------------------------------
      It has got me very frustrated because I believe that the program can do what I want to happen.
      Thank you,
      Bill R

      Comment


        #4
        Thanks for the clarification here - so DrawOnPricePanel is set to false for those studies, correct?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hello Bertrand,
          No, I have used the default of
          ------------------------------
          Overlay = false;
          ----------------------------
          BackColor = Color.Aqua;
          -----------------------------
          plots OK, but that is the only additional indication, apart from the two lines
          --------------------------------
          Plot0.Set(MyDiff[0]); // green MACD
          Plot1.Set(MyAvg[0]);
          -------------------------------------------
          Thank you,
          Bill R

          Comment


            #6
            Please try with DrawOnPricePanel = false then if you would like to draw on the non primary but indicator panel with your study.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hello Bertrand,
              I changed the code as below
              --------------------------------------------
              // Overlay = false;
              DrawOnPricePanel = false;
              ----------------------------------------------
              and now I have some lovely big blue dots on the zero line.
              Thank you very much, but what is the difference between these two commands"
              Bill R

              Comment


                #8
                Overlay would be for the complete study / plots, i.e. if plotted in the main panel or not per default.

                The DrawOnPricePanel is only for any drawing commands and directs them to the price panel or indicator panel - http://www.ninjatrader.com/support/h...pricepanel.htm
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hello Bertrand,
                  Thank you for your assistance. Now I can go to bed and stop thinking what I am doing incorrectly. I will be incorporating this line of code in all my "special" indicators. Such a simple change.
                  I really enjoy working with NT. You chaps have done a great job.
                  I am off to bed now, so this will be my last transmission for the evening.
                  All the best,
                  oldhiker
                  And the other attachment is very good. In the past I have use a keyword search in the manual to find information, but it is time consuming.
                  ---------------------------

                  Comment


                    #10
                    You're welcome, thanks for the kind words about our NinjaTrader platform. Have a good nights sleep,
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by sidlercom80, 10-28-2023, 08:49 AM
                    168 responses
                    2,261 views
                    0 likes
                    Last Post sidlercom80  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    3 responses
                    10 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by WeyldFalcon, 12-10-2020, 06:48 PM
                    14 responses
                    1,428 views
                    0 likes
                    Last Post Handclap0241  
                    Started by DJ888, 04-16-2024, 06:09 PM
                    2 responses
                    9 views
                    0 likes
                    Last Post DJ888
                    by DJ888
                     
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    41 views
                    0 likes
                    Last Post jeronymite  
                    Working...
                    X