• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Object

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

    Drawing Object

    Hi everybody,

    I would like to know something, On the
    protected
    overridevoid OnBarUpdate()
    {
    // System variable
    double Rsi = RSI(RSI_Period,3)[0];
    double RsiAvg = RSI(RSI_Period,3).Avg[0];

    If I put a 0 on the RSI bar ago my I can draw a plot but if I write a 1

    protectedoverridevoid OnBarUpdate()
    {
    // System variable
    double Rsi = RSI(RSI_Period,3)[1];
    double RsiAvg = RSI(RSI_Period,3).Avg[1];

    I can't draw a plot on the chart

    Could you help me

    Thanks


    #2
    Originally posted by Dervakon View Post
    Hi everybody,

    I would like to know something, On the
    protected
    overridevoid OnBarUpdate()
    {
    // System variable
    double Rsi = RSI(RSI_Period,3)[0];
    double RsiAvg = RSI(RSI_Period,3).Avg[0];

    If I put a 0 on the RSI bar ago my I can draw a plot but if I write a 1

    protectedoverridevoid OnBarUpdate()
    {
    // System variable
    double Rsi = RSI(RSI_Period,3)[1];
    double RsiAvg = RSI(RSI_Period,3).Avg[1];

    I can't draw a plot on the chart

    Could you help me

    Thanks

    In your failed case, what is the error in the log?

    Comment


      #3
      Dervakon,

      Please ensure you are using :

      if( CurrentBar < BarsRequired ) return;

      Towards the beginning of your block of code. You can even replace BarsRequired with 1 or however far you are looking back.

      Please let me know if I may assist further.
      Adam P.NinjaTrader Customer Service

      Comment


        #4
        Dot Size

        Hi, how do i personalize the size of the dots? i cant seem to find the way in the help guide

        DrawDot("Dots_Alerts"+CurrentBar, true, 1, Value[1], signalcolup);


        thank you

        Comment


          #5
          kabott,

          Unfortunately this is not currently possible. You could probably use DrawEllipse to draw larger circular objects. Please find a link to info on this below.

          http://www.ninjatrader.com/support/h...rawellipse.htm

          Please let me know if I may assist further.
          Adam P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by kabott View Post
            Hi, how do i personalize the size of the dots? i cant seem to find the way in the help guide

            DrawDot("Dots_Alerts"+CurrentBar, true, 1, Value[1], signalcolup);


            thank you
            Use DrawText() and draw a period. In addition to allowing you to specify size and color, you get the immeasurable benefit of being able to place the dot an EXACT number of pixels from any of the OHLC values that you choose.
            Last edited by koganam; 12-05-2011, 04:49 PM.

            Comment


              #7
              Im sorry but im just starting with ninjascript and my knowledge is very basic, i want to draw a dot to show the "fractal" of a stochastic line and a couple errors occur wen i try to compile(using text), isn't there a simple way to reduce the size of the dots using the DrawDot without reducing the size of the candles as well?

              Comment


                #8
                Originally posted by kabott View Post
                Im sorry but im just starting with ninjascript and my knowledge is very basic, i want to draw a dot to show the "fractal" of a stochastic line and a couple errors occur wen i try to compile(using text), isn't there a simple way to reduce the size of the dots using the DrawDot without reducing the size of the candles as well?
                Unfortunately, no. NT did not see fit to give us the parameters to size dots when using DrawDot().

                Comment


                  #9
                  Koganam and Kabott,

                  The main issue is the dots are essentially images. They would be all pixelated at larger resolutions. You can use DrawEllipse() or use the DrawTextFixed() to draw multiple sized circular objects. I will mention this suggestion to development.

                  Please let us know if you require additional assistance.
                  Adam P.NinjaTrader Customer Service

                  Comment


                    #10
                    Dervakon,

                    Please ensure you are using :

                    if( CurrentBar < BarsRequired ) return;

                    Towards the beginning of your block of code. You can even replace BarsRequired with 1 or however far you are looking back.

                    Please let me know if I may assist further.

                    I found it right after I write my email...

                    Thanks again everybody...

                    Comment


                      #11
                      &quot;counting dots&quot;

                      Hi, if i have:

                      DrawDot("T1"+CurrentBar, etc etc etc)

                      what code do i need to get how many Dots/Signals were triggered historically?

                      (since first started to calculate)

                      i want the indie to display the total Nº of "signals" on the chart

                      thanks
                      Last edited by kabott; 01-09-2012, 04:31 AM.

                      Comment


                        #12
                        You would need to count via custom code each time your condition to draw is adding an object then, a related sample working on a trade limiter per session could be seen here - http://www.ninjatrader.com/support/f...ad.php?t=19182
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          How to reduce dot size

                          Hello. I use DrawDot() to see stoploss on the chart. But these dots are really larger/wider than bar.

                          Comment


                            #14
                            Hello alexstox,
                            Thanks for your post.
                            You would not be able to adjust the size of the dot, however what may work is using DrawText(), placing a period, and adjusting the font size or using a symbol based font such as wingdings.
                            Below I have provided a link to the DrawTest() section of our help guide.
                            http://www.ninjatrader.com/support/h...l?drawtext.htm
                            BrandonNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by seagraph, Today, 03:27 PM
                            0 responses
                            11 views
                            0 likes
                            Last Post seagraph  
                            Started by dedouglas, Today, 02:54 PM
                            1 response
                            10 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by elkhatabi, 08-01-2019, 06:36 PM
                            5 responses
                            52 views
                            0 likes
                            Last Post NinjaTrader_RyanL  
                            Started by mr_trade, Today, 01:01 PM
                            4 responses
                            17 views
                            0 likes
                            Last Post mr_trade  
                            Started by Renorail, Today, 12:31 PM
                            1 response
                            12 views
                            0 likes
                            Last Post NinjaTrader_PaulH  
                            Working...
                            X