Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help needed with my first indicator please

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

    Help needed with my first indicator please

    I am a newby at developing indicators and am having some trouble working on one in NT7.

    1. How do I send something to the print output window? I know where to find it, and have included the following line in my code: Print (“Calc1:” + Calc1); The indicator compiles ok, but I see nothing on the output window.
    2. I have created a DrawText line in the indicator, which is intended to show the results of my calculation on the 1st panel of the chart. When I add the indicator to the chart, all I get is the text string which refers to my calculation. I believe I need to convert the double of my calculation ToString. Can someone give an example of how that would be written in the string location of the DrawText?
    3. Additionally, my results should show up above several bars on the chart, but currently I am only seeing the text string above the last bar to meet my conditions – if I change the conditions it appears above another bar that meets it. In the DrawText code, I have shown the barsAgo as 0, but do I need to be referring to CurrentBar in some way to get all of them to show?
    4. DrawText (Tagcalc1, "calc1", 0, High[0] + 4 * TickSize, Color.Black);

    Thanks in advance

    #2
    1. You would need to reload all historical data(rightlick on the chart) with an open output window (if you have the indicator apllied to the chart) or reapply the indicator to see the prints. however if your print is included in an if condition the obvious problem could also be that the if statement is never true.

    2. Calc1.ToString()

    3. that (if i undestand you correctly) would occur if the string that is the tag of the drawingtool stays the same. so DrawText("text", ...);
    if you put it like this the drawingtool will be updated for everybar. that is usefull if you dont want irrelevant historical spam on your chart.
    if you however want the drawingtools to be apllied to all candles that meet ur condition than u would need to alternate the stringtag, usally with "+CurrentBar" to include a number that is everchanging.
    so DrawText("text"+CurrentBar, ...);

    Comment


      #3
      Hello,

      Thank you for the questions.

      For debugging, I would suggest this guide: http://ninjatrader.com/support/forum...ead.php?t=3418

      Essentially all that is needed is to use
      Code:
      Print("Some value or text");
      If your varialbe name is calc1, you would just need to remove the quotes and add .ToString() or:

      Code:
      DrawText (Tagcalc1, calc1.ToString(), 0, High[0] + 4 * TickSize, Color.Black);
      For more than 1 object, you would need to make the Tag unique, appending the current bar to the tag is an easy way to do this:

      Code:
      DrawText (Tagcalc1 + CurrentBar, calc1.ToString(), 0, High[0] + 4 * TickSize, Color.Black);
      I look forward to being of further assistance.

      Comment


        #4
        Ha....
        I won

        Comment


          #5
          actually, your on top, so i guess u win.

          also

          thats what she said.

          Comment


            #6
            Absolutely awesome speed of response and great clear instructions which have all worked. You both won as far as I am concerned.

            Thanks!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            607 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            353 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            561 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X