Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          132 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          74 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          117 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          113 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          89 views
          0 likes
          Last Post CarlTrading  
          Working...
          X