Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator in strategy?

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

    Indicator in strategy?

    Hello,

    What graphic possibilities in strategy? I need to draw point of desired color on the chart when some event occurs. Is it possible?


    Regards,
    Igor

    #2
    Please see the Help Guide for all the available draw objects. Go to the index and just search Draw. You will find it listed out.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh,

      I added the code to my strategy:
      Code:
      [FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] iDotCount = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2];[/SIZE][/FONT]
       
      [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] PrintDot([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] y, Color color)[/SIZE][/FONT]
      [SIZE=2][FONT=Courier New]{ [/FONT][/SIZE]
      [FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] sTag = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"tag"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]+iDotCount.ToString();[/SIZE][/FONT]
      [SIZE=2][FONT=Courier New]iDotCount++;[/FONT][/SIZE]
      [SIZE=2][FONT=Courier New]DrawDot(sTag, [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], y, color);[/SIZE][/FONT]
      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
      and try to draw it like:
      Code:
      [FONT=Courier New][SIZE=2]PrintDot(High[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]]+TickSize,Color.LightGreen);[/SIZE][/FONT]
      but see nothing on the chart. Can you say where I'm wrong, please?

      Comment


        #4
        Instead of creating a function I suggest you just do:
        Code:
        DrawDot("tag"[B][COLOR=Red] + CurrentBar[/COLOR][/B], HIgh[0] + TickSize, Color.Blue);
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I'll try this, thanks!

          Comment


            #6
            Oh, I was so stupid! I simply must start my strategy from indicator window.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            580 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            335 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            102 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X