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

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.



          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.
                            BrandonNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by kempotrader, Today, 08:56 AM
                            0 responses
                            7 views
                            0 likes
                            Last Post kempotrader  
                            Started by kempotrader, Today, 08:54 AM
                            0 responses
                            4 views
                            0 likes
                            Last Post kempotrader  
                            Started by mmenigma, Today, 08:54 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post mmenigma  
                            Started by halgo_boulder, Today, 08:44 AM
                            0 responses
                            2 views
                            0 likes
                            Last Post halgo_boulder  
                            Started by drewski1980, Today, 08:24 AM
                            0 responses
                            4 views
                            0 likes
                            Last Post drewski1980  
                            Working...
                            X