Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw text/ arrows not showing in a strategy

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

    draw text/ arrows not showing in a strategy


    The strategy worked long ago. But all my draw text and arrows not working suddenly so I try this simple one. My indicators can draw texts and arrows but just strategy doesn't.

    I also review "Drawing objects" windows. Can't find tags. Ninjatrader output window does print the debug info, so the draw arrow or text code block was executed.
    // Set 1
    if (CrossAbove(MACD1.Default, MACD2.Avg, 1))
    {
    MACDCrossUp = true;
    Draw.Text(this, @"plotMACDSto Text_1", @"MACD up", 0, (Low[0] + (-3 * TickSize)) );
    Print(Convert.ToString(Times[0][0].TimeOfDay));
    Print(@"CrossAbove MACD");
    }

    // Set 2
    if (CrossAbove(Stochastics1.K, Stochastics1.D, 1))
    {
    StoCrossUp = true;
    Draw.Text(this, @"plotMACDSto Text_2", @"sto Up", 0, (GetCurrentAsk(0) + ((Low[0] + (-5 * TickSize)) * TickSize)) );
    Print(Convert.ToString(Times[0][0].TimeOfDay));
    Print(@"CrossAbove Sto");
    Draw.Text(this, @"plotMACDSto Text_2", @"sto Up", 0, (GetCurrentAsk(0) + ((Low[0] + (-5 * TickSize)) * TickSize)) );
    }​

    #2
    Hello sysmatrix,

    I'm noting the tag names are being re-used, so the existing objects should be updated.
    To confirm, the Drawing objects window is blank with no objects?

    To confirm, this is code in the strategy and the strategy is being applied to a chart, is this correct?

    May I test the script?

    To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
    1. Click Tools -> Export -> NinjaScript Add-on...
    2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
    3. Click the 'Export' button
    4. Enter the script name in the value for 'File name:'
    5. Choose a save location -> click Save
    6. Click OK to clear the export location message
    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
    Below is a link to the help guide on Exporting NinjaScripts.
    http://ninjatrader.com/support/helpG...nt8/export.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Attached the zip file. Thank you !!
      Attached Files

      Comment


        #4
        Yes the strategy is attached to a chart. It runs and print debug info on the output window

        Comment


          #5
          Hello sysmatrix,

          I've tested adding the strategy to a chart and I am finding this is drawing thousands of objects on the chart.

          Below is a link to a video of the test.


          Using the exact steps shown in the video, the behavior is different than what is shown in the video?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Yes. I worked before. Is there anything I can check on Ninjatrader? Only my other indicators show arrows/ text now, but not strategies.

            Comment


              #7
              Hello sysmatrix,

              Are you certain you are testing on your end the script that you provided me that I've tested in the video?

              Try opening a new ES 09-24 1 minute chart.

              Follow the steps exactly as in the video and enable the strategy on the chart.

              Then open the Drawing objects window

              Take a screenshot of the chart and Drawing objects window.

              To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool or Snip and Sketch.
              Click here for instructions using Snipping Tool
              Click here for instructions using Snip and Sketch

              Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
              Click here for detailed instruction
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thanks. open a new chart works.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                27 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                124 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                64 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                41 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X