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

Simple StochRSI Problem!

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

    Simple StochRSI Problem!

    Hey I'm having the craziest problem, but I know it has to be easy to fix. just can't do it.

    I'm just trying to get a Dot drawn when StochRSI goes overbought or Sold.

    Code:
    if(CrossBelow(StochRSI(14), OS, 1))
    			{ 
    				 DrawDot("My dot" + CurrentBar, false, 0, 0, Color.Blue);
    			}
    			
    			//If OverBought
    			if(CrossAbove(StochRSI(14), OB, 1))
    			{
    				 DrawDot("LongDot" + CurrentBar, false, 0, 0, Color.Red);
    			}
    I've attached the indicator. It DOESn't Work, I'm NOT getting errors, but I'm not getting drawings either. Please help.

    Thanks!!
    Attached Files

    #2
    Originally posted by ginx10k View Post
    Hey I'm having the craziest problem, but I know it has to be easy to fix. just can't do it.

    I'm just trying to get a Dot drawn when StochRSI goes overbought or Sold.

    Code:
    if(CrossBelow(StochRSI(14), OS, 1))
                { 
                     DrawDot("My dot" + CurrentBar, false, 0, 0, Color.Blue);
                }
                
                //If OverBought
                if(CrossAbove(StochRSI(14), OB, 1))
                {
                     DrawDot("LongDot" + CurrentBar, false, 0, 0, Color.Red);
                }
    I've attached the indicator. It DOESn't Work, I'm NOT getting errors, but I'm not getting drawings either. Please help.

    Thanks!!
    Your code draws the dot at a price level 0, which is beyond the bounds of the chart.

    If you wish to see the dots, draw them close to price, for example

    Code:
    DrawDot("LongDot" + CurrentBar, false, 0, Low[0] - 3 * TickSize, Color.Red);

    Comment


      #3
      Fixed

      Can't believe it was so simple. thanks harry. much appreciated

      Comment


        #4
        hi.
        i want to also create the indicator with the following snippet:
        **********
        //if OverSold
        if(CrossBelow(StochRSI(14), OS, 1))
        {
        DrawDot("ShortDot" + CurrentBar, false, Low[0], -3, Color.Magenta);
        }

        //If OverBought
        if(CrossAbove(StochRSI(14), OB, 1))
        {
        DrawDot("LongDot" + CurrentBar, false, 0, Low[0] - 3 * TickSize, Color.Magenta);
        }


        ************
        but when I copy paste it into a wizard created indicator it creates all kinds of errors. What is the code of a basic Template- and where do i copy the snippet?
        any help would be awesome!

        Comment


          #5
          Please post the entire indicator that creates the problem. If you just post a snippet, nobody can help you.

          For example if you declare variables "oB" and "oS" in the variables section, and then call "OB" and "OS" in OnBarUpdate(), the indicator cannot work, because C# is case sensitive.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Today, 06:40 PM
          0 responses
          10 views
          0 likes
          Last Post algospoke  
          Started by maybeimnotrader, Today, 05:46 PM
          0 responses
          8 views
          0 likes
          Last Post maybeimnotrader  
          Started by quantismo, Today, 05:13 PM
          0 responses
          7 views
          0 likes
          Last Post quantismo  
          Started by AttiM, 02-14-2024, 05:20 PM
          8 responses
          169 views
          0 likes
          Last Post jeronymite  
          Started by cre8able, Today, 04:22 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X