Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No DrawDown

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

    No DrawDown

    I try to plot a diamond+sound when jWillimas2 cross above and below the 20 and 80 lines.

    The cross above works fine and plot the diamons and sound.
    The cross below is not ploting a thing.

    Please see attached and please if anyone can get it, please do.

    protectedoverridevoid OnBarUpdate()

    {
    if (CrossAbove(jWilliams2(8,14,0),22,1))


    {
    // play sound
    DrawDiamond("Diamond"+CurrentBar, 0, Low[0] - 3*TickSize, Color.Black);
    PlaySound(
    @"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
    }


    if (CrossBelow(jWilliams2(8,14,0),80,1))


    {
    // play sound
    DrawDiamond("Diamond"+CurrentBar, 0, High[0] + 3*TickSize, Color.Black);
    PlaySound(
    @"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
    }
    Attached Files

    #2
    Hello Tzachi,

    You are using the same tag for both drawing objects, so that should be the first item to change. Change one of the tags to "Diamond2"+CurrentBar, for example.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan,

      Thanks. I did the change of one of the diamonds to diamond2 but nothing changed re ploting the down side.

      Comment


        #4
        Did you compile the changes (Right click in editor > Compile) as well as reload NinjaScript (Right click on chart > Reload NinjaScript)?

        If you've done this but are still not seeing the diamond, a simple print statement can be used to verify the condition is evaluating true. Check the print statement through the Tools > output window.

        if (CrossBelow(jWilliams2(8,14,0),80,1))
        {
        // play sound
        Print("DownSide Triggered");
        DrawDiamond("Diamond2"+CurrentBar, 0, High[0] + 3*TickSize, Color.Black);
        PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Alert1.wav");
        }
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Any idea what can makes the "above" to plot but not the "below"?

          Comment


            #6
            Ryan,

            Any other input to resolve this problem?

            Comment


              #7
              Sorry - didn't reply because there was no feedback on my last suggestions. You compiled and reloaded, added print statement? Were you able to get confirmation that the condition returned true?
              Last edited by NinjaTrader_RyanM1; 01-19-2011, 03:10 PM.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Can anyone help me find out what the problem with CrossDown plot as I posted on post #1?

                Still cannot get it to plot the down diamond.

                (print commend did not show anything on the output window)

                Comment


                  #9
                  Tzachi,

                  If the print statement didn't appear, then likely you have no bars that meet the condition. For the crossbelow condition to be true, the value of the indicator must be above 80 and then cross below it.

                  To debug this, print the value of the indicator to verify it's what you expect. Please see here for help using the debugging tools:
                  Ryan M.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  601 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  347 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  559 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  558 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X