• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 shdbgvfhjf, Today, 05:57 AM
          0 responses
          4 views
          0 likes
          Last Post shdbgvfhjf  
          Started by stefanrvc, Today, 04:59 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by 7robert, Yesterday, 08:30 PM
          2 responses
          16 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by pjsmith, Today, 01:13 AM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Started by yukashg, Yesterday, 09:56 PM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChrisSch  
          Working...
          X